Merge branch 'master' into 'deployment/production'
Master See merge request !36
Showing
11 changed files
with
1486 additions
and
75 deletions
1 | # ビデオライブラリ - 動画カテゴリー別に記事を一覧表示するモジュール | ||
2 | ビデオライブラリ配下の動画カテゴリーごとに、記事を一覧表示させるモジュールです。 | ||
3 | |||
4 | ビデオライブラリの運用手順につきましては、別途ドキュメントが有ります。 | ||
5 | [ビデオライブラリドキュメント](https://docs.google.com/document/d/1Mv310DNpZQIXYQrS9QYY9q_uzCUZxF9K6jtkQOx7ouc/edit?usp=sharing) | ||
6 | |||
7 | ## インストール手順 | ||
8 | 1. 管理画面ログイン | ||
9 | 2. エクステンション配下の管理を選択 | ||
10 | 3. (フォルダからインストール)を選択 | ||
11 | 4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge) | ||
12 | 5. チェックしてインストール | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_CATEGORY_CUSTOM="Articles - Category" | ||
7 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_DESC="Select how you would like the articles to be grouped." | ||
8 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_LABEL="Article Grouping" | ||
9 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_DESC="Select the direction you would like the Article Groupings to be ordered by." | ||
10 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_LABEL="Grouping Direction" | ||
11 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_DESC="Select which field you would like Articles to be ordered by. Featured Ordering should only be used when Filtering Option for Featured Articles is set to 'Only'." | ||
12 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_LABEL="Article Field to Order By" | ||
13 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_DESC="Select the direction you would like Articles to be ordered by." | ||
14 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_LABEL="Ordering Direction" | ||
15 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_DESC="Select one or more authors from the list below." | ||
16 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_LABEL="Authors" | ||
17 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_DESC="Select one or more author aliases from the list below." | ||
18 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_LABEL="Author Aliases" | ||
19 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_DESC="Select Inclusive to Include the Selected Author Aliases, Exclusive to Exclude the Selected Author Aliases." | ||
20 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_LABEL="Author Alias Filtering Type" | ||
21 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_DESC="Select Inclusive to Include the Selected Authors, Exclusive to Exclude the Selected Authors." | ||
22 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_LABEL="Author Filtering Type" | ||
23 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_DESC="The number of child category levels to return." | ||
24 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_LABEL="Category Depth" | ||
25 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATEGORY_DESC="Please select one or more categories." | ||
26 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_DESC="Select Inclusive to Include the Selected Categories, Exclusive to Exclude the Selected Categories." | ||
27 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_LABEL="Category Filtering Type" | ||
28 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_DESC="The number of items to display. The default value of 0 will display all articles." | ||
29 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_LABEL="Count" | ||
30 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_DESC="Select which date field you want the date range to be applied to." | ||
31 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_LABEL="Date Range Field" | ||
32 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_DESC="Select which date field you want to display." | ||
33 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_LABEL="Date Field" | ||
34 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_DESC="Please enter in a valid date format. See: https://php.net/date for formatting information." | ||
35 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_LABEL="Date Format" | ||
36 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_DESC="Select Date Filtering Type." | ||
37 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_LABEL="Date Filtering" | ||
38 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEGROUPINGFIELD_DESC="Select which date field you want the date grouping to be applied to." | ||
39 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEGROUPINGFIELD_LABEL="Date Grouping Field" | ||
40 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_DESC="Please enter an End Date." | ||
41 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_LABEL="To Date" | ||
42 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_DESC="Please enter each Article ID on a new line." | ||
43 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_LABEL="Article IDs to Exclude" | ||
44 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DISPLAY_LABEL="Display Options" | ||
45 | ; The following string is deprecated and will be removed with 4.0 | ||
46 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DYNAMIC_LABEL="Dynamic Mode Options" | ||
47 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_FILTERING_LABEL="Filtering Options" | ||
48 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_GROUPING_LABEL="Grouping Options" | ||
49 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_ORDERING_LABEL="Ordering Options" | ||
50 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_DESC="Please enter in a numeric character limit value. The introtext will be trimmed to the number of characters you enter." | ||
51 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_LABEL="Introtext Limit" | ||
52 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_LABEL="Linked Titles" | ||
53 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_DESC="Linked titles." | ||
54 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_DESC="Please select the mode you would like to use. If Normal Mode is chosen, then configure the module and it will display a static list of Articles on the menu items you assign the module to. If Dynamic Mode is chosen, then you can still configure the module normally, however now the Category option will no longer be used. Instead, the module will dynamically detect if you are on a Category view and will display the list of articles within that Category. When Dynamic Mode is chosen, it is best to leave the module set to display on all pages, as it will decide to display anything dynamically." | ||
55 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_LABEL="Mode" | ||
56 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_DESC="Please enter in a valid date format. See: https://php.net/date for formatting information." | ||
57 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_LABEL="Month and Year Display Format" | ||
58 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_DESC="Please enter a numeric value. Results will be retrieved relative to the current date and the value you enter." | ||
59 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_LABEL="Relative Date" | ||
60 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWAUTHOR_DESC="Select Show if you would like the author (or author alias instead, if available) to be displayed." | ||
61 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCATEGORY_DESC="Select Show if you would like the category name displayed." | ||
62 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_DESC="Include or Exclude Articles from Child Categories." | ||
63 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL="Child Category Articles" | ||
64 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWDATE_DESC="Select Show if you would like the date displayed." | ||
65 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_DESC="Select to Show, Hide, or Only display Featured Articles." | ||
66 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_LABEL="Featured Articles" | ||
67 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_DESC="Select Show if you would like the hits for each article to be displayed." | ||
68 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_LABEL="Hits" | ||
69 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_DESC="Select Show if you would like the introtext to be displayed." | ||
70 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_LABEL="Introtext" | ||
71 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_DESC="Select to Show or hide Article List from Article Pages. This means that the module will only display itself dynamically on Category Pages." | ||
72 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_LABEL="Show on Article Page" | ||
73 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWTAGS_DESC="Show the tags for each article." | ||
74 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_DESC="Please enter a Starting Date." | ||
75 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_LABEL="Start Date Range" | ||
76 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ASCENDING_VALUE="Ascending" | ||
77 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_CREATED_VALUE="Created Date" | ||
78 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DATERANGE_VALUE="Date Range" | ||
79 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DESCENDING_VALUE="Descending" | ||
80 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DYNAMIC_VALUE="Dynamic" | ||
81 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUDE_VALUE="Exclude" | ||
82 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUSIVE_VALUE="Exclusive" | ||
83 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_HITS_VALUE="Hits" | ||
84 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ID_VALUE="ID" | ||
85 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUDE_VALUE="Include" | ||
86 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUSIVE_VALUE="Inclusive" | ||
87 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MODIFIED_VALUE="Modified Date" | ||
88 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MONTHYEAR_VALUE="Month and Year" | ||
89 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_NORMAL_VALUE="Normal" | ||
90 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_OFF_VALUE="Off" | ||
91 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ONLYFEATURED_VALUE="Only" | ||
92 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERING_VALUE="Article Order" | ||
93 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERINGFEATURED_VALUE="Featured Articles Order" | ||
94 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RANDOM_VALUE="Random" | ||
95 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RATING_VALUE="Rating" | ||
96 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RELATIVEDAY_VALUE="Relative Date" | ||
97 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_STARTPUBLISHING_VALUE="Start Publishing Date" | ||
98 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_FINISHPUBLISHING_VALUE="Finish Publishing Date" | ||
99 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_VOTE_VALUE="Vote" | ||
100 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_YEAR_VALUE="Year" | ||
101 | MOD_ARTICLES_CATEGORY_CUSTOM_READ_MORE="Read more: " | ||
102 | MOD_ARTICLES_CATEGORY_CUSTOM_READ_MORE_TITLE="Read More ..." | ||
103 | MOD_ARTICLES_CATEGORY_CUSTOM_REGISTER_TO_READ_MORE="Register to read more" | ||
104 | MOD_ARTICLES_CATEGORY_CUSTOM_UNTAGGED="Untagged" | ||
105 | MOD_ARTICLES_CATEGORY_CUSTOM_XML_DESCRIPTION="This module displays a list of articles from one or more categories." |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2019 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_CATEGORY_CUSTOM="Articles - Category" | ||
7 | MOD_ARTICLES_CATEGORY_CUSTOM_XML_DESCRIPTION="This module displays a list of articles from one or more categories." | ||
8 | MOD_ARTICLES_CATEGORY_CUSTOM_LAYOUT_DEFAULT="Default" | ||
9 |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_category_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | use Joomla\String\StringHelper; | ||
13 | |||
14 | $com_path = JPATH_SITE . '/components/com_content/'; | ||
15 | |||
16 | JLoader::register('ContentHelperRoute', $com_path . 'helpers/route.php'); | ||
17 | JModelLegacy::addIncludePath($com_path . 'models', 'ContentModel'); | ||
18 | |||
19 | /** | ||
20 | * Helper for mod_articles_categorymod_articles_categoryのヘルパー | ||
21 | * | ||
22 | * @since 1.6 | ||
23 | */ | ||
24 | abstract class ModArticlesCategoryCustomHelper | ||
25 | { | ||
26 | /** | ||
27 | * Get a list of articles from a specific category特定のカテゴリから記事のリストを取得します | ||
28 | * | ||
29 | * @param \Joomla\Registry\Registry &$params object holding the models parametersモデルパラメータを保持するオブジェクト | ||
30 | * | ||
31 | * @return mixed | ||
32 | * | ||
33 | * @since 1.6 | ||
34 | */ | ||
35 | public static function getList(&$params) | ||
36 | { | ||
37 | // Get an instance of the generic articles model一般的な記事モデルのインスタンスを取得します | ||
38 | $articles = JModelLegacy::getInstance('Articles', 'ContentModel', array('ignore_request' => true)); // ContentModelArticles Object | ||
39 | |||
40 | // Set application parameters in modelモデルにアプリケーションパラメータを設定する | ||
41 | $app = JFactory::getApplication(); | ||
42 | $appParams = $app->getParams(); | ||
43 | $articles->setState('params', $appParams); | ||
44 | |||
45 | $articles->setState('list.start', 0); | ||
46 | $articles->setState('filter.published', 1); | ||
47 | |||
48 | // Set the filters based on the module paramsモジュールパラメータに基づいてフィルタを設定します | ||
49 | $articles->setState('list.limit', (int) $params->get('count', 0)); | ||
50 | $articles->setState('load_tags', $params->get('show_tags', 0) || $params->get('article_grouping', 'none') === 'tags'); | ||
51 | |||
52 | // Access filterアクセスフィルター | ||
53 | $access = !JComponentHelper::getParams('com_content')->get('show_noauth'); | ||
54 | $authorised = JAccess::getAuthorisedViewLevels(JFactory::getUser()->get('id')); | ||
55 | $articles->setState('filter.access', $access); | ||
56 | |||
57 | // Prep for Normal or Dynamic Modes通常モードまたは動的モードの準備 | ||
58 | $mode = $params->get('mode', 'normal'); | ||
59 | |||
60 | switch ($mode) | ||
61 | { | ||
62 | case 'dynamic' : | ||
63 | $option = $app->input->get('option'); | ||
64 | $view = $app->input->get('view'); | ||
65 | |||
66 | if ($option === 'com_content') | ||
67 | { | ||
68 | switch ($view) | ||
69 | { | ||
70 | case 'category' : | ||
71 | case 'categories' : | ||
72 | $catids = array($app->input->getInt('id')); | ||
73 | break; | ||
74 | case 'article' : | ||
75 | if ($params->get('show_on_article_page', 1)) | ||
76 | { | ||
77 | $article_id = $app->input->getInt('id'); | ||
78 | $catid = $app->input->getInt('catid'); | ||
79 | |||
80 | if (!$catid) | ||
81 | { | ||
82 | // Get an instance of the generic article model一般的な記事モデルのインスタンスを取得します | ||
83 | $article = JModelLegacy::getInstance('Article', 'ContentModel', array('ignore_request' => true)); | ||
84 | |||
85 | $article->setState('params', $appParams); | ||
86 | $article->setState('filter.published', 1); | ||
87 | $article->setState('article.id', (int) $article_id); | ||
88 | $item = $article->getItem(); | ||
89 | $catids = array($item->catid); | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | $catids = array($catid); | ||
94 | } | ||
95 | } | ||
96 | else | ||
97 | { | ||
98 | // Return right away if show_on_article_page option is offshow_on_article_pageオプションがオフの場合は、すぐに戻ります | ||
99 | return; | ||
100 | } | ||
101 | break; | ||
102 | |||
103 | case 'featured' : | ||
104 | default: | ||
105 | // Return right away if not on the category or article viewsカテゴリまたは記事のビューにない場合は、すぐに戻ります | ||
106 | return; | ||
107 | } | ||
108 | } | ||
109 | else | ||
110 | { | ||
111 | // Return right away if not on a com_content pagecom_contentページにない場合は、すぐに戻ります | ||
112 | return; | ||
113 | } | ||
114 | |||
115 | break; | ||
116 | |||
117 | case 'normal' : | ||
118 | default: | ||
119 | $catids = $params->get('catid'); | ||
120 | $articles->setState('filter.category_id.include', (bool) $params->get('category_filtering_type', 1)); | ||
121 | break; | ||
122 | } | ||
123 | |||
124 | // Category filter | ||
125 | if ($catids) | ||
126 | { | ||
127 | if ($params->get('show_child_category_articles', 0) && (int) $params->get('levels', 0) > 0) | ||
128 | { | ||
129 | // Get an instance of the generic categories modelジェネリックカテゴリモデルのインスタンスを取得します | ||
130 | $categories = JModelLegacy::getInstance('Categories', 'ContentModel', array('ignore_request' => true)); | ||
131 | $categories->setState('params', $appParams); | ||
132 | $levels = $params->get('levels', 1) ?: 9999; | ||
133 | $categories->setState('filter.get_children', $levels); | ||
134 | $categories->setState('filter.published', 1); | ||
135 | $categories->setState('filter.access', $access); | ||
136 | $additional_catids = array(); | ||
137 | |||
138 | foreach ($catids as $catid) | ||
139 | { | ||
140 | $categories->setState('filter.parentId', $catid); | ||
141 | $recursive = true; | ||
142 | $items = $categories->getItems($recursive); | ||
143 | |||
144 | if ($items) | ||
145 | { | ||
146 | foreach ($items as $category) | ||
147 | { | ||
148 | $condition = (($category->level - $categories->getParent()->level) <= $levels); | ||
149 | |||
150 | if ($condition) | ||
151 | { | ||
152 | $additional_catids[] = $category->id; | ||
153 | } | ||
154 | } | ||
155 | } | ||
156 | } | ||
157 | |||
158 | $catids = array_unique(array_merge($catids, $additional_catids)); | ||
159 | } | ||
160 | |||
161 | $articles->setState('filter.category_id', $catids); | ||
162 | } | ||
163 | |||
164 | // Ordering | ||
165 | $ordering = $params->get('article_ordering', 'a.ordering'); | ||
166 | |||
167 | switch ($ordering) | ||
168 | { | ||
169 | case 'random': | ||
170 | $articles->setState('list.ordering', JFactory::getDbo()->getQuery(true)->Rand()); | ||
171 | break; | ||
172 | |||
173 | case 'rating_count': | ||
174 | case 'rating': | ||
175 | $articles->setState('list.ordering', $ordering); | ||
176 | $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); | ||
177 | |||
178 | if (!JPluginHelper::isEnabled('content', 'vote')) | ||
179 | { | ||
180 | $articles->setState('list.ordering', 'a.ordering'); | ||
181 | } | ||
182 | |||
183 | break; | ||
184 | |||
185 | default: | ||
186 | $articles->setState('list.ordering', $ordering); | ||
187 | $articles->setState('list.direction', $params->get('article_ordering_direction', 'ASC')); | ||
188 | break; | ||
189 | } | ||
190 | |||
191 | // Filter by multiple tags | ||
192 | $articles->setState('filter.tag', $params->get('filter_tag', array())); | ||
193 | |||
194 | $articles->setState('filter.featured', $params->get('show_front', 'show')); | ||
195 | $articles->setState('filter.author_id', $params->get('created_by', array())); | ||
196 | $articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1)); | ||
197 | $articles->setState('filter.author_alias', $params->get('created_by_alias', array())); | ||
198 | $articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1)); | ||
199 | $excluded_articles = $params->get('excluded_articles', ''); | ||
200 | |||
201 | if ($excluded_articles) | ||
202 | { | ||
203 | $excluded_articles = explode("\r\n", $excluded_articles); | ||
204 | $articles->setState('filter.article_id', $excluded_articles); | ||
205 | |||
206 | // Exclude | ||
207 | $articles->setState('filter.article_id.include', false); | ||
208 | } | ||
209 | |||
210 | $date_filtering = $params->get('date_filtering', 'off'); | ||
211 | |||
212 | if ($date_filtering !== 'off') | ||
213 | { | ||
214 | $articles->setState('filter.date_filtering', $date_filtering); | ||
215 | $articles->setState('filter.date_field', $params->get('date_field', 'a.created')); | ||
216 | $articles->setState('filter.start_date_range', $params->get('start_date_range', '1000-01-01 00:00:00')); | ||
217 | $articles->setState('filter.end_date_range', $params->get('end_date_range', '9999-12-31 23:59:59')); | ||
218 | $articles->setState('filter.relative_date', $params->get('relative_date', 30)); | ||
219 | } | ||
220 | |||
221 | // Filter by language | ||
222 | $articles->setState('filter.language', $app->getLanguageFilter()); | ||
223 | |||
224 | $items = $articles->getItems(); | ||
225 | |||
226 | // Display options | ||
227 | $show_date = $params->get('show_date', 0); | ||
228 | $show_date_field = $params->get('show_date_field', 'created'); | ||
229 | $show_date_format = $params->get('show_date_format', 'Y-m-d H:i:s'); | ||
230 | $show_category = $params->get('show_category', 0); | ||
231 | $show_hits = $params->get('show_hits', 0); | ||
232 | $show_author = $params->get('show_author', 0); | ||
233 | $show_introtext = $params->get('show_introtext', 0); | ||
234 | $introtext_limit = $params->get('introtext_limit', 100); | ||
235 | |||
236 | // Find current Article ID if on an article page記事ページにある場合は、現在の記事IDを検索します | ||
237 | $option = $app->input->get('option'); | ||
238 | $view = $app->input->get('view'); | ||
239 | |||
240 | if ($option === 'com_content' && $view === 'article') | ||
241 | { | ||
242 | $active_article_id = $app->input->getInt('id'); | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | $active_article_id = 0; | ||
247 | } | ||
248 | |||
249 | // Prepare data for display using display options表示オプションを使用して表示するデータを準備する | ||
250 | foreach ($items as &$item) | ||
251 | { | ||
252 | $item->slug = $item->id . ':' . $item->alias; | ||
253 | |||
254 | /** @deprecated Catslug is deprecated, use catid instead.Catslugは非推奨です。代わりにcatidを使用してください 4.0 */ | ||
255 | $item->catslug = $item->catid . ':' . $item->category_alias; | ||
256 | |||
257 | if ($access || in_array($item->access, $authorised)) | ||
258 | { | ||
259 | // We know that user has the privilege to view the articleユーザーには記事を表示する権限があることがわかっています | ||
260 | $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); | ||
261 | } | ||
262 | else | ||
263 | { | ||
264 | $menu = $app->getMenu(); | ||
265 | $menuitems = $menu->getItems('link', 'index.php?option=com_users&view=login'); | ||
266 | |||
267 | if (isset($menuitems[0])) | ||
268 | { | ||
269 | $Itemid = $menuitems[0]->id; | ||
270 | } | ||
271 | elseif ($app->input->getInt('Itemid') > 0) | ||
272 | { | ||
273 | // Use Itemid from requesting page only if there is no existing menu既存のメニューがない場合にのみ、要求ページからItemidを使用します | ||
274 | $Itemid = $app->input->getInt('Itemid'); | ||
275 | } | ||
276 | |||
277 | $item->link = JRoute::_('index.php?option=com_users&view=login&Itemid=' . $Itemid); | ||
278 | } | ||
279 | |||
280 | // Used for styling the active articleアクティブな記事のスタイリングに使用されます | ||
281 | $item->active = $item->id == $active_article_id ? 'active' : ''; | ||
282 | $item->displayDate = ''; | ||
283 | |||
284 | if ($show_date) | ||
285 | { | ||
286 | $item->displayDate = JHtml::_('date', $item->$show_date_field, $show_date_format); | ||
287 | } | ||
288 | |||
289 | if ($item->catid) | ||
290 | { | ||
291 | $item->displayCategoryLink = JRoute::_(ContentHelperRoute::getCategoryRoute($item->catid)); | ||
292 | $item->displayCategoryTitle = $show_category ? '<a href="' . $item->displayCategoryLink . '">' . $item->category_title . '</a>' : ''; | ||
293 | } | ||
294 | else | ||
295 | { | ||
296 | $item->displayCategoryTitle = $show_category ? $item->category_title : ''; | ||
297 | } | ||
298 | |||
299 | $item->displayHits = $show_hits ? $item->hits : ''; | ||
300 | $item->displayAuthorName = $show_author ? $item->author : ''; | ||
301 | |||
302 | if ($show_introtext) | ||
303 | { | ||
304 | $item->introtext = JHtml::_('content.prepare', $item->introtext, '', 'mod_articles_category_custom.content'); | ||
305 | $item->introtext = self::_cleanIntrotext($item->introtext); | ||
306 | } | ||
307 | |||
308 | $item->displayIntrotext = $show_introtext ? self::truncate($item->introtext, $introtext_limit) : ''; | ||
309 | $item->displayReadmore = $item->alternative_readmore; | ||
310 | } | ||
311 | |||
312 | return $items; | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * Strips unnecessary tags from the introtextイントロテキストから不要なタグを削除します | ||
317 | * | ||
318 | * @param string $introtext introtext to sanitize | ||
319 | * | ||
320 | * @return mixed|string | ||
321 | * | ||
322 | * @since 1.6 | ||
323 | */ | ||
324 | public static function _cleanIntrotext($introtext) | ||
325 | { | ||
326 | $introtext = str_replace(array('<p>','</p>'), ' ', $introtext); | ||
327 | $introtext = strip_tags($introtext, '<h5><div><iframe><a><em><strong>'); | ||
328 | $introtext = trim($introtext); | ||
329 | |||
330 | return $introtext; | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Method to truncate introtext | ||
335 | * | ||
336 | * The goal is to get the proper length plain text string with as much of | ||
337 | * the html intact as possible with all tags properly closed. | ||
338 | * | ||
339 | * @param string $html The content of the introtext to be truncated | ||
340 | * @param integer $maxLength The maximum number of charactes to render | ||
341 | * | ||
342 | * @return string The truncated string | ||
343 | * | ||
344 | * @since 1.6 | ||
345 | */ | ||
346 | public static function truncate($html, $maxLength = 0) | ||
347 | { | ||
348 | $baseLength = strlen($html); | ||
349 | |||
350 | // First get the plain text string. This is the rendered text we want to end up with. | ||
351 | $ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false); | ||
352 | |||
353 | for ($maxLength; $maxLength < $baseLength;) | ||
354 | { | ||
355 | // Now get the string if we allow html. | ||
356 | $htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true); | ||
357 | |||
358 | // Now get the plain text from the html string. | ||
359 | $htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false); | ||
360 | |||
361 | // If the new plain text string matches the original plain text string we are done. | ||
362 | if ($ptString === $htmlStringToPtString) | ||
363 | { | ||
364 | return $htmlString; | ||
365 | } | ||
366 | |||
367 | // Get the number of html tag characters in the first $maxlength characters | ||
368 | $diffLength = strlen($ptString) - strlen($htmlStringToPtString); | ||
369 | |||
370 | // Set new $maxlength that adjusts for the html tags | ||
371 | $maxLength += $diffLength; | ||
372 | |||
373 | if ($baseLength <= $maxLength || $diffLength <= 0) | ||
374 | { | ||
375 | return $htmlString; | ||
376 | } | ||
377 | } | ||
378 | |||
379 | return $html; | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Groups items by field | ||
384 | * | ||
385 | * @param array $list list of items | ||
386 | * @param string $fieldName name of field that is used for grouping | ||
387 | * @param string $article_grouping_direction ordering direction | ||
388 | * @param null $fieldNameToKeep field name to keep | ||
389 | * | ||
390 | * @return array | ||
391 | * | ||
392 | * @since 1.6 | ||
393 | */ | ||
394 | public static function groupBy($list, $fieldName, $article_grouping_direction, $fieldNameToKeep = null) | ||
395 | { | ||
396 | $grouped = array(); | ||
397 | |||
398 | if (!is_array($list)) | ||
399 | { | ||
400 | if ($list == '') | ||
401 | { | ||
402 | return $grouped; | ||
403 | } | ||
404 | |||
405 | $list = array($list); | ||
406 | } | ||
407 | |||
408 | foreach ($list as $key => $item) | ||
409 | { | ||
410 | if (!isset($grouped[$item->$fieldName])) | ||
411 | { | ||
412 | $grouped[$item->$fieldName] = array(); | ||
413 | } | ||
414 | |||
415 | if ($fieldNameToKeep === null) | ||
416 | { | ||
417 | $grouped[$item->$fieldName][$key] = $item; | ||
418 | } | ||
419 | else | ||
420 | { | ||
421 | $grouped[$item->$fieldName][$key] = $item->$fieldNameToKeep; | ||
422 | } | ||
423 | |||
424 | unset($list[$key]); | ||
425 | } | ||
426 | |||
427 | $article_grouping_direction($grouped); | ||
428 | |||
429 | return $grouped; | ||
430 | } | ||
431 | |||
432 | /** | ||
433 | * Groups items by date | ||
434 | * | ||
435 | * @param array $list list of items | ||
436 | * @param string $type type of grouping | ||
437 | * @param string $article_grouping_direction ordering direction | ||
438 | * @param string $month_year_format date format to use | ||
439 | * @param string $field date field to group by | ||
440 | * | ||
441 | * @return array | ||
442 | * | ||
443 | * @since 1.6 | ||
444 | */ | ||
445 | public static function groupByDate($list, $type = 'year', $article_grouping_direction = 'ksort', $month_year_format = 'F Y', $field = 'created') | ||
446 | { | ||
447 | $grouped = array(); | ||
448 | |||
449 | if (!is_array($list)) | ||
450 | { | ||
451 | if ($list == '') | ||
452 | { | ||
453 | return $grouped; | ||
454 | } | ||
455 | |||
456 | $list = array($list); | ||
457 | } | ||
458 | |||
459 | foreach ($list as $key => $item) | ||
460 | { | ||
461 | switch ($type) | ||
462 | { | ||
463 | case 'month_year' : | ||
464 | $month_year = StringHelper::substr($item->$field, 0, 7); | ||
465 | |||
466 | if (!isset($grouped[$month_year])) | ||
467 | { | ||
468 | $grouped[$month_year] = array(); | ||
469 | } | ||
470 | |||
471 | $grouped[$month_year][$key] = $item; | ||
472 | break; | ||
473 | |||
474 | case 'year' : | ||
475 | default: | ||
476 | $year = StringHelper::substr($item->$field, 0, 4); | ||
477 | |||
478 | if (!isset($grouped[$year])) | ||
479 | { | ||
480 | $grouped[$year] = array(); | ||
481 | } | ||
482 | |||
483 | $grouped[$year][$key] = $item; | ||
484 | break; | ||
485 | } | ||
486 | |||
487 | unset($list[$key]); | ||
488 | } | ||
489 | |||
490 | $article_grouping_direction($grouped); | ||
491 | |||
492 | if ($type === 'month_year') | ||
493 | { | ||
494 | foreach ($grouped as $group => $items) | ||
495 | { | ||
496 | $date = new JDate($group); | ||
497 | $formatted_group = $date->format($month_year_format); | ||
498 | $grouped[$formatted_group] = $items; | ||
499 | |||
500 | unset($grouped[$group]); | ||
501 | } | ||
502 | } | ||
503 | |||
504 | return $grouped; | ||
505 | } | ||
506 | |||
507 | /** | ||
508 | * Groups items by tags | ||
509 | * | ||
510 | * @param array $list list of items | ||
511 | * @param string $direction ordering direction | ||
512 | * | ||
513 | * @return array | ||
514 | * | ||
515 | * @since 3.9.0 | ||
516 | */ | ||
517 | public static function groupByTags($list, $direction = 'ksort') | ||
518 | { | ||
519 | $grouped = array(); | ||
520 | $untagged = array(); | ||
521 | |||
522 | if (!$list) | ||
523 | { | ||
524 | return $grouped; | ||
525 | } | ||
526 | |||
527 | foreach ($list as $item) | ||
528 | { | ||
529 | if ($item->tags->itemTags) | ||
530 | { | ||
531 | foreach ($item->tags->itemTags as $tag) | ||
532 | { | ||
533 | $grouped[$tag->title][] = $item; | ||
534 | } | ||
535 | } | ||
536 | else | ||
537 | { | ||
538 | $untagged[] = $item; | ||
539 | } | ||
540 | } | ||
541 | |||
542 | $direction($grouped); | ||
543 | |||
544 | if ($untagged) | ||
545 | { | ||
546 | $grouped['MOD_ARTICLES_CATEGORY_CUSTOM_UNTAGGED'] = $untagged; | ||
547 | } | ||
548 | |||
549 | return $grouped; | ||
550 | } | ||
551 | } |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_CATEGORY_CUSTOM="ビデオライブラリ - カテゴリ" | ||
7 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_DESC="どのように記事を分類したいかを選択します。" | ||
8 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_LABEL="記事の分類" | ||
9 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_DESC="記事の分類の順序の方向を選択します。" | ||
10 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_LABEL="分類の方向" | ||
11 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_DESC="記事の順序に使用する欄を選択します。注目の記事の並び替えは、注目の記事のフィルタリングオプションが「のみ」の時のみに使用されます。" | ||
12 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_LABEL="並べる記事欄" | ||
13 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_DESC="記事の順序の方向を選択します。" | ||
14 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_LABEL="順序の方向" | ||
15 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_DESC="下の一覧から1つあるいは複数の投稿者を選択します" | ||
16 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_LABEL="投稿者" | ||
17 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_DESC="下の一覧から1つあるいは複数の投稿者エイリアスを選択します。" | ||
18 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_LABEL="投稿者のエイリアス" | ||
19 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_DESC="選択された投稿者エイリアスを含めるには包括的を選択し、含めない場合は排他的を選択します。" | ||
20 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_LABEL="投稿者エイリアスフィルタの種類" | ||
21 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_DESC="選択された投稿者を含めるには包括的を選択し、含めない場合は排他的を選択します。" | ||
22 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_LABEL="投稿者フィルタの種類" | ||
23 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_DESC="辿る子カテゴリの階層の数です。" | ||
24 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_LABEL="カテゴリの深さ" | ||
25 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATEGORY_DESC="1つまたは複数のカテゴリを選択してください。" | ||
26 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_DESC="選択されたカテゴリを含めるには包括的を選択し、含めない場合は排他的を選択します。" | ||
27 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_LABEL="カテゴリフィルタの種類" | ||
28 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_DESC="表示する項目数です。標準値0ですべての記事を表示します。" | ||
29 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_LABEL="表示数" | ||
30 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_DESC="どの日付欄を日付範囲に適用するかを選択します。" | ||
31 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_LABEL="日付範囲の項目" | ||
32 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_DESC="表示したい日付欄を選択します。" | ||
33 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_LABEL="日付の欄" | ||
34 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_DESC="有効な日付形式で入力してください。フォーマットに付いての情報は次を参照: http://php.net/date" | ||
35 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_LABEL="日付フォーマット" | ||
36 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_DESC="日付フィルタの種類を選択します。" | ||
37 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_LABEL="日付フィルタ" | ||
38 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_DESC="上で日付範囲を選択した場合、終了日を入力してください。" | ||
39 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_LABEL="〜日まで" | ||
40 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_DESC="各記事IDを新しい行に入力してください。" | ||
41 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_LABEL="除外する記事ID" | ||
42 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DISPLAY_LABEL="表示オプション" | ||
43 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DYNAMIC_LABEL="ダイナミックモードオプション" | ||
44 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_FILTERING_LABEL="フィルタオプション" | ||
45 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_GROUPING_LABEL="グループ分けオプション" | ||
46 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_ORDERING_LABEL="順序オプション" | ||
47 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_DESC="数値で文字数制限の値を入力してください。イントロテキストはあなたが入力した文字数にトリミングされます。" | ||
48 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_LABEL="イントロテキスト制限" | ||
49 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_LABEL="リンクのタイトル" | ||
50 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_DESC="リンクのタイトルです。" | ||
51 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_DESC="あなたが使用したいモードを選択してください。ノーマルモードが選択されている場合、モジュールを構成し、モジュールに割り当てたメニューアイテムの静的な記事一覧を表示します。ダイナミックモードが選択されている場合、ここでも通常モジュールを構成することができますが、もうカテゴリオプションは使用されなくなります。代わりに、モジュールはあなたがカテゴリ表示中であるかを動的に検出し、それに応じてそのカテゴリ内の記事一覧を表示します。ダイナミックモードがを選択した場合、何を表示するかを動的に決めるために、全てのページでモジュールを表示する設定のままにしておくことをおすすめします。" | ||
52 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_LABEL="モード" | ||
53 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_DESC="有効な日付形式で入力してください。フォーマットに付いての情報は次を参照: http://php.net/date " | ||
54 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_LABEL="月と年の表示形式" | ||
55 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_DESC="上で相対日付を選択した場合、数値で日の値を入力してください。結果は現在の日付とあなたが入力した値を基準に取得されます。" | ||
56 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_LABEL="相対日付" | ||
57 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWAUTHOR_DESC="投稿者(または 利用可能であれば代わりに投稿者エイリアス)を表示したい場合は 表示 を選択します。" | ||
58 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCATEGORY_DESC="カテゴリ名を表示したい場合は 表示 を選択します。" | ||
59 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_DESC="子カテゴリから記事を含めるまたは除外します。" | ||
60 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL="子カテゴリの記事" | ||
61 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWDATE_DESC="日付を表示したい場合は 表示 を選択します。" | ||
62 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_DESC="表示、非表示または注目の記事のみ表示を選択します。" | ||
63 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_LABEL="注目の記事" | ||
64 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_DESC="各記事が表示された回数を表示したい場合は 表示 を選択します。" | ||
65 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_LABEL="参照数" | ||
66 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_DESC="イントロテキストを表示したい場合は 表示 を選択します。" | ||
67 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_LABEL="イントロテキスト" | ||
68 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_DESC="記事のページから記事一覧の表示/非表示を選択します。これはモジュールがカテゴリのページに動的にそれ自身をただ表示することを意味します。" | ||
69 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_LABEL="記事のページに表示する" | ||
70 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_DESC="上で日付範囲を選択した場合は開始日を入力してください。" | ||
71 | MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_LABEL="開始日付範囲" | ||
72 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ASCENDING_VALUE="昇順" | ||
73 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_CREATED_VALUE="作成日" | ||
74 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DATERANGE_VALUE="日付範囲" | ||
75 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DESCENDING_VALUE="降順" | ||
76 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DYNAMIC_VALUE="ダイナミック" | ||
77 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUDE_VALUE="含めない" | ||
78 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUSIVE_VALUE="排他的" | ||
79 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_HITS_VALUE="参照" | ||
80 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ID_VALUE="ID" | ||
81 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUDE_VALUE="含める" | ||
82 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUSIVE_VALUE="包括的" | ||
83 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MODIFIED_VALUE="更新日" | ||
84 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MONTHYEAR_VALUE="月と年" | ||
85 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_NORMAL_VALUE="ノーマル" | ||
86 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_OFF_VALUE="オフ" | ||
87 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ONLYFEATURED_VALUE="のみ" | ||
88 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERING_VALUE="記事の順序" | ||
89 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERINGFEATURED_VALUE="注目記事の並び替え" | ||
90 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RANDOM_VALUE="ランダム" | ||
91 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RATING_VALUE="評価" | ||
92 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RELATIVEDAY_VALUE="相対日付" | ||
93 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_STARTPUBLISHING_VALUE="公開開始日" | ||
94 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_FINISHPUBLISHING_VALUE="公開終了日" | ||
95 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_VOTE_VALUE="投票" | ||
96 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_YEAR_VALUE="年" | ||
97 | MOD_ARTICLES_CATEGORY_CUSTOM_READ_MORE="続きを読む: " | ||
98 | MOD_ARTICLES_CATEGORY_CUSTOM_READ_MORE_TITLE="続きを読む..." | ||
99 | MOD_ARTICLES_CATEGORY_CUSTOM_REGISTER_TO_READ_MORE="続きを読むには登録してください" | ||
100 | MOD_ARTICLES_CATEGORY_CUSTOM_XML_DESCRIPTION="1つまたは複数のカテゴリから記事一覧を表示します。" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | ; Joomla! Project | ||
2 | ; Copyright (C) 2005 - 2017 Open Source Matters. All rights reserved. | ||
3 | ; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php | ||
4 | ; Note : All ini files need to be saved as UTF-8 | ||
5 | |||
6 | MOD_ARTICLES_CATEGORY_CUSTOM="ビデオライブラリ - カテゴリ" | ||
7 | MOD_ARTICLES_CATEGORY_CUSTOM_XML_DESCRIPTION="1つまたは複数のカテゴリから記事一覧を表示します。(ビデオライブラリ専用のモジュールです)" | ||
8 | MOD_ARTICLES_CATEGORY_CUSTOM_LAYOUT_DEFAULT="標準" |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_category_custom | ||
5 | * | ||
6 | * @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved. | ||
7 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
8 | */ | ||
9 | |||
10 | defined('_JEXEC') or die; | ||
11 | |||
12 | // Include the helper functions only once | ||
13 | JLoader::register('ModArticlesCategoryCustomHelper', __DIR__ . '/helper.php'); | ||
14 | |||
15 | $input = JFactory::getApplication()->input; | ||
16 | |||
17 | // Prep for Normal or Dynamic Modes | ||
18 | $mode = $params->get('mode', 'normal'); | ||
19 | $idbase = null; | ||
20 | |||
21 | switch ($mode) | ||
22 | { | ||
23 | case 'dynamic' : | ||
24 | $option = $input->get('option'); | ||
25 | $view = $input->get('view'); | ||
26 | |||
27 | if ($option === 'com_content') | ||
28 | { | ||
29 | switch ($view) | ||
30 | { | ||
31 | case 'category' : | ||
32 | $idbase = $input->getInt('id'); | ||
33 | break; | ||
34 | case 'categories' : | ||
35 | $idbase = $input->getInt('id'); | ||
36 | break; | ||
37 | case 'article' : | ||
38 | if ($params->get('show_on_article_page', 1)) | ||
39 | { | ||
40 | $idbase = $input->getInt('catid'); | ||
41 | } | ||
42 | break; | ||
43 | } | ||
44 | } | ||
45 | break; | ||
46 | case 'normal' : | ||
47 | default: | ||
48 | $idbase = $params->get('catid'); | ||
49 | break; | ||
50 | } | ||
51 | |||
52 | $cacheid = md5(serialize(array ($idbase, $module->module, $module->id))); | ||
53 | |||
54 | $cacheparams = new stdClass; | ||
55 | $cacheparams->cachemode = 'id'; | ||
56 | $cacheparams->class = 'ModArticlesCategoryCustomHelper'; | ||
57 | $cacheparams->method = 'getList'; | ||
58 | $cacheparams->methodparams = $params; | ||
59 | $cacheparams->modeparams = $cacheid; | ||
60 | |||
61 | $list = JModuleHelper::moduleCache($module, $params, $cacheparams); | ||
62 | |||
63 | if (!empty($list)) | ||
64 | { | ||
65 | $grouped = false; | ||
66 | $article_grouping = $params->get('article_grouping', 'none'); | ||
67 | $article_grouping_direction = $params->get('article_grouping_direction', 'ksort'); | ||
68 | $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); | ||
69 | $item_heading = $params->get('item_heading'); | ||
70 | |||
71 | if ($article_grouping !== 'none') | ||
72 | { | ||
73 | $grouped = true; | ||
74 | |||
75 | switch ($article_grouping) | ||
76 | { | ||
77 | case 'year' : | ||
78 | case 'month_year' : | ||
79 | $list = ModArticlesCategoryCustomHelper::groupByDate( | ||
80 | $list, | ||
81 | $article_grouping, | ||
82 | $article_grouping_direction, | ||
83 | $params->get('month_year_format', 'F Y'), | ||
84 | $params->get('date_grouping_field', 'created') | ||
85 | ); | ||
86 | break; | ||
87 | case 'author' : | ||
88 | case 'category_title' : | ||
89 | $list = ModArticlesCategoryCustomHelper::groupBy($list, $article_grouping, $article_grouping_direction); | ||
90 | break; | ||
91 | case 'tags' : | ||
92 | $list = ModArticlesCategoryCustomHelper::groupByTags($list, $article_grouping_direction); | ||
93 | break; | ||
94 | default: | ||
95 | break; | ||
96 | } | ||
97 | } | ||
98 | |||
99 | require JModuleHelper::getLayoutPath('mod_articles_category_custom', $params->get('layout', 'default')); | ||
100 | } |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="module" version="3.1" client="site" method="upgrade"> | ||
3 | <name>mod_articles_category_custom</name> | ||
4 | <author>Joomla! Project</author> | ||
5 | <creationDate>February 2010</creationDate> | ||
6 | <copyright>Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved.</copyright> | ||
7 | <license>GNU General Public License version 2 or later; see LICENSE.txt</license> | ||
8 | <authorEmail>admin@joomla.org</authorEmail> | ||
9 | <authorUrl>www.joomla.org</authorUrl> | ||
10 | <version>3.0.0</version> | ||
11 | <description>MOD_ARTICLES_CATEGORY_CUSTOM_XML_DESCRIPTION</description> | ||
12 | <files> | ||
13 | <filename module="mod_articles_category_custom">mod_articles_category_custom.php</filename> | ||
14 | <folder>tmpl</folder> | ||
15 | <filename>helper.php</filename> | ||
16 | </files> | ||
17 | <languages> | ||
18 | <language tag="en-GB">en-GB.mod_articles_category_custom.ini</language> | ||
19 | <language tag="en-GB">en-GB.mod_articles_category_custom.sys.ini</language> | ||
20 | <language tag="ja-JP">ja-JP.mod_articles_category_custom.ini</language> | ||
21 | <language tag="ja-JP">ja-JP.mod_articles_category_custom.sys.ini</language> | ||
22 | </languages> | ||
23 | <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_CATEGORY" /> | ||
24 | <config> | ||
25 | <fields name="params"> | ||
26 | <fieldset name="basic"> | ||
27 | <field | ||
28 | name="mode" | ||
29 | type="list" | ||
30 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_LABEL" | ||
31 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MODE_DESC" | ||
32 | default="normal" | ||
33 | > | ||
34 | <option value="normal">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_NORMAL_VALUE</option> | ||
35 | <option value="dynamic">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DYNAMIC_VALUE</option> | ||
36 | </field> | ||
37 | </fieldset> | ||
38 | <fieldset | ||
39 | name="dynamic" | ||
40 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DYNAMIC_LABEL" | ||
41 | > | ||
42 | <field | ||
43 | name="show_on_article_page" | ||
44 | type="radio" | ||
45 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_LABEL" | ||
46 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWONARTICLEPAGE_DESC" | ||
47 | class="btn-group btn-group-yesno" | ||
48 | default="1" | ||
49 | > | ||
50 | <option value="1">JSHOW</option> | ||
51 | <option value="0">JHIDE</option> | ||
52 | </field> | ||
53 | </fieldset> | ||
54 | <fieldset | ||
55 | name="filtering" | ||
56 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_FILTERING_LABEL" | ||
57 | > | ||
58 | <field | ||
59 | name="count" | ||
60 | type="number" | ||
61 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_LABEL" | ||
62 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_COUNT_DESC" | ||
63 | default="0" | ||
64 | /> | ||
65 | <field | ||
66 | name="show_front" | ||
67 | type="list" | ||
68 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_LABEL" | ||
69 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWFEATURED_DESC" | ||
70 | default="show" | ||
71 | > | ||
72 | <option value="show">JSHOW</option> | ||
73 | <option value="hide">JHIDE</option> | ||
74 | <option value="only">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ONLYFEATURED_VALUE</option> | ||
75 | </field> | ||
76 | <field | ||
77 | name="filteringspacer0" | ||
78 | type="spacer" | ||
79 | hr="true" | ||
80 | /> | ||
81 | <field | ||
82 | name="category_filtering_type" | ||
83 | type="radio" | ||
84 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_LABEL" | ||
85 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATFILTERINGTYPE_DESC" | ||
86 | class="btn-group btn-group-yesno" | ||
87 | default="1" | ||
88 | > | ||
89 | <option value="1">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUSIVE_VALUE</option> | ||
90 | <option value="0">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUSIVE_VALUE</option> | ||
91 | </field> | ||
92 | <field | ||
93 | name="catid" | ||
94 | type="category" | ||
95 | label="JCATEGORY" | ||
96 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATEGORY_DESC" | ||
97 | extension="com_content" | ||
98 | multiple="true" | ||
99 | size="5" | ||
100 | > | ||
101 | <option value="">JOPTION_ALL_CATEGORIES</option> | ||
102 | </field> | ||
103 | <field | ||
104 | name="show_child_category_articles" | ||
105 | type="radio" | ||
106 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_LABEL" | ||
107 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCHILDCATEGORYARTICLES_DESC" | ||
108 | class="btn-group btn-group-yesno" | ||
109 | default="0" | ||
110 | > | ||
111 | <option value="1">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUDE_VALUE</option> | ||
112 | <option value="0">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUDE_VALUE</option> | ||
113 | </field> | ||
114 | <field | ||
115 | name="levels" | ||
116 | type="number" | ||
117 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_LABEL" | ||
118 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_CATDEPTH_DESC" | ||
119 | default="1" | ||
120 | /> | ||
121 | <field | ||
122 | name="filteringspacer1" | ||
123 | type="spacer" | ||
124 | hr="true" | ||
125 | /> | ||
126 | <field | ||
127 | name="filter_tag" | ||
128 | type="tag" | ||
129 | label="JTAG" | ||
130 | description="JTAG_FIELD_SELECT_DESC" | ||
131 | > | ||
132 | <option value="">JNONE</option> | ||
133 | </field> | ||
134 | <field | ||
135 | name="filteringspacer2" | ||
136 | type="spacer" | ||
137 | hr="true" | ||
138 | /> | ||
139 | <field | ||
140 | name="author_filtering_type" | ||
141 | type="radio" | ||
142 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_LABEL" | ||
143 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORFILTERING_DESC" | ||
144 | class="btn-group btn-group-yesno" | ||
145 | default="1" | ||
146 | > | ||
147 | <option value="1">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUSIVE_VALUE</option> | ||
148 | <option value="0">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUSIVE_VALUE</option> | ||
149 | </field> | ||
150 | <field | ||
151 | name="created_by" | ||
152 | type="sql" | ||
153 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_LABEL" | ||
154 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHOR_DESC" | ||
155 | multiple="true" | ||
156 | size="5" | ||
157 | query="select id, name, username from #__users where id IN (select distinct(created_by) from #__content) order by name ASC" | ||
158 | key_field="id" | ||
159 | value_field="name" | ||
160 | > | ||
161 | <option value="">JOPTION_SELECT_AUTHORS</option> | ||
162 | </field> | ||
163 | <field | ||
164 | name="filteringspacer3" | ||
165 | type="spacer" | ||
166 | hr="true" | ||
167 | /> | ||
168 | <field | ||
169 | name="author_alias_filtering_type" | ||
170 | type="radio" | ||
171 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_LABEL" | ||
172 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIASFILTERING_DESC" | ||
173 | class="btn-group btn-group-yesno" | ||
174 | default="1" | ||
175 | > | ||
176 | <option value="1">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_INCLUSIVE_VALUE</option> | ||
177 | <option value="0">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_EXCLUSIVE_VALUE</option> | ||
178 | </field> | ||
179 | <field | ||
180 | name="created_by_alias" | ||
181 | type="sql" | ||
182 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_LABEL" | ||
183 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_AUTHORALIAS_DESC" | ||
184 | multiple="true" | ||
185 | size="5" | ||
186 | query="select distinct(created_by_alias) from #__content where created_by_alias != '' order by created_by_alias ASC" | ||
187 | key_field="created_by_alias" | ||
188 | value_field="created_by_alias" | ||
189 | > | ||
190 | <option value="">JOPTION_SELECT_AUTHOR_ALIASES</option> | ||
191 | </field> | ||
192 | <field | ||
193 | name="filteringspacer4" | ||
194 | type="spacer" | ||
195 | hr="true" | ||
196 | /> | ||
197 | <field | ||
198 | name="excluded_articles" | ||
199 | type="textarea" | ||
200 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_LABEL" | ||
201 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_EXCLUDEDARTICLES_DESC" | ||
202 | cols="10" | ||
203 | rows="3" | ||
204 | /> | ||
205 | <field | ||
206 | name="filteringspacer5" | ||
207 | type="spacer" | ||
208 | hr="true" | ||
209 | /> | ||
210 | <field | ||
211 | name="date_filtering" | ||
212 | type="list" | ||
213 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_LABEL" | ||
214 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFILTERING_DESC" | ||
215 | default="off" | ||
216 | > | ||
217 | <option value="off">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_OFF_VALUE</option> | ||
218 | <option value="range">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DATERANGE_VALUE</option> | ||
219 | <option value="relative">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RELATIVEDAY_VALUE</option> | ||
220 | </field> | ||
221 | <field | ||
222 | name="date_field" | ||
223 | type="list" | ||
224 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_LABEL" | ||
225 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATERANGEFIELD_DESC" | ||
226 | default="a.created" | ||
227 | > | ||
228 | <option value="a.created"> | ||
229 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_CREATED_VALUE | ||
230 | </option> | ||
231 | <option value="a.modified"> | ||
232 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MODIFIED_VALUE | ||
233 | </option> | ||
234 | <option value="a.publish_up"> | ||
235 | MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_STARTPUBLISHING_VALUE | ||
236 | </option> | ||
237 | </field> | ||
238 | <field | ||
239 | name="start_date_range" | ||
240 | type="calendar" | ||
241 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_LABEL" | ||
242 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_STARTDATE_DESC" | ||
243 | translateformat="true" | ||
244 | showtime="true" | ||
245 | size="22" | ||
246 | filter="user_utc" | ||
247 | /> | ||
248 | <field | ||
249 | name="end_date_range" | ||
250 | type="calendar" | ||
251 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_LABEL" | ||
252 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ENDDATE_DESC" | ||
253 | translateformat="true" | ||
254 | showtime="true" | ||
255 | size="22" | ||
256 | filter="user_utc" | ||
257 | /> | ||
258 | <field | ||
259 | name="relative_date" | ||
260 | type="number" | ||
261 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_LABEL" | ||
262 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_RELATIVEDATE_DESC" | ||
263 | default="30" | ||
264 | /> | ||
265 | </fieldset> | ||
266 | <fieldset | ||
267 | name="ordering" | ||
268 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_ORDERING_LABEL" | ||
269 | > | ||
270 | <field | ||
271 | name="article_ordering" | ||
272 | type="list" | ||
273 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_LABEL" | ||
274 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERING_DESC" | ||
275 | default="modified" | ||
276 | > | ||
277 | <option value="a.ordering">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERING_VALUE</option> | ||
278 | <option value="fp.ordering">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ORDERINGFEATURED_VALUE</option> | ||
279 | <option value="a.hits">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_HITS_VALUE</option> | ||
280 | <option value="a.title">JGLOBAL_TITLE</option> | ||
281 | <option value="a.id">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ID_VALUE</option> | ||
282 | <option value="a.alias">JFIELD_ALIAS_LABEL</option> | ||
283 | <option value="a.created">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_CREATED_VALUE</option> | ||
284 | <option value="modified">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MODIFIED_VALUE</option> | ||
285 | <option value="publish_up">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_STARTPUBLISHING_VALUE</option> | ||
286 | <option value="a.publish_down">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_FINISHPUBLISHING_VALUE</option> | ||
287 | <option value="random">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RANDOM_VALUE</option> | ||
288 | <option value="rating_count" requires="vote">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_VOTE_VALUE</option> | ||
289 | <option value="rating" requires="vote">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_RATING_VALUE</option> | ||
290 | </field> | ||
291 | <field | ||
292 | name="article_ordering_direction" | ||
293 | type="list" | ||
294 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_LABEL" | ||
295 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEORDERINGDIR_DESC" | ||
296 | default="ASC" | ||
297 | > | ||
298 | <option value="DESC">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DESCENDING_VALUE</option> | ||
299 | <option value="ASC">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ASCENDING_VALUE</option> | ||
300 | </field> | ||
301 | </fieldset> | ||
302 | <fieldset | ||
303 | name="grouping" | ||
304 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_GROUPING_LABEL" | ||
305 | > | ||
306 | <field | ||
307 | name="article_grouping" | ||
308 | type="list" | ||
309 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_LABEL" | ||
310 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPING_DESC" | ||
311 | default="none" | ||
312 | > | ||
313 | <option value="none">JNONE</option> | ||
314 | <option value="year">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_YEAR_VALUE</option> | ||
315 | <option value="month_year">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MONTHYEAR_VALUE</option> | ||
316 | <option value="author">JAUTHOR</option> | ||
317 | <option value="category_title">JCATEGORY</option> | ||
318 | </field> | ||
319 | <field | ||
320 | name="article_grouping_direction" | ||
321 | type="list" | ||
322 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_LABEL" | ||
323 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_ARTICLEGROUPINGDIR_DESC" | ||
324 | default="ksort" | ||
325 | > | ||
326 | <option value="krsort">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_DESCENDING_VALUE</option> | ||
327 | <option value="ksort">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_ASCENDING_VALUE</option> | ||
328 | </field> | ||
329 | <field | ||
330 | name="month_year_format" | ||
331 | type="text" | ||
332 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_LABEL" | ||
333 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_MONTHYEARFORMAT_DESC" | ||
334 | default="F Y" | ||
335 | /> | ||
336 | </fieldset> | ||
337 | <fieldset | ||
338 | name="display" | ||
339 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_GROUP_DISPLAY_LABEL" | ||
340 | > | ||
341 | <field | ||
342 | name="link_titles" | ||
343 | type="radio" | ||
344 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_LABEL" | ||
345 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_LINKTITLES_DESC" | ||
346 | default="1" | ||
347 | class="btn-group btn-group-yesno" | ||
348 | > | ||
349 | <option value="1">JYES</option> | ||
350 | <option value="0">JNO</option> | ||
351 | </field> | ||
352 | <field | ||
353 | name="show_date" | ||
354 | type="radio" | ||
355 | label="JDATE" | ||
356 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWDATE_DESC" | ||
357 | default="0" | ||
358 | class="btn-group btn-group-yesno" | ||
359 | > | ||
360 | <option value="1">JSHOW</option> | ||
361 | <option value="0">JHIDE</option> | ||
362 | </field> | ||
363 | <field | ||
364 | name="show_date_field" | ||
365 | type="list" | ||
366 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_LABEL" | ||
367 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELD_DESC" | ||
368 | default="created" | ||
369 | > | ||
370 | <option value="created">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_CREATED_VALUE</option> | ||
371 | <option value="modified">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_MODIFIED_VALUE</option> | ||
372 | <option value="publish_up">MOD_ARTICLES_CATEGORY_CUSTOM_OPTION_STARTPUBLISHING_VALUE</option> | ||
373 | </field> | ||
374 | <field | ||
375 | name="show_date_format" | ||
376 | type="text" | ||
377 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_LABEL" | ||
378 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_DATEFIELDFORMAT_DESC" | ||
379 | default="Y-m-d H:i:s" | ||
380 | /> | ||
381 | <field | ||
382 | name="show_category" | ||
383 | type="radio" | ||
384 | label="JCATEGORY" | ||
385 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWCATEGORY_DESC" | ||
386 | default="0" | ||
387 | class="btn-group btn-group-yesno" | ||
388 | > | ||
389 | <option value="1">JSHOW</option> | ||
390 | <option value="0">JHIDE</option> | ||
391 | </field> | ||
392 | <field | ||
393 | name="show_hits" | ||
394 | type="radio" | ||
395 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_LABEL" | ||
396 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWHITS_DESC" | ||
397 | default="0" | ||
398 | class="btn-group btn-group-yesno" | ||
399 | > | ||
400 | <option value="1">JSHOW</option> | ||
401 | <option value="0">JHIDE</option> | ||
402 | </field> | ||
403 | <field | ||
404 | name="show_author" | ||
405 | type="radio" | ||
406 | label="JAUTHOR" | ||
407 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWAUTHOR_DESC" | ||
408 | default="0" | ||
409 | class="btn-group btn-group-yesno" | ||
410 | > | ||
411 | <option value="1">JSHOW</option> | ||
412 | <option value="0">JHIDE</option> | ||
413 | </field> | ||
414 | <field | ||
415 | name="show_introtext" | ||
416 | type="radio" | ||
417 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_LABEL" | ||
418 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_SHOWINTROTEXT_DESC" | ||
419 | default="1" | ||
420 | class="btn-group btn-group-yesno" | ||
421 | > | ||
422 | <option value="1">JSHOW</option> | ||
423 | <option value="0">JHIDE</option> | ||
424 | </field> | ||
425 | <field | ||
426 | name="introtext_limit" | ||
427 | type="number" | ||
428 | label="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_LABEL" | ||
429 | description="MOD_ARTICLES_CATEGORY_CUSTOM_FIELD_INTROTEXTLIMIT_DESC" | ||
430 | default="1000" | ||
431 | /> | ||
432 | <field | ||
433 | name="show_readmore" | ||
434 | type="radio" | ||
435 | label="JGLOBAL_SHOW_READMORE_LABEL" | ||
436 | description="JGLOBAL_SHOW_READMORE_DESC" | ||
437 | default="0" | ||
438 | class="btn-group btn-group-yesno" | ||
439 | > | ||
440 | <option value="1">JSHOW</option> | ||
441 | <option value="0">JHIDE</option> | ||
442 | </field> | ||
443 | <field | ||
444 | name="show_readmore_title" | ||
445 | type="radio" | ||
446 | label="JGLOBAL_SHOW_READMORE_TITLE_LABEL" | ||
447 | description="JGLOBAL_SHOW_READMORE_TITLE_DESC" | ||
448 | default="1" | ||
449 | class="btn-group btn-group-yesno" | ||
450 | > | ||
451 | <option value="1">JSHOW</option> | ||
452 | <option value="0">JHIDE</option> | ||
453 | </field> | ||
454 | <field | ||
455 | name="readmore_limit" | ||
456 | type="number" | ||
457 | label="JGLOBAL_SHOW_READMORE_LIMIT_LABEL" | ||
458 | description="JGLOBAL_SHOW_READMORE_LIMIT_DESC" | ||
459 | default="0" | ||
460 | /> | ||
461 | </fieldset> | ||
462 | <fieldset name="advanced"> | ||
463 | <field | ||
464 | name="layout" | ||
465 | type="modulelayout" | ||
466 | label="JFIELD_ALT_LAYOUT_LABEL" | ||
467 | description="JFIELD_ALT_MODULE_LAYOUT_DESC" | ||
468 | /> | ||
469 | <field | ||
470 | name="moduleclass_sfx" | ||
471 | type="textarea" | ||
472 | label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" | ||
473 | description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" | ||
474 | rows="3" | ||
475 | /> | ||
476 | <field | ||
477 | name="owncache" | ||
478 | type="list" | ||
479 | label="COM_MODULES_FIELD_CACHING_LABEL" | ||
480 | description="COM_MODULES_FIELD_CACHING_DESC" | ||
481 | default="1" | ||
482 | > | ||
483 | <option value="1">JGLOBAL_USE_GLOBAL</option> | ||
484 | <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> | ||
485 | </field> | ||
486 | <field | ||
487 | name="cache_time" | ||
488 | type="number" | ||
489 | label="COM_MODULES_FIELD_CACHE_TIME_LABEL" | ||
490 | description="COM_MODULES_FIELD_CACHE_TIME_DESC" | ||
491 | default="900" | ||
492 | /> | ||
493 | </fieldset> | ||
494 | </fields> | ||
495 | </config> | ||
496 | </extension> |
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * @package Joomla.Site | ||
5 | * @subpackage mod_articles_category_custom | ||
6 | * | ||
7 | * @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved. | ||
8 | * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
9 | */ | ||
10 | |||
11 | defined('_JEXEC') or die; | ||
12 | $catid = JRequest::getInt('catid'); | ||
13 | ?> | ||
14 | <!-- 記事カテゴリーの表示 --> | ||
15 | <h3><?php echo $list[0]->category_title; ?></h3> | ||
16 | <ul class="category-module-custom videos-custom-item-wrapper <?php echo $moduleclass_sfx; ?>"> | ||
17 | <?php foreach ($list as $item) : ?> | ||
18 | <li> | ||
19 | <p class="mod-articles-category-introtext"> | ||
20 | <?php echo $item->displayIntrotext; ?> | ||
21 | </p> | ||
22 | </li> | ||
23 | <?php endforeach; ?> | ||
24 | </ul> |
... | @@ -3582,81 +3582,93 @@ body.itemid-132 table { | ... | @@ -3582,81 +3582,93 @@ body.itemid-132 table { |
3582 | /* ------------------------------------------------------------------------- | 3582 | /* ------------------------------------------------------------------------- |
3583 | ビデオライブラリページ | 3583 | ビデオライブラリページ |
3584 | ------------------------------------------------------------------------- */ | 3584 | ------------------------------------------------------------------------- */ |
3585 | .videos-custom h5 { | 3585 | #content .blog.videos-custom h3 { |
3586 | padding-left: 0; | 3586 | margin-bottom: 0px; |
3587 | font-size: 1.125rem; | 3587 | margin-top: 10px; |
3588 | background: none; | ||
3589 | } | 3588 | } |
3590 | 3589 | ||
3591 | .videos-custom-item-wrapper { | 3590 | .blog.videos-custom .videos-custom-item-wrapper { |
3592 | display: flex; | 3591 | display: flex; |
3593 | flex-wrap: wrap; | 3592 | flex-wrap: wrap; |
3594 | justify-content: space-around; | 3593 | justify-content: space-between; |
3594 | margin: 0 0 16px; | ||
3595 | |||
3595 | } | 3596 | } |
3596 | 3597 | ||
3597 | .videos-custom-item-wrapper:before { | 3598 | .blog.videos-custom .videos-custom-item-wrapper:before { |
3598 | content: ""; | 3599 | content: ""; |
3599 | display: block; | 3600 | display: block; |
3600 | min-width: 190px; | 3601 | min-width: 190px; |
3601 | width: 30%; | 3602 | width: calc(33% - 8px); |
3602 | height: 0px; | 3603 | height: 0px; |
3603 | order: 1; | 3604 | order: 1; |
3604 | } | 3605 | } |
3605 | .videos-custom-item-wrapper:after { | 3606 | |
3607 | .blog.videos-custom .videos-custom-item-wrapper:after { | ||
3606 | content: ""; | 3608 | content: ""; |
3607 | display: block; | 3609 | display: block; |
3608 | min-width: 190px; | 3610 | min-width: 190px; |
3609 | width: 30%; | 3611 | width: calc(33% - 8px); |
3610 | height: 0px; | 3612 | height: 0px; |
3611 | } | 3613 | } |
3612 | 3614 | ||
3613 | .videos-custom-item { | 3615 | .blog.videos-custom .videos-custom-item-wrapper > li { |
3616 | list-style: none; | ||
3614 | min-width: 190px; | 3617 | min-width: 190px; |
3615 | width: 30%; | 3618 | width: calc(33% - 8px); |
3616 | margin-bottom: 16px; | 3619 | margin-bottom: 16px; |
3620 | font-size: 1rem; | ||
3621 | text-align: justify; | ||
3617 | } | 3622 | } |
3618 | 3623 | ||
3619 | .videos-custom-item-title { | 3624 | .blog.videos-custom .videos-custom-item-wrapper > li > h5 { |
3625 | padding-left: 0; | ||
3620 | font-size: 1.125rem; | 3626 | font-size: 1.125rem; |
3621 | } | 3627 | background: none; |
3622 | 3628 | margin-top: 15px; | |
3623 | .videos-custom-item-explanation { | 3629 | margin-bottom: 5px; |
3624 | font-size: 1rem; | ||
3625 | } | 3630 | } |
3626 | 3631 | ||
3627 | /* ビデオライブラリページ レスポンシブ*/ | 3632 | /* ビデオライブラリページ レスポンシブ*/ |
3628 | @media (max-width: 900px) { | 3633 | @media (max-width: 900px) { |
3629 | .videos-custom-item { | 3634 | .blog.videos-custom-item-wrapper:before { |
3630 | width: 45%; | 3635 | width: calc(50% - 8px); |
3631 | } | 3636 | } |
3632 | .videos-custom-item-wrapper:before { | 3637 | .blog.videos-custom-item-wrapper:after { |
3633 | width: 45%; | 3638 | width: calc(50% - 8px); |
3634 | } | 3639 | } |
3635 | .videos-custom-item-wrapper:after { | 3640 | .blog.videos-custom .videos-custom-item-wrapper > li { |
3636 | width: 45%; | 3641 | width: calc(50% - 8px); |
3637 | } | 3642 | } |
3638 | } | 3643 | } |
3639 | 3644 | ||
3640 | @media (max-width: 550px) { | 3645 | @media (max-width: 550px) { |
3641 | .videos-custom-item-wrapper { | 3646 | #content .blog.videos-custom h3 { |
3647 | margin-bottom: 10px; | ||
3648 | margin-top: 0px; | ||
3649 | margin-bottom: 0px; | ||
3650 | margin-top: 10px; | ||
3651 | } | ||
3652 | |||
3653 | .blog.videos-custom-item-wrapper { | ||
3642 | display: block; | 3654 | display: block; |
3643 | } | 3655 | } |
3644 | 3656 | ||
3645 | .videos-custom-item { | 3657 | .blog.videos-custom .videos-custom-item-wrapper > li { |
3646 | height: auto; | 3658 | height: auto; |
3647 | width: 100%; | 3659 | width: 100%; |
3648 | padding-bottom: 8px; | 3660 | padding-bottom: 2px; |
3649 | border-bottom: #003894 4px solid; | 3661 | border-bottom: #003894 2px solid; |
3650 | margin-bottom: 24px; | 3662 | margin-bottom: 10px; |
3663 | font-size: 0.875rem; | ||
3651 | } | 3664 | } |
3652 | 3665 | ||
3653 | 3666 | .blog.videos-custom .videos-custom-item-wrapper > li > h5 { | |
3654 | .videos-custom-item-title { | ||
3655 | font-size: 1rem; | 3667 | font-size: 1rem; |
3656 | } | 3668 | } |
3657 | 3669 | ||
3658 | .videos-custom-item-explanation { | 3670 | .blog.videos-custom .videos-custom-item-wrapper > li > p { |
3659 | font-size: 0.875rem; | 3671 | margin-bottom: 0; |
3660 | } | 3672 | } |
3661 | } | 3673 | } |
3662 | 3674 | ||
... | @@ -3762,6 +3774,11 @@ body.itemid-132 table { | ... | @@ -3762,6 +3774,11 @@ body.itemid-132 table { |
3762 | background-color: #fff; | 3774 | background-color: #fff; |
3763 | } | 3775 | } |
3764 | 3776 | ||
3777 | .item-page.photos-custom > div p:hover { | ||
3778 | cursor: pointer; | ||
3779 | } | ||
3780 | |||
3781 | |||
3765 | .item-page.photos-custom > div p img { | 3782 | .item-page.photos-custom > div p img { |
3766 | display: block; | 3783 | display: block; |
3767 | /* 親要素の真ん中に表示 */ | 3784 | /* 親要素の真ん中に表示 */ |
... | @@ -3792,28 +3809,37 @@ body.itemid-132 table { | ... | @@ -3792,28 +3809,37 @@ body.itemid-132 table { |
3792 | } | 3809 | } |
3793 | 3810 | ||
3794 | .item-page.photos-custom #photo-popup { | 3811 | .item-page.photos-custom #photo-popup { |
3795 | display: block; | ||
3796 | position: fixed; | 3812 | position: fixed; |
3797 | top: 50%; | 3813 | top: 50%; |
3798 | left: 50%; | 3814 | left: 50%; |
3799 | transform: translate(-50%, -50%); | 3815 | transform: translate(-50%, -50%); |
3800 | z-index: 220; | 3816 | z-index: 220; |
3817 | width: 90%; | ||
3818 | height: 90%; | ||
3801 | max-width: 1260px; | 3819 | max-width: 1260px; |
3802 | max-height: 90%; | ||
3803 | overflow: auto; | ||
3804 | } | 3820 | } |
3805 | 3821 | ||
3806 | .item-page.photos-custom #photo-popup.Vertical { | 3822 | .item-page.photos-custom #photo-popup.vertical { |
3807 | width: 60%; | 3823 | display: flex; |
3824 | align-items: center; | ||
3825 | justify-content: center; | ||
3808 | } | 3826 | } |
3809 | 3827 | ||
3810 | .item-page.photos-custom #photo-popup.horizontal { | 3828 | .item-page.photos-custom #photo-popup.horizontal { |
3811 | width: 90%; | 3829 | overflow: auto; |
3812 | } | 3830 | } |
3813 | 3831 | ||
3814 | .item-page.photos-custom #photo-popup #photo-popup-img { | 3832 | .item-page.photos-custom #photo-popup #photo-popup-img { |
3833 | transition: opacity 0.5s; | ||
3834 | } | ||
3835 | |||
3836 | |||
3837 | .item-page.photos-custom #photo-popup.vertical #photo-popup-img { | ||
3838 | max-height: 100%; | ||
3839 | } | ||
3840 | |||
3841 | .item-page.photos-custom #photo-popup.horizontal #photo-popup-img { | ||
3815 | width: 100%; | 3842 | width: 100%; |
3816 | transition: all 0.5s; | ||
3817 | } | 3843 | } |
3818 | 3844 | ||
3819 | .item-page.photos-custom #photo-popup-under { | 3845 | .item-page.photos-custom #photo-popup-under { | ... | ... |
... | @@ -23,29 +23,12 @@ jQuery(function($) { | ... | @@ -23,29 +23,12 @@ jQuery(function($) { |
23 | for (let i = 0; i < $imgWrppers.length; i++) { | 23 | for (let i = 0; i < $imgWrppers.length; i++) { |
24 | // 子要素が空の場合削除(自動生成されたp要素は子要素が入っていない) | 24 | // 子要素が空の場合削除(自動生成されたp要素は子要素が入っていない) |
25 | if ($imgWrppers[i]['children'].length === 0) { | 25 | if ($imgWrppers[i]['children'].length === 0) { |
26 | $('.item-page.photos-custom > div p').eq(i).remove(); | 26 | $imgWrppers[i].remove(); |
27 | } | 27 | } |
28 | } | 28 | } |
29 | }); | 29 | }); |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * 画面サイズが4:3より縦長の場合は、写真を画面幅いっぱいに表示する。 | ||
33 | */ | ||
34 | function setPopup() { | ||
35 | const winW = $(window).innerWidth(); | ||
36 | const winH = $(window).innerHeight(); | ||
37 | // 画面表示領域のアスペクト比を取得 | ||
38 | const asp = winH / winW; | ||
39 | if (asp < 0.75) { | ||
40 | $('#photo-popup').removeClass('horizontal'); | ||
41 | $('#photo-popup').addClass('Vertical'); | ||
42 | } else { | ||
43 | $('#photo-popup').removeClass('Vertical'); | ||
44 | $('#photo-popup').addClass('horizontal'); | ||
45 | } | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * 画像のクリックをトリガーにして、ポップアップで表示する画像URLの取得と、 | 32 | * 画像のクリックをトリガーにして、ポップアップで表示する画像URLの取得と、 |
50 | * popupの制御を行う関数の実行。 | 33 | * popupの制御を行う関数の実行。 |
51 | */ | 34 | */ |
... | @@ -60,19 +43,14 @@ jQuery(function($) { | ... | @@ -60,19 +43,14 @@ jQuery(function($) { |
60 | const $img = $('#photo-popup-img'); | 43 | const $img = $('#photo-popup-img'); |
61 | // popupに画像URLをセット | 44 | // popupに画像URLをセット |
62 | $img.attr('src', src); | 45 | $img.attr('src', src); |
63 | setPopup(); | 46 | // 画像URLのセットから時間をあけることで、表示がなめらかになる。 |
64 | $(window).resize(function () { | ||
65 | setPopup(); | ||
66 | }); | ||
67 | setTimeout(function () { | 47 | setTimeout(function () { |
68 | // popupの表示 | 48 | // popupの表示 |
69 | $('#photo-popup-wrapper').fadeIn(); | 49 | $('#photo-popup-wrapper').fadeIn(); |
70 | // popupのみスクロール可とする。 | 50 | // popupのみスクロール可とする。 |
71 | $('body').css('overflow','hidden'); | 51 | $('body').css('overflow','hidden'); |
52 | addClassToImage($img); | ||
72 | }, 50); | 53 | }, 50); |
73 | setTimeout(function () { | ||
74 | popupScrollSet($img); | ||
75 | }, 100); | ||
76 | }); | 54 | }); |
77 | 55 | ||
78 | /** | 56 | /** |
... | @@ -97,11 +75,12 @@ jQuery(function($) { | ... | @@ -97,11 +75,12 @@ jQuery(function($) { |
97 | src = $('.item-page.photos-custom > div p').eq(index).children('img').attr('src'); | 75 | src = $('.item-page.photos-custom > div p').eq(index).children('img').attr('src'); |
98 | } | 76 | } |
99 | setTimeout(function () { | 77 | setTimeout(function () { |
100 | // transitionで透明になりきった時点で画像の差し替えを実行 | 78 | // transitionで透明になりきるまでまって画像の差し替えを実行 |
101 | $img.attr('src', src); | 79 | $img.attr('src', src); |
102 | }, 400); | 80 | }, 400); |
103 | setTimeout(function () { | 81 | setTimeout(function () { |
104 | popupScrollSet($img); | 82 | // 画像URLのセットからすこし待つことで関数で正しい数値を取得できる。 |
83 | addClassToImage($img); | ||
105 | }, 500); | 84 | }, 500); |
106 | setTimeout(function () { | 85 | setTimeout(function () { |
107 | $('#photo-popup').css('display',''); | 86 | $('#photo-popup').css('display',''); |
... | @@ -126,7 +105,7 @@ jQuery(function($) { | ... | @@ -126,7 +105,7 @@ jQuery(function($) { |
126 | $img.attr('src', src); | 105 | $img.attr('src', src); |
127 | }, 400); | 106 | }, 400); |
128 | setTimeout(function () { | 107 | setTimeout(function () { |
129 | popupScrollSet($img); | 108 | addClassToImage($img); |
130 | }, 500); | 109 | }, 500); |
131 | setTimeout(function () { | 110 | setTimeout(function () { |
132 | $('#photo-popup').css('display',''); | 111 | $('#photo-popup').css('display',''); |
... | @@ -146,18 +125,19 @@ jQuery(function($) { | ... | @@ -146,18 +125,19 @@ jQuery(function($) { |
146 | } | 125 | } |
147 | 126 | ||
148 | /** | 127 | /** |
149 | * 画像が縦長の場合、ポップアップ表示の際にスクロール値を画像の縦中央にセットする。 | 128 | * 表示する画像のアスペクト比に応じたクラスを付与する。 |
150 | * @param {*} $img ポップアップに表示している画像 | 129 | * @param {*} $img ポップアップに表示している画像 |
151 | */ | 130 | */ |
152 | function popupScrollSet($img) { | 131 | function addClassToImage($img) { |
153 | const imgHeight = $img[0].naturalHeight; // 画像の本来の高さ | 132 | const imgHeight = $img[0].naturalHeight; // 画像の本来の高さ |
154 | const imgWidth = $img[0].naturalWidth; // 画像の本来の幅 | 133 | const imgWidth = $img[0].naturalWidth; // 画像の本来の幅 |
155 | if (imgHeight > imgWidth) { | 134 | const asp = imgHeight / imgWidth; |
156 | const wrapperWidth = $('#photo-popup').width(); // 画像の包括要素の幅 | 135 | if (asp < 1) { |
157 | const scaleW = wrapperWidth / imgWidth; // 画像の横幅の縮尺比率 | 136 | $('#photo-popup').removeClass('horizontal'); |
158 | const scrollTop = imgHeight * scaleW * 0.25; // スクロール位置(画像の縮尺後の高さ×25%) | 137 | $('#photo-popup').addClass('vertical'); |
159 | $('#photo-popup').scrollTop(scrollTop); | 138 | } else { |
160 | console.log('test'); | 139 | $('#photo-popup').removeClass('vertical'); |
140 | $('#photo-popup').addClass('horizontal'); | ||
161 | } | 141 | } |
162 | } | 142 | } |
163 | }); | 143 | }); |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment