コンフリクト解消
Showing
66 changed files
with
3630 additions
and
152 deletions
.htaccess
deleted
100644 → 0
1 | # AddHandler x-httpd-php5619 .php | ||
2 | |||
3 | |||
4 | Options +SymLinksIfOwnerMatch | ||
5 | |||
6 | Options -Indexes | ||
7 | |||
8 | RewriteEngine on | ||
9 | |||
10 | |||
11 | ## Begin - Rewrite rules to block out some common exploits. | ||
12 | # If you experience problems on your site then comment out the operations listed | ||
13 | # below by adding a # to the beginning of the line. | ||
14 | # This attempts to block the most common type of exploit `attempts` on Joomla! | ||
15 | # | ||
16 | # Block any script trying to base64_encode data within the URL. | ||
17 | RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] | ||
18 | # Block any script that includes a <script> tag in URL. | ||
19 | RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] | ||
20 | # Block any script trying to set a PHP GLOBALS variable via URL. | ||
21 | RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | ||
22 | # Block any script trying to modify a _REQUEST variable via URL. | ||
23 | RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) | ||
24 | # Return 403 Forbidden header and show the content of the root home page | ||
25 | RewriteRule .* index.php [F] | ||
26 | # | ||
27 | ## End - Rewrite rules to block out some common exploits. | ||
28 | |||
29 | ## Begin - Custom redirects | ||
30 | # | ||
31 | # If you need to redirect some pages, or set a canonical non-www to | ||
32 | # www redirect (or vice versa), place that code here. Ensure those | ||
33 | # redirects use the correct RewriteRule syntax and the [R=301,L] flags. | ||
34 | # | ||
35 | ## End - Custom redirects | ||
36 | |||
37 | ## | ||
38 | # Uncomment the following line if your webserver's URL | ||
39 | # is not directly related to physical file paths. | ||
40 | # Update Your Joomla! Directory (just / for root). | ||
41 | ## | ||
42 | |||
43 | # RewriteBase / | ||
44 | |||
45 | ## Begin - Joomla! core SEF Section. | ||
46 | # | ||
47 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
48 | # | ||
49 | # If the requested path and file is not /index.php and the request | ||
50 | # has not already been internally rewritten to the index.php script | ||
51 | RewriteCond %{REQUEST_URI} !^/index\.php | ||
52 | # and the requested path and file doesn't directly match a physical file | ||
53 | RewriteCond %{REQUEST_FILENAME} !-f | ||
54 | # and the requested path and file doesn't directly match a physical folder | ||
55 | RewriteCond %{REQUEST_FILENAME} !-d | ||
56 | # internally rewrite the request to the index.php script | ||
57 | RewriteRule .* index.php [L] | ||
58 | # | ||
59 | ## End - Joomla! core SEF Section. | ||
60 | |||
61 | |||
62 | RewriteEngine On | ||
63 | # RewriteCond %{HTTPS} off | ||
64 | # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | ||
65 | |||
66 | #20200122 - IPアクセスリダイレクトnozaki | ||
67 | RewriteBase / | ||
68 | RewriteCond %{HTTP_HOST} ^18\.178\.92\.128$ [NC] | ||
69 | RewriteRule .* https://www.nifs-k.ac.jp%{REQUEST_URI} [R=302,L] | ||
70 | |||
71 | <IfModule mod_siteguard.c> | ||
72 | SiteGuard_User_ExcludeSig ip(202.95.45.168) | ||
73 | SiteGuard_User_ExcludeSig ip(202.24.160.0/21) | ||
74 | SiteGuard_User_ExcludeSig ip(210.137.6.192/26) | ||
75 | SiteGuard_User_ExcludeSig ip(210.237.39.72) | ||
76 | SiteGuard_User_ExcludeSig ip(210.237.36.185) | ||
77 | SiteGuard_User_ExcludeSig ip(18.178.92.128) | ||
78 | </IfModule> |
1 | # AddHandler x-httpd-php5619 .php | ||
2 | |||
3 | |||
4 | Options +SymLinksIfOwnerMatch | ||
5 | |||
6 | Options -Indexes | ||
7 | |||
8 | RewriteEngine on | ||
9 | |||
10 | |||
11 | ## Begin - Rewrite rules to block out some common exploits. | ||
12 | # If you experience problems on your site then comment out the operations listed | ||
13 | # below by adding a # to the beginning of the line. | ||
14 | # This attempts to block the most common type of exploit `attempts` on Joomla! | ||
15 | # | ||
16 | # Block any script trying to base64_encode data within the URL. | ||
17 | RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] | ||
18 | # Block any script that includes a <script> tag in URL. | ||
19 | RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] | ||
20 | # Block any script trying to set a PHP GLOBALS variable via URL. | ||
21 | RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | ||
22 | # Block any script trying to modify a _REQUEST variable via URL. | ||
23 | RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) | ||
24 | # Return 403 Forbidden header and show the content of the root home page | ||
25 | RewriteRule .* index.php [F] | ||
26 | # | ||
27 | ## End - Rewrite rules to block out some common exploits. | ||
28 | |||
29 | ## Begin - Custom redirects | ||
30 | # | ||
31 | # If you need to redirect some pages, or set a canonical non-www to | ||
32 | # www redirect (or vice versa), place that code here. Ensure those | ||
33 | # redirects use the correct RewriteRule syntax and the [R=301,L] flags. | ||
34 | # | ||
35 | ## End - Custom redirects | ||
36 | |||
37 | ## | ||
38 | # Uncomment the following line if your webserver's URL | ||
39 | # is not directly related to physical file paths. | ||
40 | # Update Your Joomla! Directory (just / for root). | ||
41 | ## | ||
42 | |||
43 | # RewriteBase / | ||
44 | |||
45 | ## Begin - Joomla! core SEF Section. | ||
46 | # | ||
47 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | ||
48 | # | ||
49 | # If the requested path and file is not /index.php and the request | ||
50 | # has not already been internally rewritten to the index.php script | ||
51 | RewriteCond %{REQUEST_URI} !^/index\.php | ||
52 | # and the requested path and file doesn't directly match a physical file | ||
53 | RewriteCond %{REQUEST_FILENAME} !-f | ||
54 | # and the requested path and file doesn't directly match a physical folder | ||
55 | RewriteCond %{REQUEST_FILENAME} !-d | ||
56 | # internally rewrite the request to the index.php script | ||
57 | RewriteRule .* index.php [L] | ||
58 | # | ||
59 | ## End - Joomla! core SEF Section. | ||
60 | |||
61 | |||
62 | RewriteEngine On | ||
63 | # RewriteCond %{HTTPS} off | ||
64 | # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L] | ||
65 | |||
66 | #20200122 - IPアクセスリダイレクトnozaki | ||
67 | RewriteBase / | ||
68 | RewriteCond %{HTTP_HOST} ^18\.178\.92\.128$ [NC] | ||
69 | RewriteRule .* https://www.nifs-k.ac.jp%{REQUEST_URI} [R=302,L] | ||
70 | |||
71 | # 20200809 gitignore アクセス禁止 | ||
72 | RedirectMatch 404 /\.git | ||
73 | |||
74 | <IfModule mod_siteguard.c> | ||
75 | SiteGuard_User_ExcludeSig ip(202.95.45.168) | ||
76 | SiteGuard_User_ExcludeSig ip(202.24.160.0/21) | ||
77 | SiteGuard_User_ExcludeSig ip(210.137.6.192/26) | ||
78 | SiteGuard_User_ExcludeSig ip(210.237.39.72) | ||
79 | SiteGuard_User_ExcludeSig ip(210.237.36.185) | ||
80 | SiteGuard_User_ExcludeSig ip(18.178.92.128) | ||
81 | </IfModule> | ... | ... |
... | @@ -6,6 +6,7 @@ | ... | @@ -6,6 +6,7 @@ |
6 | ・キャッシュ | 6 | ・キャッシュ |
7 | ・ログ | 7 | ・ログ |
8 | ・アップロードファイル | 8 | ・アップロードファイル |
9 | ・htaccess | ||
9 | 詳しくは.gitignoreを参照 | 10 | 詳しくは.gitignoreを参照 |
10 | 11 | ||
11 | ### 開発環境 | 12 | ### 開発環境 |
... | @@ -14,3 +15,12 @@ https://project.lilli.co.jp/oki/kanoya-univercity-docker | ... | @@ -14,3 +15,12 @@ https://project.lilli.co.jp/oki/kanoya-univercity-docker |
14 | ## DB/アップロードファイルのバックアップについて | 15 | ## DB/アップロードファイルのバックアップについて |
15 | ec2-uesrのホームディレクトリに毎週日曜に1度だけ取るようにしてます。 | 16 | ec2-uesrのホームディレクトリに毎週日曜に1度だけ取るようにしてます。 |
16 | ~/backup.sh をcron実行しています。 | 17 | ~/backup.sh をcron実行しています。 |
18 | |||
19 | ## インストールを必要とするモジュール、コンポーネントについて | ||
20 | srcディレクトリにて、インストールして追加したモジュール、コンポーネントのソースコードを管理しています。 | ||
21 | 追加したモジュール、コンポーネントについての詳細は各モジュール、コンポーネントディレクトリに有るREADME.mdをご覧ください。 | ||
22 | |||
23 | Joomlaのアップデートをした際に、アップデートの内容によっては追加したモジュール、コンポーネントが正常に動作しなくなる場合があります。 | ||
24 | その際は、適宜、モジュール、コンポーネントを修正してください。 | ||
25 | |||
26 | 再度、モジュール、コンポーネントをインストールする場合は、それぞれのREADMEに記述してある手順でインストールしてください。 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="component" version="3.0" method="upgrade"> | ||
3 | <name>COM_CONTENT_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>July 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>COM_CONTENT_CUSTOM_XML_DESCRIPTION</description> | ||
12 | |||
13 | <update> | ||
14 | <schemas> | ||
15 | <schemapath type="mysql">sql/updates/mysql</schemapath> | ||
16 | </schemas> | ||
17 | </update> | ||
18 | |||
19 | <files folder="site"> | ||
20 | <filename>index.html</filename> | ||
21 | <filename>content_custom.php</filename> | ||
22 | <filename>controller.php</filename> | ||
23 | <folder>views</folder> | ||
24 | <folder>helpers</folder> | ||
25 | <folder>models</folder> | ||
26 | </files> | ||
27 | <languages folder="site"> | ||
28 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
29 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
30 | </languages> | ||
31 | <administration> | ||
32 | <menu link='index.php?option=com_content_custom'>カスタムアーカイブ</menu> | ||
33 | <files folder="admin"> | ||
34 | <filename>index.html</filename> | ||
35 | <filename>content_custom.php</filename> | ||
36 | <folder>sql</folder> | ||
37 | </files> | ||
38 | <languages folder="admin"> | ||
39 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
40 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
41 | <language tag="en-GB">language/en-GB.com_content_custom.sys.ini</language> | ||
42 | <language tag="ja-JP">language/ja-JP.com_content_custom.sys.ini</language> | ||
43 | </languages> | ||
44 | </administration> | ||
45 | |||
46 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File mode changed
File mode changed
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 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="Options" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="Position of Article Info" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="Puts the article information block above or below the text or splits it into two separate blocks, one above and the other below." | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="Use Article Settings" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" |
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 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ 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 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="オプション" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="記事情報の位置" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="記事情報のブロックをテキストの上か下に追加します。または1つは上、その他は下へ2つのブロックに分けます。" | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="記事設定の使用" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ 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 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JLoader::register('ContentCustomHelperRoute', JPATH_SITE . '/components/com_content_custom/helpers/route.php'); | ||
13 | JLoader::register('ContentCustomHelperQuery', JPATH_SITE . '/components/com_content_custom/helpers/query.php'); | ||
14 | |||
15 | $input = JFactory::getApplication()->input; | ||
16 | $user = JFactory::getUser(); | ||
17 | |||
18 | $controller = JControllerLegacy::getInstance('Content'); | ||
19 | |||
20 | $controller->execute(JFactory::getApplication()->input->get('task')); | ||
21 | $controller->redirect(); |
components/com_content_custom/controller.php
0 → 100644
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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\CMS\Component\ComponentHelper; | ||
13 | |||
14 | /** | ||
15 | * Content Component Controller | ||
16 | * | ||
17 | * @since 1.5 | ||
18 | */ | ||
19 | class ContentController extends JControllerLegacy | ||
20 | { | ||
21 | /** | ||
22 | * Constructor. | ||
23 | * | ||
24 | * @param array $config An optional associative array of configuration settings. | ||
25 | * Recognized key values include 'name', 'default_task', 'model_path', and | ||
26 | * 'view_path' (this list is not meant to be comprehensive). | ||
27 | * | ||
28 | * @since 3.0.1 | ||
29 | */ | ||
30 | public function __construct($config = array()) | ||
31 | { | ||
32 | $this->input = JFactory::getApplication()->input; | ||
33 | |||
34 | // Article frontpage Editor pagebreak proxying: | ||
35 | if ($this->input->get('view') === 'article' && $this->input->get('layout') === 'pagebreak') | ||
36 | { | ||
37 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
38 | } | ||
39 | // Article frontpage Editor article proxying: | ||
40 | elseif ($this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal') | ||
41 | { | ||
42 | JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true)); | ||
43 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
44 | } | ||
45 | |||
46 | parent::__construct($config); | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * Method to display a view. | ||
51 | * | ||
52 | * @param boolean $cachable If true, the view output will be cached. | ||
53 | * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}. | ||
54 | * | ||
55 | * @return JController This object to support chaining. | ||
56 | * | ||
57 | * @since 1.5 | ||
58 | */ | ||
59 | public function display($cachable = false, $urlparams = false) | ||
60 | { | ||
61 | $cachable = true; | ||
62 | |||
63 | /** | ||
64 | * Set the default view name and format from the Request. | ||
65 | * Note we are using a_id to avoid collisions with the router and the return page. | ||
66 | * Frontend is a bit messier than the backend. | ||
67 | */ | ||
68 | $id = $this->input->getInt('a_id'); | ||
69 | $vName = $this->input->getCmd('view', 'categories'); | ||
70 | $this->input->set('view', $vName); | ||
71 | $user = JFactory::getUser(); | ||
72 | |||
73 | if ($user->get('id') | ||
74 | || ($this->input->getMethod() === 'POST' | ||
75 | && (($vName === 'category' && $this->input->get('layout') !== 'blog') || $vName === 'archive' ))) | ||
76 | { | ||
77 | $cachable = false; | ||
78 | } | ||
79 | |||
80 | $safeurlparams = array( | ||
81 | 'catid' => 'INT', | ||
82 | 'id' => 'INT', | ||
83 | 'cid' => 'ARRAY', | ||
84 | 'year' => 'INT', | ||
85 | 'month' => 'INT', | ||
86 | 'limit' => 'UINT', | ||
87 | 'limitstart' => 'UINT', | ||
88 | 'showall' => 'INT', | ||
89 | 'return' => 'BASE64', | ||
90 | 'filter' => 'STRING', | ||
91 | 'filter_order' => 'CMD', | ||
92 | 'filter_order_Dir' => 'CMD', | ||
93 | 'filter-search' => 'STRING', | ||
94 | 'print' => 'BOOLEAN', | ||
95 | 'lang' => 'CMD', | ||
96 | 'Itemid' => 'INT'); | ||
97 | |||
98 | parent::display($cachable, $safeurlparams); | ||
99 | |||
100 | return $this; | ||
101 | } | ||
102 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | /** | ||
13 | * Content Component Query Helper | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentCustomHelperQuery | ||
18 | { | ||
19 | /** | ||
20 | * Translate an order code to a field for secondary category ordering. | ||
21 | * | ||
22 | * @param string $orderby The ordering code. | ||
23 | * @param string $orderDate The ordering code for the date. | ||
24 | * | ||
25 | * @return string The SQL field(s) to order by. | ||
26 | * | ||
27 | * @since 1.5 | ||
28 | */ | ||
29 | public static function orderbySecondary($orderby, $orderDate = 'created') | ||
30 | { | ||
31 | $queryDate = self::getQueryDate($orderDate); | ||
32 | |||
33 | switch ($orderby) | ||
34 | { | ||
35 | case 'date' : | ||
36 | $orderby = $queryDate; | ||
37 | break; | ||
38 | |||
39 | case 'rdate' : | ||
40 | $orderby = $queryDate . ' DESC '; | ||
41 | break; | ||
42 | |||
43 | case 'alpha' : | ||
44 | $orderby = 'a.title'; | ||
45 | break; | ||
46 | |||
47 | case 'ralpha' : | ||
48 | $orderby = 'a.title DESC'; | ||
49 | break; | ||
50 | |||
51 | case 'hits' : | ||
52 | $orderby = 'a.hits DESC'; | ||
53 | break; | ||
54 | |||
55 | case 'rhits' : | ||
56 | $orderby = 'a.hits'; | ||
57 | break; | ||
58 | |||
59 | case 'order' : | ||
60 | $orderby = 'a.ordering'; | ||
61 | break; | ||
62 | |||
63 | case 'rorder' : | ||
64 | $orderby = 'a.ordering DESC'; | ||
65 | break; | ||
66 | |||
67 | case 'author' : | ||
68 | $orderby = 'author'; | ||
69 | break; | ||
70 | |||
71 | case 'rauthor' : | ||
72 | $orderby = 'author DESC'; | ||
73 | break; | ||
74 | |||
75 | case 'front' : | ||
76 | $orderby = 'a.featured DESC, fp.ordering, ' . $queryDate . ' DESC '; | ||
77 | break; | ||
78 | |||
79 | case 'random' : | ||
80 | $orderby = JFactory::getDbo()->getQuery(true)->Rand(); | ||
81 | break; | ||
82 | |||
83 | case 'vote' : | ||
84 | $orderby = 'a.id DESC '; | ||
85 | |||
86 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
87 | { | ||
88 | $orderby = 'rating_count DESC '; | ||
89 | } | ||
90 | break; | ||
91 | |||
92 | case 'rvote' : | ||
93 | $orderby = 'a.id ASC '; | ||
94 | |||
95 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
96 | { | ||
97 | $orderby = 'rating_count ASC '; | ||
98 | } | ||
99 | break; | ||
100 | |||
101 | case 'rank' : | ||
102 | $orderby = 'a.id DESC '; | ||
103 | |||
104 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
105 | { | ||
106 | $orderby = 'rating DESC '; | ||
107 | } | ||
108 | break; | ||
109 | |||
110 | case 'rrank' : | ||
111 | $orderby = 'a.id ASC '; | ||
112 | |||
113 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
114 | { | ||
115 | $orderby = 'rating ASC '; | ||
116 | } | ||
117 | break; | ||
118 | |||
119 | default : | ||
120 | $orderby = 'a.ordering'; | ||
121 | break; | ||
122 | } | ||
123 | |||
124 | return $orderby; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * Translate an order code to a field for primary category ordering. | ||
129 | * | ||
130 | * @param string $orderDate The ordering code. | ||
131 | * | ||
132 | * @return string The SQL field(s) to order by. | ||
133 | * | ||
134 | * @since 1.6 | ||
135 | */ | ||
136 | public static function getQueryDate($orderDate) | ||
137 | { | ||
138 | $db = JFactory::getDbo(); | ||
139 | |||
140 | switch ($orderDate) | ||
141 | { | ||
142 | case 'modified' : | ||
143 | $queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END'; | ||
144 | break; | ||
145 | |||
146 | // Use created if publish_up is not set | ||
147 | case 'published' : | ||
148 | $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; | ||
149 | break; | ||
150 | |||
151 | case 'unpublished' : | ||
152 | $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END '; | ||
153 | break; | ||
154 | case 'created' : | ||
155 | default : | ||
156 | $queryDate = ' a.created '; | ||
157 | break; | ||
158 | } | ||
159 | |||
160 | return $queryDate; | ||
161 | } | ||
162 | |||
163 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | /** | ||
13 | * Content Component Route Helper. | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | abstract class ContentCustomHelperRoute | ||
18 | { | ||
19 | /** | ||
20 | * Get the article route. | ||
21 | * | ||
22 | * @param integer $id The route of the content item. | ||
23 | * @param integer $catid The category ID. | ||
24 | * @param integer $language The language code. | ||
25 | * @param string $layout The layout value. | ||
26 | * | ||
27 | * @return string The article route. | ||
28 | * | ||
29 | * @since 1.5 | ||
30 | */ | ||
31 | public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null) | ||
32 | { | ||
33 | // Create the link | ||
34 | $link = 'index.php?option=com_content&view=article&id=' . $id; | ||
35 | |||
36 | if ((int) $catid > 1) | ||
37 | { | ||
38 | $link .= '&catid=' . $catid; | ||
39 | } | ||
40 | |||
41 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
42 | { | ||
43 | $link .= '&lang=' . $language; | ||
44 | } | ||
45 | |||
46 | if ($layout) | ||
47 | { | ||
48 | $link .= '&layout=' . $layout; | ||
49 | } | ||
50 | |||
51 | return $link; | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * Get the category route. | ||
56 | * | ||
57 | * @param integer $catid The category ID. | ||
58 | * @param integer $language The language code. | ||
59 | * @param string $layout The layout value. | ||
60 | * | ||
61 | * @return string The article route. | ||
62 | * | ||
63 | * @since 1.5 | ||
64 | */ | ||
65 | public static function getCategoryRoute($catid, $language = 0, $layout = null) | ||
66 | { | ||
67 | if ($catid instanceof JCategoryNode) | ||
68 | { | ||
69 | $id = $catid->id; | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | $id = (int) $catid; | ||
74 | } | ||
75 | |||
76 | if ($id < 1) | ||
77 | { | ||
78 | return ''; | ||
79 | } | ||
80 | |||
81 | $link = 'index.php?option=com_content&view=category&id=' . $id; | ||
82 | |||
83 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
84 | { | ||
85 | $link .= '&lang=' . $language; | ||
86 | } | ||
87 | |||
88 | if ($layout) | ||
89 | { | ||
90 | $link .= '&layout=' . $layout; | ||
91 | } | ||
92 | |||
93 | return $link; | ||
94 | } | ||
95 | |||
96 | } |
components/com_content_custom/index.html
0 → 100644
File mode changed
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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\Utilities\ArrayHelper; | ||
13 | |||
14 | JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); | ||
15 | |||
16 | /** | ||
17 | * Content Component Archive Model | ||
18 | * | ||
19 | * @since 1.5 | ||
20 | */ | ||
21 | class ContentModelArchive extends ContentModelArticles | ||
22 | { | ||
23 | /** | ||
24 | * Model context string. | ||
25 | * | ||
26 | * @var string | ||
27 | */ | ||
28 | public $_context = 'com_content_custom.archive'; | ||
29 | |||
30 | /** | ||
31 | * Method to auto-populate the model state. | ||
32 | * | ||
33 | * Note. Calling getState in this method will result in recursion. | ||
34 | * | ||
35 | * @param string $ordering The field to order on. | ||
36 | * @param string $direction The direction to order on. | ||
37 | * | ||
38 | * @return void | ||
39 | * | ||
40 | * @since 1.6 | ||
41 | */ | ||
42 | protected function populateState($ordering = null, $direction = null) | ||
43 | { | ||
44 | parent::populateState(); | ||
45 | |||
46 | $app = JFactory::getApplication(); | ||
47 | |||
48 | // Add archive properties | ||
49 | $params = $this->state->params; | ||
50 | |||
51 | // Filter on archived articles | ||
52 | $this->setState('filter.published', 1); | ||
53 | |||
54 | // Filter on month, year | ||
55 | $this->setState('filter.month', $app->input->getInt('month')); | ||
56 | $this->setState('filter.year', $app->input->getInt('year')); | ||
57 | |||
58 | // Optional filter text | ||
59 | $this->setState('list.filter', $app->input->getString('filter-search')); | ||
60 | |||
61 | // Get list limit | ||
62 | $itemid = $app->input->get('Itemid', 0, 'int'); | ||
63 | $limit = $app->getUserStateFromRequest('com_content_custom.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); | ||
64 | $this->setState('list.limit', $limit); | ||
65 | |||
66 | // Set the archive ordering | ||
67 | $articleOrderby = $params->get('orderby_sec', 'rdate'); | ||
68 | $articleOrderDate = $params->get('order_date'); | ||
69 | |||
70 | // No category ordering | ||
71 | $secondary = ContentCustomHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); | ||
72 | |||
73 | $this->setState('list.ordering', $secondary . ', a.created DESC'); | ||
74 | $this->setState('list.direction', ''); | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * Get the master query for retrieving a list of articles subject to the model state. | ||
79 | * | ||
80 | * @return JDatabaseQuery | ||
81 | * | ||
82 | * @since 1.6 | ||
83 | */ | ||
84 | protected function getListQuery() | ||
85 | { | ||
86 | $params = $this->state->params; | ||
87 | $app = JFactory::getApplication('site'); | ||
88 | $catids = ArrayHelper::toInteger($app->input->get('catid', array(), 'array')); | ||
89 | $catids = array_values(array_diff($catids, array(0))); | ||
90 | $articleOrderDate = $params->get('order_date'); | ||
91 | |||
92 | // Create a new query object. | ||
93 | $query = parent::getListQuery(); | ||
94 | |||
95 | // Add routing for archive | ||
96 | // Sqlsrv changes | ||
97 | $case_when = ' CASE WHEN '; | ||
98 | $case_when .= $query->charLength('a.alias', '!=', '0'); | ||
99 | $case_when .= ' THEN '; | ||
100 | $a_id = $query->castAsChar('a.id'); | ||
101 | $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); | ||
102 | $case_when .= ' ELSE '; | ||
103 | $case_when .= $a_id . ' END as slug'; | ||
104 | |||
105 | $query->select($case_when); | ||
106 | |||
107 | $case_when = ' CASE WHEN '; | ||
108 | $case_when .= $query->charLength('c.alias', '!=', '0'); | ||
109 | $case_when .= ' THEN '; | ||
110 | $c_id = $query->castAsChar('c.id'); | ||
111 | $case_when .= $query->concatenate(array($c_id, 'c.alias'), ':'); | ||
112 | $case_when .= ' ELSE '; | ||
113 | $case_when .= $c_id . ' END as catslug'; | ||
114 | $query->select($case_when); | ||
115 | |||
116 | // Filter on month, year | ||
117 | // First, get the date field | ||
118 | $queryDate = ContentCustomHelperQuery::getQueryDate($articleOrderDate); | ||
119 | |||
120 | if ($month = $this->getState('filter.month')) | ||
121 | { | ||
122 | $query->where($query->month($queryDate) . ' = ' . $month); | ||
123 | } | ||
124 | |||
125 | if ($year = $this->getState('filter.year')) | ||
126 | { | ||
127 | $query->where($query->year($queryDate) . ' = ' . $year); | ||
128 | } | ||
129 | |||
130 | if (count($catids) > 0) | ||
131 | { | ||
132 | $query->where('c.id IN (' . implode(', ', $catids) . ')'); | ||
133 | } | ||
134 | |||
135 | return $query; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * Method to get the archived article list | ||
140 | * | ||
141 | * @access public | ||
142 | * @return array | ||
143 | */ | ||
144 | public function getData() | ||
145 | { | ||
146 | $app = JFactory::getApplication(); | ||
147 | |||
148 | // Lets load the content if it doesn't already exist | ||
149 | if (empty($this->_data)) | ||
150 | { | ||
151 | // Get the page/component configuration | ||
152 | $params = $app->getParams(); | ||
153 | |||
154 | // Get the pagination request variables | ||
155 | $limit = $app->input->get('limit', $params->get('display_num', 20), 'uint'); | ||
156 | $limitstart = $app->input->get('limitstart', 0, 'uint'); | ||
157 | |||
158 | $query = $this->_buildQuery(); | ||
159 | |||
160 | $this->_data = $this->_getList($query, $limitstart, $limit); | ||
161 | } | ||
162 | |||
163 | return $this->_data; | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * JModelLegacy override to add alternating value for $odd | ||
168 | * | ||
169 | * @param string $query The query. | ||
170 | * @param integer $limitstart Offset. | ||
171 | * @param integer $limit The number of records. | ||
172 | * | ||
173 | * @return array An array of results. | ||
174 | * | ||
175 | * @since 3.0.1 | ||
176 | * @throws RuntimeException | ||
177 | */ | ||
178 | protected function _getList($query, $limitstart=0, $limit=0) | ||
179 | { | ||
180 | $result = parent::_getList($query, $limitstart, $limit); | ||
181 | |||
182 | $odd = 1; | ||
183 | |||
184 | foreach ($result as $k => $row) | ||
185 | { | ||
186 | $result[$k]->odd = $odd; | ||
187 | $odd = 1 - $odd; | ||
188 | } | ||
189 | |||
190 | return $result; | ||
191 | } | ||
192 | } |
This diff is collapsed.
Click to expand it.
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | JHtml::_('formbehavior.chosen', 'select'); | ||
14 | JHtml::_('behavior.caption'); | ||
15 | ?> | ||
16 | <div class="archive-custom<?php echo $this->pageclass_sfx; ?>"> | ||
17 | <?php if ($this->params->get('show_page_heading')) : ?> | ||
18 | <div class="page-header"> | ||
19 | <h1> | ||
20 | <?php echo $this->escape($this->params->get('page_heading')); ?> | ||
21 | </h1> | ||
22 | </div> | ||
23 | <?php endif; ?> | ||
24 | <?php echo $this->loadTemplate('items'); ?> | ||
25 | </div> |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <metadata> | ||
3 | <layout title="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION"> | ||
4 | <help | ||
5 | key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED" | ||
6 | /> | ||
7 | <message> | ||
8 | <![CDATA[COM_CONTENT_CUSTOM_XML_DESCRIPTION]]> | ||
9 | </message> | ||
10 | </layout> | ||
11 | |||
12 | <!-- Add fields to the request variables for the layout. --> | ||
13 | <fields name="request"> | ||
14 | <fieldset name="request" | ||
15 | addfieldpath="/administrator/components/com_categories/models/fields" | ||
16 | > | ||
17 | <field | ||
18 | name="catid" | ||
19 | type="category" | ||
20 | extension="com_content" | ||
21 | multiple="true" | ||
22 | size="5" | ||
23 | label="JCATEGORY" | ||
24 | description="JFIELD_CATEGORY_DESC" | ||
25 | > | ||
26 | <option value="">JOPTION_ALL_CATEGORIES</option> | ||
27 | </field> | ||
28 | </fieldset> | ||
29 | </fields> | ||
30 | |||
31 | <!-- Add fields to the parameters object for the layout. --> | ||
32 | <fields name="params"> | ||
33 | |||
34 | <!-- Basic options. --> | ||
35 | <fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS" | ||
36 | > | ||
37 | |||
38 | <field | ||
39 | name="orderby_sec" | ||
40 | type="list" | ||
41 | label="JGLOBAL_ARTICLE_ORDER_LABEL" | ||
42 | description="JGLOBAL_ARTICLE_ORDER_DESC" | ||
43 | default="rdate" | ||
44 | > | ||
45 | <option value="date">JGLOBAL_OLDEST_FIRST</option> | ||
46 | <option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option> | ||
47 | <option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option> | ||
48 | <option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option> | ||
49 | <option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option> | ||
50 | <option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option> | ||
51 | <option value="hits">JGLOBAL_MOST_HITS</option> | ||
52 | <option value="rhits">JGLOBAL_LEAST_HITS</option> | ||
53 | <option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option> | ||
54 | <option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option> | ||
55 | <option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option> | ||
56 | <option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option> | ||
57 | <option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option> | ||
58 | </field> | ||
59 | |||
60 | <field | ||
61 | name="order_date" | ||
62 | type="list" | ||
63 | label="JGLOBAL_ORDERING_DATE_LABEL" | ||
64 | description="JGLOBAL_ORDERING_DATE_DESC" | ||
65 | default="published" | ||
66 | > | ||
67 | <option value="created">JGLOBAL_Created</option> | ||
68 | <option value="modified">JGLOBAL_Modified</option> | ||
69 | <option value="published">JPUBLISHED</option> | ||
70 | </field> | ||
71 | |||
72 | <field | ||
73 | name="display_num" | ||
74 | type="list" | ||
75 | label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL" | ||
76 | description="JGLOBAL_NUMBER_ITEMS_LIST_DESC" | ||
77 | default="5" | ||
78 | > | ||
79 | <option value="5">J5</option> | ||
80 | <option value="10">J10</option> | ||
81 | <option value="15">J15</option> | ||
82 | <option value="20">J20</option> | ||
83 | <option value="25">J25</option> | ||
84 | <option value="30">J30</option> | ||
85 | <option value="50">J50</option> | ||
86 | <option value="100">J100</option> | ||
87 | <option value="0">JALL</option> | ||
88 | </field> | ||
89 | |||
90 | <field | ||
91 | name="filter_field" | ||
92 | type="list" | ||
93 | label="JGLOBAL_FILTER_FIELD_LABEL" | ||
94 | description="JGLOBAL_FILTER_FIELD_DESC" | ||
95 | default="" | ||
96 | useglobal="true" | ||
97 | > | ||
98 | <option value="hide">JHIDE</option> | ||
99 | <option value="1">JSHOW</option> | ||
100 | </field> | ||
101 | |||
102 | <field | ||
103 | name="introtext_limit" | ||
104 | type="number" | ||
105 | label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL" | ||
106 | description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC" | ||
107 | default="1000" | ||
108 | /> | ||
109 | |||
110 | </fieldset> | ||
111 | |||
112 | <!-- Articles options. --> | ||
113 | <fieldset name="articles" | ||
114 | label="COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL" | ||
115 | > | ||
116 | |||
117 | <field | ||
118 | name="show_intro" | ||
119 | type="list" | ||
120 | label="JGLOBAL_SHOW_INTRO_LABEL" | ||
121 | description="JGLOBAL_SHOW_INTRO_DESC" | ||
122 | class="chzn-color" | ||
123 | default="1" | ||
124 | > | ||
125 | <option value="0">JHIDE</option> | ||
126 | <option value="1">JSHOW</option> | ||
127 | </field> | ||
128 | |||
129 | <field | ||
130 | name="info_block_position" | ||
131 | type="list" | ||
132 | label="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL" | ||
133 | description="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC" | ||
134 | default="" | ||
135 | useglobal="true" | ||
136 | class="chzn-color" | ||
137 | > | ||
138 | <option value="use_article">COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS</option> | ||
139 | <option value="0">COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE</option> | ||
140 | <option value="1">COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW</option> | ||
141 | <option value="2">COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT</option> | ||
142 | </field> | ||
143 | |||
144 | <field | ||
145 | name="show_category" | ||
146 | type="list" | ||
147 | label="JGLOBAL_SHOW_CATEGORY_LABEL" | ||
148 | description="JGLOBAL_SHOW_CATEGORY_DESC" | ||
149 | useglobal="true" | ||
150 | class="chzn-color" | ||
151 | > | ||
152 | <option value="0">JHIDE</option> | ||
153 | <option value="1">JSHOW</option> | ||
154 | </field> | ||
155 | |||
156 | <field | ||
157 | name="link_category" | ||
158 | type="list" | ||
159 | label="JGLOBAL_LINK_CATEGORY_LABEL" | ||
160 | description="JGLOBAL_LINK_CATEGORY_DESC" | ||
161 | useglobal="true" | ||
162 | class="chzn-color" | ||
163 | > | ||
164 | <option value="0">JNO</option> | ||
165 | <option value="1">JYES</option> | ||
166 | </field> | ||
167 | |||
168 | <field | ||
169 | name="show_parent_category" | ||
170 | type="list" | ||
171 | label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" | ||
172 | description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" | ||
173 | useglobal="true" | ||
174 | > | ||
175 | <option value="0">JHIDE</option> | ||
176 | <option value="1">JSHOW</option> | ||
177 | </field> | ||
178 | |||
179 | <field | ||
180 | name="link_parent_category" | ||
181 | type="list" | ||
182 | label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" | ||
183 | description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" | ||
184 | useglobal="true" | ||
185 | > | ||
186 | <option value="0">JNO</option> | ||
187 | <option value="1">JYES</option> | ||
188 | </field> | ||
189 | |||
190 | <field | ||
191 | name="link_titles" | ||
192 | type="list" | ||
193 | label="JGLOBAL_LINKED_TITLES_LABEL" | ||
194 | description="JGLOBAL_LINKED_TITLES_DESC" | ||
195 | class="chzn-color" | ||
196 | default="1" | ||
197 | > | ||
198 | <option value="0">JNO</option> | ||
199 | <option value="1">JYES</option> | ||
200 | </field> | ||
201 | |||
202 | <field | ||
203 | name="show_author" | ||
204 | type="list" | ||
205 | label="JGLOBAL_SHOW_AUTHOR_LABEL" | ||
206 | description="JGLOBAL_SHOW_AUTHOR_DESC" | ||
207 | useglobal="true" | ||
208 | class="chzn-color" | ||
209 | > | ||
210 | <option value="0">JHIDE</option> | ||
211 | <option value="1">JSHOW</option> | ||
212 | </field> | ||
213 | |||
214 | <field | ||
215 | name="link_author" | ||
216 | type="list" | ||
217 | label="JGLOBAL_LINK_AUTHOR_LABEL" | ||
218 | description="JGLOBAL_LINK_AUTHOR_DESC" | ||
219 | useglobal="true" | ||
220 | > | ||
221 | <option value="0">JNO</option> | ||
222 | <option value="1">JYES</option> | ||
223 | </field> | ||
224 | |||
225 | <field | ||
226 | name="show_create_date" | ||
227 | type="list" | ||
228 | label="JGLOBAL_SHOW_CREATE_DATE_LABEL" | ||
229 | description="JGLOBAL_SHOW_CREATE_DATE_DESC" | ||
230 | useglobal="true" | ||
231 | class="chzn-color" | ||
232 | > | ||
233 | <option value="0">JHIDE</option> | ||
234 | <option value="1">JSHOW</option> | ||
235 | </field> | ||
236 | |||
237 | <field | ||
238 | name="show_modify_date" | ||
239 | type="list" | ||
240 | label="JGLOBAL_SHOW_MODIFY_DATE_LABEL" | ||
241 | description="JGLOBAL_SHOW_MODIFY_DATE_DESC" | ||
242 | useglobal="true" | ||
243 | class="chzn-color" | ||
244 | > | ||
245 | <option value="0">JHIDE</option> | ||
246 | <option value="1">JSHOW</option> | ||
247 | </field> | ||
248 | |||
249 | <field | ||
250 | name="show_publish_date" | ||
251 | type="list" | ||
252 | label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL" | ||
253 | description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" | ||
254 | class="chzn-color" | ||
255 | default="1" | ||
256 | > | ||
257 | <option value="0">JHIDE</option> | ||
258 | <option value="1">JSHOW</option> | ||
259 | </field> | ||
260 | |||
261 | <field | ||
262 | name="show_hits" | ||
263 | type="list" | ||
264 | label="JGLOBAL_SHOW_HITS_LABEL" | ||
265 | description="JGLOBAL_SHOW_HITS_DESC" | ||
266 | useglobal="true" | ||
267 | class="chzn-color" | ||
268 | > | ||
269 | <option value="0">JHIDE</option> | ||
270 | <option value="1">JSHOW</option> | ||
271 | </field> | ||
272 | </fieldset> | ||
273 | |||
274 | </fields> | ||
275 | </metadata> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | $params = $this->params; | ||
14 | ?> | ||
15 | |||
16 | <div id="archive-items"> | ||
17 | <?php foreach ($this->items as $i => $item) : ?> | ||
18 | <?php $info = $item->params->get('info_block_position', 0); ?> | ||
19 | <div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article"> | ||
20 | <div class="page-header"> | ||
21 | <h2 itemprop="headline"> | ||
22 | <?php if ($params->get('link_titles')) : ?> | ||
23 | <?php | ||
24 | $url = JRoute::_(ContentCustomHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); | ||
25 | $url = "information/" . end(explode("/", $url)); | ||
26 | ?> | ||
27 | <a href="<?php echo $url; ?>" itemprop="url"> | ||
28 | <?php echo $this->escape($item->title); ?> | ||
29 | </a> | ||
30 | <?php else : ?> | ||
31 | <?php echo $this->escape($item->title); ?> | ||
32 | <?php endif; ?> | ||
33 | </h2> | ||
34 | |||
35 | <?php // Content is generated by content plugin event "onContentAfterTitle" ?> | ||
36 | <?php echo $item->event->afterDisplayTitle; ?> | ||
37 | |||
38 | <?php if ($params->get('show_author') && !empty($item->author )) : ?> | ||
39 | <div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person"> | ||
40 | <?php $author = $item->created_by_alias ?: $item->author; ?> | ||
41 | <?php $author = '<span itemprop="name">' . $author . '</span>'; ?> | ||
42 | <?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?> | ||
43 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?> | ||
44 | <?php else : ?> | ||
45 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', $author); ?> | ||
46 | <?php endif; ?> | ||
47 | </div> | ||
48 | <?php endif; ?> | ||
49 | </div> | ||
50 | <?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date') | ||
51 | || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?> | ||
52 | <?php if ($useDefList && ($info == 0 || $info == 2)) : ?> | ||
53 | <div class="article-info muted"> | ||
54 | <dl class="article-info"> | ||
55 | <dt class="article-info-term"> | ||
56 | <?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?> | ||
57 | </dt> | ||
58 | |||
59 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
60 | <dd> | ||
61 | <div class="parent-category-name"> | ||
62 | <?php $title = $this->escape($item->parent_title); ?> | ||
63 | <?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?> | ||
64 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
65 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
66 | <?php else : ?> | ||
67 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
68 | <?php endif; ?> | ||
69 | </div> | ||
70 | </dd> | ||
71 | <?php endif; ?> | ||
72 | <?php if ($params->get('show_category')) : ?> | ||
73 | <dd> | ||
74 | <div class="category-name"> | ||
75 | <?php $title = $this->escape($item->category_title); ?> | ||
76 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
77 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
78 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
79 | <?php else : ?> | ||
80 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
81 | <?php endif; ?> | ||
82 | </div> | ||
83 | </dd> | ||
84 | <?php endif; ?> | ||
85 | |||
86 | <?php if ($params->get('show_publish_date')) : ?> | ||
87 | <dd> | ||
88 | <div class="published"> | ||
89 | <span class="icon-calendar" aria-hidden="true"></span> | ||
90 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
91 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
92 | </time> | ||
93 | </div> | ||
94 | </dd> | ||
95 | <?php endif; ?> | ||
96 | |||
97 | <?php if ($info == 0) : ?> | ||
98 | <?php if ($params->get('show_modify_date')) : ?> | ||
99 | <dd> | ||
100 | <div class="modified"> | ||
101 | <span class="icon-calendar" aria-hidden="true"></span> | ||
102 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
103 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
104 | </time> | ||
105 | </div> | ||
106 | </dd> | ||
107 | <?php endif; ?> | ||
108 | <?php if ($params->get('show_create_date')) : ?> | ||
109 | <dd> | ||
110 | <div class="create"> | ||
111 | <span class="icon-calendar" aria-hidden="true"></span> | ||
112 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
113 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?> | ||
114 | </time> | ||
115 | </div> | ||
116 | </dd> | ||
117 | <?php endif; ?> | ||
118 | |||
119 | <?php if ($params->get('show_hits')) : ?> | ||
120 | <dd> | ||
121 | <div class="hits"> | ||
122 | <span class="icon-eye-open"></span> | ||
123 | <meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" /> | ||
124 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
125 | </div> | ||
126 | </dd> | ||
127 | <?php endif; ?> | ||
128 | <?php endif; ?> | ||
129 | </dl> | ||
130 | </div> | ||
131 | <?php endif; ?> | ||
132 | |||
133 | <?php // Content is generated by content plugin event "onContentBeforeDisplay" ?> | ||
134 | <?php echo $item->event->beforeDisplayContent; ?> | ||
135 | <?php if ($params->get('show_intro')) : ?> | ||
136 | <div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div> | ||
137 | <?php endif; ?> | ||
138 | |||
139 | <?php if ($useDefList && ($info == 1 || $info == 2)) : ?> | ||
140 | <div class="article-info muted"> | ||
141 | <dl class="article-info"> | ||
142 | <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?></dt> | ||
143 | |||
144 | <?php if ($info == 1) : ?> | ||
145 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
146 | <dd> | ||
147 | <div class="parent-category-name"> | ||
148 | <?php $title = $this->escape($item->parent_title); ?> | ||
149 | <?php if ($params->get('link_parent_category') && $item->parent_slug) : ?> | ||
150 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
151 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
152 | <?php else : ?> | ||
153 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
154 | <?php endif; ?> | ||
155 | </div> | ||
156 | </dd> | ||
157 | <?php endif; ?> | ||
158 | <?php if ($params->get('show_category')) : ?> | ||
159 | <dd> | ||
160 | <div class="category-name"> | ||
161 | <?php $title = $this->escape($item->category_title); ?> | ||
162 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
163 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
164 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
165 | <?php else : ?> | ||
166 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
167 | <?php endif; ?> | ||
168 | </div> | ||
169 | </dd> | ||
170 | <?php endif; ?> | ||
171 | <?php if ($params->get('show_publish_date')) : ?> | ||
172 | <dd> | ||
173 | <div class="published"> | ||
174 | <span class="icon-calendar" aria-hidden="true"></span> | ||
175 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
176 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
177 | </time> | ||
178 | </div> | ||
179 | </dd> | ||
180 | <?php endif; ?> | ||
181 | <?php endif; ?> | ||
182 | |||
183 | <?php if ($params->get('show_create_date')) : ?> | ||
184 | <dd> | ||
185 | <div class="create"> | ||
186 | <span class="icon-calendar" aria-hidden="true"></span> | ||
187 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
188 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
189 | </time> | ||
190 | </div> | ||
191 | </dd> | ||
192 | <?php endif; ?> | ||
193 | <?php if ($params->get('show_modify_date')) : ?> | ||
194 | <dd> | ||
195 | <div class="modified"> | ||
196 | <span class="icon-calendar" aria-hidden="true"></span> | ||
197 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
198 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
199 | </time> | ||
200 | </div> | ||
201 | </dd> | ||
202 | <?php endif; ?> | ||
203 | <?php if ($params->get('show_hits')) : ?> | ||
204 | <dd> | ||
205 | <div class="hits"> | ||
206 | <span class="icon-eye-open"></span> | ||
207 | <meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" /> | ||
208 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
209 | </div> | ||
210 | </dd> | ||
211 | <?php endif; ?> | ||
212 | </dl> | ||
213 | </div> | ||
214 | <?php endif; ?> | ||
215 | <?php // Content is generated by content plugin event "onContentAfterDisplay" ?> | ||
216 | <?php echo $item->event->afterDisplayContent; ?> | ||
217 | </div> | ||
218 | <?php endforeach; ?> | ||
219 | </div> | ||
220 | <div class="pagination"> | ||
221 | <p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p> | ||
222 | <?php echo $this->pagination->getPagesLinks(); ?> | ||
223 | </div> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_conten_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 | /** | ||
13 | * HTML View class for the Content component | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentViewArchive extends JViewLegacy | ||
18 | { | ||
19 | protected $state = null; | ||
20 | |||
21 | protected $item = null; | ||
22 | |||
23 | protected $items = null; | ||
24 | |||
25 | protected $pagination = null; | ||
26 | |||
27 | /** | ||
28 | * Execute and display a template script. | ||
29 | * | ||
30 | * @param string $tpl The name of the template file to parse; automatically searches through the template paths. | ||
31 | * | ||
32 | * @return mixed A string if successful, otherwise an Error object. | ||
33 | */ | ||
34 | public function display($tpl = null) | ||
35 | { | ||
36 | $user = JFactory::getUser(); | ||
37 | $state = $this->get('State'); | ||
38 | $items = $this->get('Items'); | ||
39 | $pagination = $this->get('Pagination'); | ||
40 | |||
41 | // Flag indicates to not add limitstart=0 to URL | ||
42 | $pagination->hideEmptyLimitstart = true; | ||
43 | |||
44 | // Get the page/component configuration | ||
45 | $params = &$state->params; | ||
46 | |||
47 | JPluginHelper::importPlugin('content_custom'); | ||
48 | |||
49 | foreach ($items as $item) | ||
50 | { | ||
51 | $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; | ||
52 | $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; | ||
53 | |||
54 | // No link for ROOT category | ||
55 | if ($item->parent_alias === 'root') | ||
56 | { | ||
57 | $item->parent_slug = null; | ||
58 | } | ||
59 | |||
60 | $item->event = new stdClass; | ||
61 | |||
62 | $dispatcher = JEventDispatcher::getInstance(); | ||
63 | |||
64 | // Old plugins: Ensure that text property is available | ||
65 | if (!isset($item->text)) | ||
66 | { | ||
67 | $item->text = $item->introtext; | ||
68 | } | ||
69 | |||
70 | $dispatcher->trigger('onContentPrepare', array ('com_content_custom.archive', &$item, &$item->params, 0)); | ||
71 | |||
72 | // Old plugins: Use processed text as introtext | ||
73 | $item->introtext = $item->text; | ||
74 | |||
75 | $results = $dispatcher->trigger('onContentAfterTitle', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
76 | $item->event->afterDisplayTitle = trim(implode("\n", $results)); | ||
77 | |||
78 | $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
79 | $item->event->beforeDisplayContent = trim(implode("\n", $results)); | ||
80 | |||
81 | $results = $dispatcher->trigger('onContentAfterDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
82 | $item->event->afterDisplayContent = trim(implode("\n", $results)); | ||
83 | } | ||
84 | |||
85 | $this->filter = $state->get('list.filter'); | ||
86 | $this->items = &$items; | ||
87 | $this->params = &$params; | ||
88 | $this->user = &$user; | ||
89 | $this->pagination = &$pagination; | ||
90 | $this->pagination->setAdditionalUrlParam('month', $state->get('filter.month')); | ||
91 | $this->pagination->setAdditionalUrlParam('year', $state->get('filter.year')); | ||
92 | |||
93 | $this->_prepareDocument(); | ||
94 | |||
95 | parent::display($tpl); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Prepares the document | ||
100 | * | ||
101 | * @return void | ||
102 | */ | ||
103 | protected function _prepareDocument() | ||
104 | { | ||
105 | $app = JFactory::getApplication(); | ||
106 | $menus = $app->getMenu(); | ||
107 | $title = null; | ||
108 | |||
109 | // Because the application sets a default page title, | ||
110 | // we need to get it from the menu item itself | ||
111 | $menu = $menus->getActive(); | ||
112 | |||
113 | if ($menu) | ||
114 | { | ||
115 | $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | $this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES')); | ||
120 | } | ||
121 | |||
122 | $title = $this->params->get('page_title', ''); | ||
123 | |||
124 | if (empty($title)) | ||
125 | { | ||
126 | $title = $app->get('sitename'); | ||
127 | } | ||
128 | elseif ($app->get('sitename_pagetitles', 0) == 1) | ||
129 | { | ||
130 | $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); | ||
131 | } | ||
132 | elseif ($app->get('sitename_pagetitles', 0) == 2) | ||
133 | { | ||
134 | $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); | ||
135 | } | ||
136 | |||
137 | $this->document->setTitle($title); | ||
138 | |||
139 | if ($this->params->get('menu-meta_description')) | ||
140 | { | ||
141 | $this->document->setDescription($this->params->get('menu-meta_description')); | ||
142 | } | ||
143 | |||
144 | if ($this->params->get('menu-meta_keywords')) | ||
145 | { | ||
146 | $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); | ||
147 | } | ||
148 | |||
149 | if ($this->params->get('robots')) | ||
150 | { | ||
151 | $this->document->setMetadata('robots', $this->params->get('robots')); | ||
152 | } | ||
153 | } | ||
154 | } |
language/en-GB/en-GB.com_content_custom.ini
0 → 100644
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 | COM_CONTENT_CUSTOM_ARTICLE_HITS="Hits: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="Details" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="Category: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="Created: %s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="Last Updated: %s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="Month" | ||
12 | COM_CONTENT_CUSTOM_PARENT="Parent Category: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="Published: %s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="Written by %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="InformationArticles - Archived - custom" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="# of Months" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="The number of months to display (the default is 10)." | ||
9 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
10 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="InformationArticles - Archived - custom" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="Default" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
language/ja-JP/ja-JP.com_content_custom.ini
0 → 100644
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 | COM_CONTENT_CUSTOM_ARTICLE_HITS="参照数: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="詳細" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="カテゴリ: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="作成日:%s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="最終更新日:%s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="月" | ||
12 | COM_CONTENT_CUSTOM_PARENT="親カテゴリ: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="公開日:%s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="投稿者: %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="カスタムインフォメーションアーカイブ(モジュール)" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="表示月数" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="表示する月数(標準は10)です。" | ||
9 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
10 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="カスタムインフォメーションアーカイブ(モジュール)" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_information_articles_archive_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 | /** | ||
13 | * Helper for mod_information_articles_archive_custom | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ModArchiveHelper | ||
18 | { | ||
19 | /** | ||
20 | * Retrieve list of archived articles | ||
21 | * | ||
22 | * @param \Joomla\Registry\Registry &$params module parameters | ||
23 | * | ||
24 | * @return array | ||
25 | * | ||
26 | * @since 1.5 | ||
27 | */ | ||
28 | public static function getList(&$params) | ||
29 | { | ||
30 | // Get database | ||
31 | $db = JFactory::getDbo(); | ||
32 | $query = $db->getQuery(true); | ||
33 | $query->select($query->month($db->quoteName('created')) . ' AS created_month') | ||
34 | ->select('MIN(' . $db->quoteName('created') . ') AS created') | ||
35 | ->select($query->year($db->quoteName('created')) . ' AS created_year') | ||
36 | ->from('#__content') | ||
37 | ->where('state = 1') | ||
38 | ->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created'))) | ||
39 | ->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC'); | ||
40 | |||
41 | // Filter by language | ||
42 | if (JFactory::getApplication()->getLanguageFilter()) | ||
43 | { | ||
44 | $query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); | ||
45 | } | ||
46 | |||
47 | $db->setQuery($query, 0, (int) $params->get('count')); | ||
48 | |||
49 | try | ||
50 | { | ||
51 | $rows = (array) $db->loadObjectList(); | ||
52 | } | ||
53 | catch (RuntimeException $e) | ||
54 | { | ||
55 | JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); | ||
56 | |||
57 | return array(); | ||
58 | } | ||
59 | |||
60 | $app = JFactory::getApplication(); | ||
61 | $menu = $app->getMenu(); | ||
62 | $item = $menu->getItems('link', 'index.php?option=com_content_custom&view=archive', true); | ||
63 | $itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : ''; | ||
64 | |||
65 | $i = 0; | ||
66 | $lists = array(); | ||
67 | |||
68 | foreach ($rows as $row) | ||
69 | { | ||
70 | $date = JFactory::getDate($row->created); | ||
71 | |||
72 | $createdMonth = $date->format('n'); | ||
73 | $createdYear = $date->format('Y'); | ||
74 | |||
75 | $createdYearCal = JHtml::_('date', $row->created, 'Y') . "年"; | ||
76 | $monthNameCal = JHtml::_('date', $row->created, 'F'); | ||
77 | $createdDateCal = $createdYearCal . $monthNameCal; | ||
78 | |||
79 | $lists[$i] = new stdClass; | ||
80 | |||
81 | $link = JRoute::_('index.php?option=com_content_custom&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid); | ||
82 | // アーカイブコンポーネント以外でモジュールを表示した場合に以下の様にリンクを書き換える。 | ||
83 | $link = str_replace("/component/content_custom/", "/information/info-archive.html", $link); | ||
84 | |||
85 | $lists[$i]->link = $link; | ||
86 | $lists[$i]->text = JText::sprintf($createdDateCal); | ||
87 | |||
88 | $i++; | ||
89 | } | ||
90 | |||
91 | return $lists; | ||
92 | } | ||
93 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
modules/mod_information_articles_archive_custom/mod_information_articles_archive_custom.php
0 → 100644
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_archive | ||
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 archive functions only once | ||
13 | JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php'); | ||
14 | |||
15 | $params->def('count', 10); | ||
16 | $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); | ||
17 | $list = ModArchiveHelper::getList($params); | ||
18 | |||
19 | require JModuleHelper::getLayoutPath('mod_information_articles_archive_custom', $params->get('layout', 'default')); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
modules/mod_information_articles_archive_custom/mod_information_articles_archive_custom.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="module" version="3.1" client="site" method="upgrade"> | ||
3 | <name>MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>June 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION</description> | ||
12 | <files> | ||
13 | <filename module="mod_information_articles_archive_custom">mod_information_articles_archive_custom.php</filename> | ||
14 | <folder>tmpl</folder> | ||
15 | <filename>helper.php</filename> | ||
16 | </files> | ||
17 | <languages> | ||
18 | <language tag="en-GB">en-GB.mod_information_articles_archive_custom.ini</language> | ||
19 | <language tag="en-GB">en-GB.mod_information_articles_archive_custom.sys.ini</language> | ||
20 | <language tag="ja-JP">ja-JP.mod_information_articles_archive_custom.ini</language> | ||
21 | <language tag="ja-JP">ja-JP.mod_information_articles_archive_custom.sys.ini</language> | ||
22 | </languages> | ||
23 | <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" /> | ||
24 | <config> | ||
25 | <fields name="params"> | ||
26 | <fieldset name="basic"> | ||
27 | <field | ||
28 | name="count" | ||
29 | type="number" | ||
30 | label="MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL" | ||
31 | description="MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC" | ||
32 | default="120" | ||
33 | filter="integer" | ||
34 | /> | ||
35 | </fieldset> | ||
36 | |||
37 | <fieldset name="advanced"> | ||
38 | <field | ||
39 | name="layout" | ||
40 | type="modulelayout" | ||
41 | label="JFIELD_ALT_LAYOUT_LABEL" | ||
42 | description="JFIELD_ALT_MODULE_LAYOUT_DESC" | ||
43 | /> | ||
44 | |||
45 | <field | ||
46 | name="moduleclass_sfx" | ||
47 | type="textarea" | ||
48 | label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" | ||
49 | description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" | ||
50 | rows="3" | ||
51 | /> | ||
52 | |||
53 | <field | ||
54 | name="cache" | ||
55 | type="list" | ||
56 | label="COM_MODULES_FIELD_CACHING_LABEL" | ||
57 | description="COM_MODULES_FIELD_CACHING_DESC" | ||
58 | default="1" | ||
59 | filter="integer" | ||
60 | > | ||
61 | <option value="1">JGLOBAL_USE_GLOBAL</option> | ||
62 | <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> | ||
63 | </field> | ||
64 | |||
65 | <field | ||
66 | name="cache_time" | ||
67 | type="number" | ||
68 | label="COM_MODULES_FIELD_CACHE_TIME_LABEL" | ||
69 | description="COM_MODULES_FIELD_CACHE_TIME_DESC" | ||
70 | default="900" | ||
71 | filter="integer" | ||
72 | /> | ||
73 | |||
74 | <field | ||
75 | name="cachemode" | ||
76 | type="hidden" | ||
77 | default="static" | ||
78 | > | ||
79 | <option value="static"></option> | ||
80 | </field> | ||
81 | </fieldset> | ||
82 | </fields> | ||
83 | </config> | ||
84 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_information_articles_archive_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 | <?php if (!empty($list)) : ?> | ||
13 | <ul class="archive-module-custom<?php echo $moduleclass_sfx; ?> mod-list"> | ||
14 | <?php foreach ($list as $item) : ?> | ||
15 | <li> | ||
16 | <a href="<?php echo $item->link; ?>"> | ||
17 | <?php echo $item->text; ?> | ||
18 | </a> | ||
19 | </li> | ||
20 | <?php endforeach; ?> | ||
21 | </ul> | ||
22 | <?php endif; ?> |
src/com/com_content_custom/README.md
0 → 100644
1 | # インフォメーション用月次アーカイブモジュール | ||
2 | 公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。 | ||
3 | インストールしていない場合は、管理画面よりインストールする必要があります。 | ||
4 | |||
5 | ## このコンポーネントは、インフォメーションカテゴリーに属する記事専用の月次アーカイブモジュールです。 | ||
6 | インフォメーション(メニュー)の子メニューのサイドバーで表示した際に正しいリンクが生成される様に、83行目でリンクを修正する処理を追加しています | ||
7 | |||
8 | ### インフォメーションカテゴリー以外のカテゴリーに属する記事の月次アーカイブを作成したい場合は以下の手順が必要です。 | ||
9 | #### 手順2,3をせずにインストールしてしまうと、インストーラーが既存のモジュールを上書きしてしまい、サイトに不具合が発生する可能性があるので必ず実行してください。 | ||
10 | [Joomla公式のモジュール作成チュートリアルです。参考にしてください。](https://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module) | ||
11 | 1. mod_information_articles_archive_custom/をコピーし、src/mod配下におきます。 | ||
12 | 2. mod_information_articles_archive_customを含む配下のディレクトリ名とファイル名を、新規に月次モジュールを設置するカテゴリーに準じたものに変更します。例:mod_category_articles_archive_custom | ||
13 | 3. mod_information_articles_archive_custom.xmlで、インストーラーがインストールするディレクトリ名とファイル名を指定しているので、手順1で変更したディレクトリ名、ファイル名を指定する様に修正します。 | ||
14 | 4. en-GBから始まる二つのファイルと、ja-JPから始まる二つのファイルで、モジュール内で使用する定数を定義しているので、ファイルを編集し新規に月次モジュールを設置するカテゴリーに準じたものに変更します。 | ||
15 | 例:MOD_CATEGORY_ARTICLES_ARCHIVE_CUSTOM="カスタム(カテゴリー名)アーカイブ(モジュール)" | ||
16 | 5. 手順4で定数名を変更したので、それぞれの定数が呼び出されている箇所も、変更した定数名が呼び出される様に修正します。 | ||
17 | 6. README下部にあるインストール手順にしたがってインストールをします。 | ||
18 | |||
19 | ## インストール手順 | ||
20 | 1. 管理画面ログイン | ||
21 | 2. エクステンション配下の管理を選択 | ||
22 | 3. (フォルダからインストール)を選択 | ||
23 | 4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge) | ||
24 | 5. チェックしてインストール | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/com/com_content_custom/admin/index.html
0 → 100644
File mode changed
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 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="Options" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="Position of Article Info" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="Puts the article information block above or below the text or splits it into two separate blocks, one above and the other below." | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="Use Article Settings" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" |
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 | COM_CONTENT_CUSTOM="archive_custom_component" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="It is a component that narrows down articles posted in the past by category and displays a monthly archive." | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ 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 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL="オプション" | ||
8 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL="記事情報の位置" | ||
9 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
10 | COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC="記事情報のブロックをテキストの上か下に追加します。または1つは上、その他は下へ2つのブロックに分けます。" | ||
11 | COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS="記事設定の使用" | ||
12 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
13 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
14 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
15 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
16 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ 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 | COM_CONTENT_CUSTOM="カスタムアーカイブ(コンポーネント)" | ||
7 | COM_CONTENT_CUSTOM_XML_DESCRIPTION="過去に投稿された記事をカテゴリー別に絞り込み、月間アーカイブを表示するコンポーネントです。" | ||
8 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
9 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
10 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
11 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
12 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
File mode changed
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="component" version="3.0" method="upgrade"> | ||
3 | <name>COM_CONTENT_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>July 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>COM_CONTENT_CUSTOM_XML_DESCRIPTION</description> | ||
12 | |||
13 | <update> | ||
14 | <schemas> | ||
15 | <schemapath type="mysql">sql/updates/mysql</schemapath> | ||
16 | </schemas> | ||
17 | </update> | ||
18 | |||
19 | <files folder="site"> | ||
20 | <filename>index.html</filename> | ||
21 | <filename>content_custom.php</filename> | ||
22 | <filename>controller.php</filename> | ||
23 | <folder>views</folder> | ||
24 | <folder>helpers</folder> | ||
25 | <folder>models</folder> | ||
26 | </files> | ||
27 | <languages folder="site"> | ||
28 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
29 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
30 | </languages> | ||
31 | <administration> | ||
32 | <menu link='index.php?option=com_content_custom'>カスタムアーカイブ</menu> | ||
33 | <files folder="admin"> | ||
34 | <filename>index.html</filename> | ||
35 | <filename>content_custom.php</filename> | ||
36 | <folder>sql</folder> | ||
37 | </files> | ||
38 | <languages folder="admin"> | ||
39 | <language tag="en-GB">language/en-GB.com_content_custom.ini</language> | ||
40 | <language tag="ja-JP">language/ja-JP.com_content_custom.ini</language> | ||
41 | <language tag="en-GB">language/en-GB.com_content_custom.sys.ini</language> | ||
42 | <language tag="ja-JP">language/ja-JP.com_content_custom.sys.ini</language> | ||
43 | </languages> | ||
44 | </administration> | ||
45 | |||
46 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JLoader::register('ContentCustomHelperRoute', JPATH_SITE . '/components/com_content_custom/helpers/route.php'); | ||
13 | JLoader::register('ContentCustomHelperQuery', JPATH_SITE . '/components/com_content_custom/helpers/query.php'); | ||
14 | |||
15 | $input = JFactory::getApplication()->input; | ||
16 | $user = JFactory::getUser(); | ||
17 | |||
18 | $controller = JControllerLegacy::getInstance('Content'); | ||
19 | |||
20 | $controller->execute(JFactory::getApplication()->input->get('task')); | ||
21 | $controller->redirect(); |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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\CMS\Component\ComponentHelper; | ||
13 | |||
14 | /** | ||
15 | * Content Component Controller | ||
16 | * | ||
17 | * @since 1.5 | ||
18 | */ | ||
19 | class ContentController extends JControllerLegacy | ||
20 | { | ||
21 | /** | ||
22 | * Constructor. | ||
23 | * | ||
24 | * @param array $config An optional associative array of configuration settings. | ||
25 | * Recognized key values include 'name', 'default_task', 'model_path', and | ||
26 | * 'view_path' (this list is not meant to be comprehensive). | ||
27 | * | ||
28 | * @since 3.0.1 | ||
29 | */ | ||
30 | public function __construct($config = array()) | ||
31 | { | ||
32 | $this->input = JFactory::getApplication()->input; | ||
33 | |||
34 | // Article frontpage Editor pagebreak proxying: | ||
35 | if ($this->input->get('view') === 'article' && $this->input->get('layout') === 'pagebreak') | ||
36 | { | ||
37 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
38 | } | ||
39 | // Article frontpage Editor article proxying: | ||
40 | elseif ($this->input->get('view') === 'articles' && $this->input->get('layout') === 'modal') | ||
41 | { | ||
42 | JHtml::_('stylesheet', 'system/adminlist.css', array('version' => 'auto', 'relative' => true)); | ||
43 | $config['base_path'] = JPATH_COMPONENT_ADMINISTRATOR; | ||
44 | } | ||
45 | |||
46 | parent::__construct($config); | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * Method to display a view. | ||
51 | * | ||
52 | * @param boolean $cachable If true, the view output will be cached. | ||
53 | * @param boolean $urlparams An array of safe URL parameters and their variable types, for valid values see {@link JFilterInput::clean()}. | ||
54 | * | ||
55 | * @return JController This object to support chaining. | ||
56 | * | ||
57 | * @since 1.5 | ||
58 | */ | ||
59 | public function display($cachable = false, $urlparams = false) | ||
60 | { | ||
61 | $cachable = true; | ||
62 | |||
63 | /** | ||
64 | * Set the default view name and format from the Request. | ||
65 | * Note we are using a_id to avoid collisions with the router and the return page. | ||
66 | * Frontend is a bit messier than the backend. | ||
67 | */ | ||
68 | $id = $this->input->getInt('a_id'); | ||
69 | $vName = $this->input->getCmd('view', 'categories'); | ||
70 | $this->input->set('view', $vName); | ||
71 | $user = JFactory::getUser(); | ||
72 | |||
73 | if ($user->get('id') | ||
74 | || ($this->input->getMethod() === 'POST' | ||
75 | && (($vName === 'category' && $this->input->get('layout') !== 'blog') || $vName === 'archive' ))) | ||
76 | { | ||
77 | $cachable = false; | ||
78 | } | ||
79 | |||
80 | $safeurlparams = array( | ||
81 | 'catid' => 'INT', | ||
82 | 'id' => 'INT', | ||
83 | 'cid' => 'ARRAY', | ||
84 | 'year' => 'INT', | ||
85 | 'month' => 'INT', | ||
86 | 'limit' => 'UINT', | ||
87 | 'limitstart' => 'UINT', | ||
88 | 'showall' => 'INT', | ||
89 | 'return' => 'BASE64', | ||
90 | 'filter' => 'STRING', | ||
91 | 'filter_order' => 'CMD', | ||
92 | 'filter_order_Dir' => 'CMD', | ||
93 | 'filter-search' => 'STRING', | ||
94 | 'print' => 'BOOLEAN', | ||
95 | 'lang' => 'CMD', | ||
96 | 'Itemid' => 'INT'); | ||
97 | |||
98 | parent::display($cachable, $safeurlparams); | ||
99 | |||
100 | return $this; | ||
101 | } | ||
102 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | /** | ||
13 | * Content Component Query Helper | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentCustomHelperQuery | ||
18 | { | ||
19 | /** | ||
20 | * Translate an order code to a field for secondary category ordering. | ||
21 | * | ||
22 | * @param string $orderby The ordering code. | ||
23 | * @param string $orderDate The ordering code for the date. | ||
24 | * | ||
25 | * @return string The SQL field(s) to order by. | ||
26 | * | ||
27 | * @since 1.5 | ||
28 | */ | ||
29 | public static function orderbySecondary($orderby, $orderDate = 'created') | ||
30 | { | ||
31 | $queryDate = self::getQueryDate($orderDate); | ||
32 | |||
33 | switch ($orderby) | ||
34 | { | ||
35 | case 'date' : | ||
36 | $orderby = $queryDate; | ||
37 | break; | ||
38 | |||
39 | case 'rdate' : | ||
40 | $orderby = $queryDate . ' DESC '; | ||
41 | break; | ||
42 | |||
43 | case 'alpha' : | ||
44 | $orderby = 'a.title'; | ||
45 | break; | ||
46 | |||
47 | case 'ralpha' : | ||
48 | $orderby = 'a.title DESC'; | ||
49 | break; | ||
50 | |||
51 | case 'hits' : | ||
52 | $orderby = 'a.hits DESC'; | ||
53 | break; | ||
54 | |||
55 | case 'rhits' : | ||
56 | $orderby = 'a.hits'; | ||
57 | break; | ||
58 | |||
59 | case 'order' : | ||
60 | $orderby = 'a.ordering'; | ||
61 | break; | ||
62 | |||
63 | case 'rorder' : | ||
64 | $orderby = 'a.ordering DESC'; | ||
65 | break; | ||
66 | |||
67 | case 'author' : | ||
68 | $orderby = 'author'; | ||
69 | break; | ||
70 | |||
71 | case 'rauthor' : | ||
72 | $orderby = 'author DESC'; | ||
73 | break; | ||
74 | |||
75 | case 'front' : | ||
76 | $orderby = 'a.featured DESC, fp.ordering, ' . $queryDate . ' DESC '; | ||
77 | break; | ||
78 | |||
79 | case 'random' : | ||
80 | $orderby = JFactory::getDbo()->getQuery(true)->Rand(); | ||
81 | break; | ||
82 | |||
83 | case 'vote' : | ||
84 | $orderby = 'a.id DESC '; | ||
85 | |||
86 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
87 | { | ||
88 | $orderby = 'rating_count DESC '; | ||
89 | } | ||
90 | break; | ||
91 | |||
92 | case 'rvote' : | ||
93 | $orderby = 'a.id ASC '; | ||
94 | |||
95 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
96 | { | ||
97 | $orderby = 'rating_count ASC '; | ||
98 | } | ||
99 | break; | ||
100 | |||
101 | case 'rank' : | ||
102 | $orderby = 'a.id DESC '; | ||
103 | |||
104 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
105 | { | ||
106 | $orderby = 'rating DESC '; | ||
107 | } | ||
108 | break; | ||
109 | |||
110 | case 'rrank' : | ||
111 | $orderby = 'a.id ASC '; | ||
112 | |||
113 | if (JPluginHelper::isEnabled('content', 'vote')) | ||
114 | { | ||
115 | $orderby = 'rating ASC '; | ||
116 | } | ||
117 | break; | ||
118 | |||
119 | default : | ||
120 | $orderby = 'a.ordering'; | ||
121 | break; | ||
122 | } | ||
123 | |||
124 | return $orderby; | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * Translate an order code to a field for primary category ordering. | ||
129 | * | ||
130 | * @param string $orderDate The ordering code. | ||
131 | * | ||
132 | * @return string The SQL field(s) to order by. | ||
133 | * | ||
134 | * @since 1.6 | ||
135 | */ | ||
136 | public static function getQueryDate($orderDate) | ||
137 | { | ||
138 | $db = JFactory::getDbo(); | ||
139 | |||
140 | switch ($orderDate) | ||
141 | { | ||
142 | case 'modified' : | ||
143 | $queryDate = ' CASE WHEN a.modified = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.modified END'; | ||
144 | break; | ||
145 | |||
146 | // Use created if publish_up is not set | ||
147 | case 'published' : | ||
148 | $queryDate = ' CASE WHEN a.publish_up = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_up END '; | ||
149 | break; | ||
150 | |||
151 | case 'unpublished' : | ||
152 | $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END '; | ||
153 | break; | ||
154 | case 'created' : | ||
155 | default : | ||
156 | $queryDate = ' a.created '; | ||
157 | break; | ||
158 | } | ||
159 | |||
160 | return $queryDate; | ||
161 | } | ||
162 | |||
163 | } |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | /** | ||
13 | * Content Component Route Helper. | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | abstract class ContentCustomHelperRoute | ||
18 | { | ||
19 | /** | ||
20 | * Get the article route. | ||
21 | * | ||
22 | * @param integer $id The route of the content item. | ||
23 | * @param integer $catid The category ID. | ||
24 | * @param integer $language The language code. | ||
25 | * @param string $layout The layout value. | ||
26 | * | ||
27 | * @return string The article route. | ||
28 | * | ||
29 | * @since 1.5 | ||
30 | */ | ||
31 | public static function getArticleRoute($id, $catid = 0, $language = 0, $layout = null) | ||
32 | { | ||
33 | // Create the link | ||
34 | $link = 'index.php?option=com_content&view=article&id=' . $id; | ||
35 | |||
36 | if ((int) $catid > 1) | ||
37 | { | ||
38 | $link .= '&catid=' . $catid; | ||
39 | } | ||
40 | |||
41 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
42 | { | ||
43 | $link .= '&lang=' . $language; | ||
44 | } | ||
45 | |||
46 | if ($layout) | ||
47 | { | ||
48 | $link .= '&layout=' . $layout; | ||
49 | } | ||
50 | |||
51 | return $link; | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * Get the category route. | ||
56 | * | ||
57 | * @param integer $catid The category ID. | ||
58 | * @param integer $language The language code. | ||
59 | * @param string $layout The layout value. | ||
60 | * | ||
61 | * @return string The article route. | ||
62 | * | ||
63 | * @since 1.5 | ||
64 | */ | ||
65 | public static function getCategoryRoute($catid, $language = 0, $layout = null) | ||
66 | { | ||
67 | if ($catid instanceof JCategoryNode) | ||
68 | { | ||
69 | $id = $catid->id; | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | $id = (int) $catid; | ||
74 | } | ||
75 | |||
76 | if ($id < 1) | ||
77 | { | ||
78 | return ''; | ||
79 | } | ||
80 | |||
81 | $link = 'index.php?option=com_content&view=category&id=' . $id; | ||
82 | |||
83 | if ($language && $language !== '*' && JLanguageMultilang::isEnabled()) | ||
84 | { | ||
85 | $link .= '&lang=' . $language; | ||
86 | } | ||
87 | |||
88 | if ($layout) | ||
89 | { | ||
90 | $link .= '&layout=' . $layout; | ||
91 | } | ||
92 | |||
93 | return $link; | ||
94 | } | ||
95 | |||
96 | } |
src/com/com_content_custom/site/index.html
0 → 100644
File mode changed
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 | COM_CONTENT_CUSTOM_ARTICLE_HITS="Hits: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="Details" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="Category: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="Created: %s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="Last Updated: %s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="Month" | ||
12 | COM_CONTENT_CUSTOM_PARENT="Parent Category: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="Published: %s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="Written by %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="Above" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="Below" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="Split" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="Archived Articles" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="Default" | ||
... | \ 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 | COM_CONTENT_CUSTOM_ARTICLE_HITS="参照数: %s" | ||
7 | COM_CONTENT_CUSTOM_ARTICLE_INFO="詳細" | ||
8 | COM_CONTENT_CUSTOM_CATEGORY="カテゴリ: %s" | ||
9 | COM_CONTENT_CUSTOM_CREATED_DATE_ON="作成日:%s" | ||
10 | COM_CONTENT_CUSTOM_LAST_UPDATED="最終更新日:%s" | ||
11 | COM_CONTENT_CUSTOM_MONTH="月" | ||
12 | COM_CONTENT_CUSTOM_PARENT="親カテゴリ: %s" | ||
13 | COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON="公開日:%s" | ||
14 | COM_CONTENT_CUSTOM_WRITTEN_BY="投稿者: %s" | ||
15 | COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE="上" | ||
16 | COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW="下" | ||
17 | COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT="分割" | ||
18 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE="アーカイブ記事" | ||
19 | COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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\Utilities\ArrayHelper; | ||
13 | |||
14 | JLoader::register('ContentModelArticles', __DIR__ . '/articles.php'); | ||
15 | |||
16 | /** | ||
17 | * Content Component Archive Model | ||
18 | * | ||
19 | * @since 1.5 | ||
20 | */ | ||
21 | class ContentModelArchive extends ContentModelArticles | ||
22 | { | ||
23 | /** | ||
24 | * Model context string. | ||
25 | * | ||
26 | * @var string | ||
27 | */ | ||
28 | public $_context = 'com_content_custom.archive'; | ||
29 | |||
30 | /** | ||
31 | * Method to auto-populate the model state. | ||
32 | * | ||
33 | * Note. Calling getState in this method will result in recursion. | ||
34 | * | ||
35 | * @param string $ordering The field to order on. | ||
36 | * @param string $direction The direction to order on. | ||
37 | * | ||
38 | * @return void | ||
39 | * | ||
40 | * @since 1.6 | ||
41 | */ | ||
42 | protected function populateState($ordering = null, $direction = null) | ||
43 | { | ||
44 | parent::populateState(); | ||
45 | |||
46 | $app = JFactory::getApplication(); | ||
47 | |||
48 | // Add archive properties | ||
49 | $params = $this->state->params; | ||
50 | |||
51 | // Filter on archived articles | ||
52 | $this->setState('filter.published', 1); | ||
53 | |||
54 | // Filter on month, year | ||
55 | $this->setState('filter.month', $app->input->getInt('month')); | ||
56 | $this->setState('filter.year', $app->input->getInt('year')); | ||
57 | |||
58 | // Optional filter text | ||
59 | $this->setState('list.filter', $app->input->getString('filter-search')); | ||
60 | |||
61 | // Get list limit | ||
62 | $itemid = $app->input->get('Itemid', 0, 'int'); | ||
63 | $limit = $app->getUserStateFromRequest('com_content_custom.archive.list' . $itemid . '.limit', 'limit', $params->get('display_num'), 'uint'); | ||
64 | $this->setState('list.limit', $limit); | ||
65 | |||
66 | // Set the archive ordering | ||
67 | $articleOrderby = $params->get('orderby_sec', 'rdate'); | ||
68 | $articleOrderDate = $params->get('order_date'); | ||
69 | |||
70 | // No category ordering | ||
71 | $secondary = ContentCustomHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate); | ||
72 | |||
73 | $this->setState('list.ordering', $secondary . ', a.created DESC'); | ||
74 | $this->setState('list.direction', ''); | ||
75 | } | ||
76 | |||
77 | /** | ||
78 | * Get the master query for retrieving a list of articles subject to the model state. | ||
79 | * | ||
80 | * @return JDatabaseQuery | ||
81 | * | ||
82 | * @since 1.6 | ||
83 | */ | ||
84 | protected function getListQuery() | ||
85 | { | ||
86 | $params = $this->state->params; | ||
87 | $app = JFactory::getApplication('site'); | ||
88 | $catids = ArrayHelper::toInteger($app->input->get('catid', array(), 'array')); | ||
89 | $catids = array_values(array_diff($catids, array(0))); | ||
90 | $articleOrderDate = $params->get('order_date'); | ||
91 | |||
92 | // Create a new query object. | ||
93 | $query = parent::getListQuery(); | ||
94 | |||
95 | // Add routing for archive | ||
96 | // Sqlsrv changes | ||
97 | $case_when = ' CASE WHEN '; | ||
98 | $case_when .= $query->charLength('a.alias', '!=', '0'); | ||
99 | $case_when .= ' THEN '; | ||
100 | $a_id = $query->castAsChar('a.id'); | ||
101 | $case_when .= $query->concatenate(array($a_id, 'a.alias'), ':'); | ||
102 | $case_when .= ' ELSE '; | ||
103 | $case_when .= $a_id . ' END as slug'; | ||
104 | |||
105 | $query->select($case_when); | ||
106 | |||
107 | $case_when = ' CASE WHEN '; | ||
108 | $case_when .= $query->charLength('c.alias', '!=', '0'); | ||
109 | $case_when .= ' THEN '; | ||
110 | $c_id = $query->castAsChar('c.id'); | ||
111 | $case_when .= $query->concatenate(array($c_id, 'c.alias'), ':'); | ||
112 | $case_when .= ' ELSE '; | ||
113 | $case_when .= $c_id . ' END as catslug'; | ||
114 | $query->select($case_when); | ||
115 | |||
116 | // Filter on month, year | ||
117 | // First, get the date field | ||
118 | $queryDate = ContentCustomHelperQuery::getQueryDate($articleOrderDate); | ||
119 | |||
120 | if ($month = $this->getState('filter.month')) | ||
121 | { | ||
122 | $query->where($query->month($queryDate) . ' = ' . $month); | ||
123 | } | ||
124 | |||
125 | if ($year = $this->getState('filter.year')) | ||
126 | { | ||
127 | $query->where($query->year($queryDate) . ' = ' . $year); | ||
128 | } | ||
129 | |||
130 | if (count($catids) > 0) | ||
131 | { | ||
132 | $query->where('c.id IN (' . implode(', ', $catids) . ')'); | ||
133 | } | ||
134 | |||
135 | return $query; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * Method to get the archived article list | ||
140 | * | ||
141 | * @access public | ||
142 | * @return array | ||
143 | */ | ||
144 | public function getData() | ||
145 | { | ||
146 | $app = JFactory::getApplication(); | ||
147 | |||
148 | // Lets load the content if it doesn't already exist | ||
149 | if (empty($this->_data)) | ||
150 | { | ||
151 | // Get the page/component configuration | ||
152 | $params = $app->getParams(); | ||
153 | |||
154 | // Get the pagination request variables | ||
155 | $limit = $app->input->get('limit', $params->get('display_num', 20), 'uint'); | ||
156 | $limitstart = $app->input->get('limitstart', 0, 'uint'); | ||
157 | |||
158 | $query = $this->_buildQuery(); | ||
159 | |||
160 | $this->_data = $this->_getList($query, $limitstart, $limit); | ||
161 | } | ||
162 | |||
163 | return $this->_data; | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * JModelLegacy override to add alternating value for $odd | ||
168 | * | ||
169 | * @param string $query The query. | ||
170 | * @param integer $limitstart Offset. | ||
171 | * @param integer $limit The number of records. | ||
172 | * | ||
173 | * @return array An array of results. | ||
174 | * | ||
175 | * @since 3.0.1 | ||
176 | * @throws RuntimeException | ||
177 | */ | ||
178 | protected function _getList($query, $limitstart=0, $limit=0) | ||
179 | { | ||
180 | $result = parent::_getList($query, $limitstart, $limit); | ||
181 | |||
182 | $odd = 1; | ||
183 | |||
184 | foreach ($result as $k => $row) | ||
185 | { | ||
186 | $result[$k]->odd = $odd; | ||
187 | $odd = 1 - $odd; | ||
188 | } | ||
189 | |||
190 | return $result; | ||
191 | } | ||
192 | } |
This diff is collapsed.
Click to expand it.
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | JHtml::_('formbehavior.chosen', 'select'); | ||
14 | JHtml::_('behavior.caption'); | ||
15 | ?> | ||
16 | <div class="archive-custom<?php echo $this->pageclass_sfx; ?>"> | ||
17 | <?php if ($this->params->get('show_page_heading')) : ?> | ||
18 | <div class="page-header"> | ||
19 | <h1> | ||
20 | <?php echo $this->escape($this->params->get('page_heading')); ?> | ||
21 | </h1> | ||
22 | </div> | ||
23 | <?php endif; ?> | ||
24 | <?php echo $this->loadTemplate('items'); ?> | ||
25 | </div> |
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <metadata> | ||
3 | <layout title="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_TITLE" option="COM_CONTENT_CUSTOM_ARCHIVE_VIEW_DEFAULT_OPTION"> | ||
4 | <help | ||
5 | key = "JHELP_MENUS_MENU_ITEM_ARTICLE_ARCHIVED" | ||
6 | /> | ||
7 | <message> | ||
8 | <![CDATA[COM_CONTENT_CUSTOM_XML_DESCRIPTION]]> | ||
9 | </message> | ||
10 | </layout> | ||
11 | |||
12 | <!-- Add fields to the request variables for the layout. --> | ||
13 | <fields name="request"> | ||
14 | <fieldset name="request" | ||
15 | addfieldpath="/administrator/components/com_categories/models/fields" | ||
16 | > | ||
17 | <field | ||
18 | name="catid" | ||
19 | type="category" | ||
20 | extension="com_content" | ||
21 | multiple="true" | ||
22 | size="5" | ||
23 | label="JCATEGORY" | ||
24 | description="JFIELD_CATEGORY_DESC" | ||
25 | > | ||
26 | <option value="">JOPTION_ALL_CATEGORIES</option> | ||
27 | </field> | ||
28 | </fieldset> | ||
29 | </fields> | ||
30 | |||
31 | <!-- Add fields to the parameters object for the layout. --> | ||
32 | <fields name="params"> | ||
33 | |||
34 | <!-- Basic options. --> | ||
35 | <fieldset name="basic" label="JGLOBAL_ARCHIVE_OPTIONS" | ||
36 | > | ||
37 | |||
38 | <field | ||
39 | name="orderby_sec" | ||
40 | type="list" | ||
41 | label="JGLOBAL_ARTICLE_ORDER_LABEL" | ||
42 | description="JGLOBAL_ARTICLE_ORDER_DESC" | ||
43 | default="rdate" | ||
44 | > | ||
45 | <option value="date">JGLOBAL_OLDEST_FIRST</option> | ||
46 | <option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option> | ||
47 | <option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option> | ||
48 | <option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option> | ||
49 | <option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option> | ||
50 | <option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option> | ||
51 | <option value="hits">JGLOBAL_MOST_HITS</option> | ||
52 | <option value="rhits">JGLOBAL_LEAST_HITS</option> | ||
53 | <option value="order">JGLOBAL_ARTICLE_MANAGER_ORDER</option> | ||
54 | <option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option> | ||
55 | <option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option> | ||
56 | <option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option> | ||
57 | <option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option> | ||
58 | </field> | ||
59 | |||
60 | <field | ||
61 | name="order_date" | ||
62 | type="list" | ||
63 | label="JGLOBAL_ORDERING_DATE_LABEL" | ||
64 | description="JGLOBAL_ORDERING_DATE_DESC" | ||
65 | default="published" | ||
66 | > | ||
67 | <option value="created">JGLOBAL_Created</option> | ||
68 | <option value="modified">JGLOBAL_Modified</option> | ||
69 | <option value="published">JPUBLISHED</option> | ||
70 | </field> | ||
71 | |||
72 | <field | ||
73 | name="display_num" | ||
74 | type="list" | ||
75 | label="JGLOBAL_NUMBER_ITEMS_LIST_LABEL" | ||
76 | description="JGLOBAL_NUMBER_ITEMS_LIST_DESC" | ||
77 | default="5" | ||
78 | > | ||
79 | <option value="5">J5</option> | ||
80 | <option value="10">J10</option> | ||
81 | <option value="15">J15</option> | ||
82 | <option value="20">J20</option> | ||
83 | <option value="25">J25</option> | ||
84 | <option value="30">J30</option> | ||
85 | <option value="50">J50</option> | ||
86 | <option value="100">J100</option> | ||
87 | <option value="0">JALL</option> | ||
88 | </field> | ||
89 | |||
90 | <field | ||
91 | name="filter_field" | ||
92 | type="list" | ||
93 | label="JGLOBAL_FILTER_FIELD_LABEL" | ||
94 | description="JGLOBAL_FILTER_FIELD_DESC" | ||
95 | default="" | ||
96 | useglobal="true" | ||
97 | > | ||
98 | <option value="hide">JHIDE</option> | ||
99 | <option value="1">JSHOW</option> | ||
100 | </field> | ||
101 | |||
102 | <field | ||
103 | name="introtext_limit" | ||
104 | type="number" | ||
105 | label="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_LABEL" | ||
106 | description="JGLOBAL_ARCHIVE_ARTICLES_FIELD_INTROTEXTLIMIT_DESC" | ||
107 | default="1000" | ||
108 | /> | ||
109 | |||
110 | </fieldset> | ||
111 | |||
112 | <!-- Articles options. --> | ||
113 | <fieldset name="articles" | ||
114 | label="COM_CONTENT_CUSTOM_ATTRIBS_ARTICLE_SETTINGS_LABEL" | ||
115 | > | ||
116 | |||
117 | <field | ||
118 | name="show_intro" | ||
119 | type="list" | ||
120 | label="JGLOBAL_SHOW_INTRO_LABEL" | ||
121 | description="JGLOBAL_SHOW_INTRO_DESC" | ||
122 | class="chzn-color" | ||
123 | default="1" | ||
124 | > | ||
125 | <option value="0">JHIDE</option> | ||
126 | <option value="1">JSHOW</option> | ||
127 | </field> | ||
128 | |||
129 | <field | ||
130 | name="info_block_position" | ||
131 | type="list" | ||
132 | label="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_LABEL" | ||
133 | description="COM_CONTENT_CUSTOM_FIELD_INFOBLOCK_POSITION_DESC" | ||
134 | default="" | ||
135 | useglobal="true" | ||
136 | class="chzn-color" | ||
137 | > | ||
138 | <option value="use_article">COM_CONTENT_CUSTOM_FIELD_VALUE_USE_ARTICLE_SETTINGS</option> | ||
139 | <option value="0">COM_CONTENT_CUSTOM_FIELD_OPTION_ABOVE</option> | ||
140 | <option value="1">COM_CONTENT_CUSTOM_FIELD_OPTION_BELOW</option> | ||
141 | <option value="2">COM_CONTENT_CUSTOM_FIELD_OPTION_SPLIT</option> | ||
142 | </field> | ||
143 | |||
144 | <field | ||
145 | name="show_category" | ||
146 | type="list" | ||
147 | label="JGLOBAL_SHOW_CATEGORY_LABEL" | ||
148 | description="JGLOBAL_SHOW_CATEGORY_DESC" | ||
149 | useglobal="true" | ||
150 | class="chzn-color" | ||
151 | > | ||
152 | <option value="0">JHIDE</option> | ||
153 | <option value="1">JSHOW</option> | ||
154 | </field> | ||
155 | |||
156 | <field | ||
157 | name="link_category" | ||
158 | type="list" | ||
159 | label="JGLOBAL_LINK_CATEGORY_LABEL" | ||
160 | description="JGLOBAL_LINK_CATEGORY_DESC" | ||
161 | useglobal="true" | ||
162 | class="chzn-color" | ||
163 | > | ||
164 | <option value="0">JNO</option> | ||
165 | <option value="1">JYES</option> | ||
166 | </field> | ||
167 | |||
168 | <field | ||
169 | name="show_parent_category" | ||
170 | type="list" | ||
171 | label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL" | ||
172 | description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC" | ||
173 | useglobal="true" | ||
174 | > | ||
175 | <option value="0">JHIDE</option> | ||
176 | <option value="1">JSHOW</option> | ||
177 | </field> | ||
178 | |||
179 | <field | ||
180 | name="link_parent_category" | ||
181 | type="list" | ||
182 | label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL" | ||
183 | description="JGLOBAL_LINK_PARENT_CATEGORY_DESC" | ||
184 | useglobal="true" | ||
185 | > | ||
186 | <option value="0">JNO</option> | ||
187 | <option value="1">JYES</option> | ||
188 | </field> | ||
189 | |||
190 | <field | ||
191 | name="link_titles" | ||
192 | type="list" | ||
193 | label="JGLOBAL_LINKED_TITLES_LABEL" | ||
194 | description="JGLOBAL_LINKED_TITLES_DESC" | ||
195 | class="chzn-color" | ||
196 | default="1" | ||
197 | > | ||
198 | <option value="0">JNO</option> | ||
199 | <option value="1">JYES</option> | ||
200 | </field> | ||
201 | |||
202 | <field | ||
203 | name="show_author" | ||
204 | type="list" | ||
205 | label="JGLOBAL_SHOW_AUTHOR_LABEL" | ||
206 | description="JGLOBAL_SHOW_AUTHOR_DESC" | ||
207 | useglobal="true" | ||
208 | class="chzn-color" | ||
209 | > | ||
210 | <option value="0">JHIDE</option> | ||
211 | <option value="1">JSHOW</option> | ||
212 | </field> | ||
213 | |||
214 | <field | ||
215 | name="link_author" | ||
216 | type="list" | ||
217 | label="JGLOBAL_LINK_AUTHOR_LABEL" | ||
218 | description="JGLOBAL_LINK_AUTHOR_DESC" | ||
219 | useglobal="true" | ||
220 | > | ||
221 | <option value="0">JNO</option> | ||
222 | <option value="1">JYES</option> | ||
223 | </field> | ||
224 | |||
225 | <field | ||
226 | name="show_create_date" | ||
227 | type="list" | ||
228 | label="JGLOBAL_SHOW_CREATE_DATE_LABEL" | ||
229 | description="JGLOBAL_SHOW_CREATE_DATE_DESC" | ||
230 | useglobal="true" | ||
231 | class="chzn-color" | ||
232 | > | ||
233 | <option value="0">JHIDE</option> | ||
234 | <option value="1">JSHOW</option> | ||
235 | </field> | ||
236 | |||
237 | <field | ||
238 | name="show_modify_date" | ||
239 | type="list" | ||
240 | label="JGLOBAL_SHOW_MODIFY_DATE_LABEL" | ||
241 | description="JGLOBAL_SHOW_MODIFY_DATE_DESC" | ||
242 | useglobal="true" | ||
243 | class="chzn-color" | ||
244 | > | ||
245 | <option value="0">JHIDE</option> | ||
246 | <option value="1">JSHOW</option> | ||
247 | </field> | ||
248 | |||
249 | <field | ||
250 | name="show_publish_date" | ||
251 | type="list" | ||
252 | label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL" | ||
253 | description="JGLOBAL_SHOW_PUBLISH_DATE_DESC" | ||
254 | class="chzn-color" | ||
255 | default="1" | ||
256 | > | ||
257 | <option value="0">JHIDE</option> | ||
258 | <option value="1">JSHOW</option> | ||
259 | </field> | ||
260 | |||
261 | <field | ||
262 | name="show_hits" | ||
263 | type="list" | ||
264 | label="JGLOBAL_SHOW_HITS_LABEL" | ||
265 | description="JGLOBAL_SHOW_HITS_DESC" | ||
266 | useglobal="true" | ||
267 | class="chzn-color" | ||
268 | > | ||
269 | <option value="0">JHIDE</option> | ||
270 | <option value="1">JSHOW</option> | ||
271 | </field> | ||
272 | </fieldset> | ||
273 | |||
274 | </fields> | ||
275 | </metadata> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_content_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 | JHtml::addIncludePath(JPATH_COMPONENT . '/helpers'); | ||
13 | $params = $this->params; | ||
14 | ?> | ||
15 | |||
16 | <div id="archive-items"> | ||
17 | <?php foreach ($this->items as $i => $item) : ?> | ||
18 | <?php $info = $item->params->get('info_block_position', 0); ?> | ||
19 | <div class="row<?php echo $i % 2; ?>" itemscope itemtype="https://schema.org/Article"> | ||
20 | <div class="page-header"> | ||
21 | <h2 itemprop="headline"> | ||
22 | <?php if ($params->get('link_titles')) : ?> | ||
23 | <?php | ||
24 | $url = JRoute::_(ContentCustomHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); | ||
25 | $url = "information/" . end(explode("/", $url)); | ||
26 | ?> | ||
27 | <a href="<?php echo $url; ?>" itemprop="url"> | ||
28 | <?php echo $this->escape($item->title); ?> | ||
29 | </a> | ||
30 | <?php else : ?> | ||
31 | <?php echo $this->escape($item->title); ?> | ||
32 | <?php endif; ?> | ||
33 | </h2> | ||
34 | |||
35 | <?php // Content is generated by content plugin event "onContentAfterTitle" ?> | ||
36 | <?php echo $item->event->afterDisplayTitle; ?> | ||
37 | |||
38 | <?php if ($params->get('show_author') && !empty($item->author )) : ?> | ||
39 | <div class="createdby" itemprop="author" itemscope itemtype="https://schema.org/Person"> | ||
40 | <?php $author = $item->created_by_alias ?: $item->author; ?> | ||
41 | <?php $author = '<span itemprop="name">' . $author . '</span>'; ?> | ||
42 | <?php if (!empty($item->contact_link) && $params->get('link_author') == true) : ?> | ||
43 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', JHtml::_('link', $this->item->contact_link, $author, array('itemprop' => 'url'))); ?> | ||
44 | <?php else : ?> | ||
45 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_WRITTEN_BY', $author); ?> | ||
46 | <?php endif; ?> | ||
47 | </div> | ||
48 | <?php endif; ?> | ||
49 | </div> | ||
50 | <?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date') | ||
51 | || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category')); ?> | ||
52 | <?php if ($useDefList && ($info == 0 || $info == 2)) : ?> | ||
53 | <div class="article-info muted"> | ||
54 | <dl class="article-info"> | ||
55 | <dt class="article-info-term"> | ||
56 | <?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?> | ||
57 | </dt> | ||
58 | |||
59 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
60 | <dd> | ||
61 | <div class="parent-category-name"> | ||
62 | <?php $title = $this->escape($item->parent_title); ?> | ||
63 | <?php if ($params->get('link_parent_category') && !empty($item->parent_slug)) : ?> | ||
64 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
65 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
66 | <?php else : ?> | ||
67 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
68 | <?php endif; ?> | ||
69 | </div> | ||
70 | </dd> | ||
71 | <?php endif; ?> | ||
72 | <?php if ($params->get('show_category')) : ?> | ||
73 | <dd> | ||
74 | <div class="category-name"> | ||
75 | <?php $title = $this->escape($item->category_title); ?> | ||
76 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
77 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
78 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
79 | <?php else : ?> | ||
80 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
81 | <?php endif; ?> | ||
82 | </div> | ||
83 | </dd> | ||
84 | <?php endif; ?> | ||
85 | |||
86 | <?php if ($params->get('show_publish_date')) : ?> | ||
87 | <dd> | ||
88 | <div class="published"> | ||
89 | <span class="icon-calendar" aria-hidden="true"></span> | ||
90 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
91 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
92 | </time> | ||
93 | </div> | ||
94 | </dd> | ||
95 | <?php endif; ?> | ||
96 | |||
97 | <?php if ($info == 0) : ?> | ||
98 | <?php if ($params->get('show_modify_date')) : ?> | ||
99 | <dd> | ||
100 | <div class="modified"> | ||
101 | <span class="icon-calendar" aria-hidden="true"></span> | ||
102 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
103 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
104 | </time> | ||
105 | </div> | ||
106 | </dd> | ||
107 | <?php endif; ?> | ||
108 | <?php if ($params->get('show_create_date')) : ?> | ||
109 | <dd> | ||
110 | <div class="create"> | ||
111 | <span class="icon-calendar" aria-hidden="true"></span> | ||
112 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
113 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->created, JText::_('DATE_FORMAT_LC3'))); ?> | ||
114 | </time> | ||
115 | </div> | ||
116 | </dd> | ||
117 | <?php endif; ?> | ||
118 | |||
119 | <?php if ($params->get('show_hits')) : ?> | ||
120 | <dd> | ||
121 | <div class="hits"> | ||
122 | <span class="icon-eye-open"></span> | ||
123 | <meta itemprop="interactionCount" content="UserPageVisits:<?php echo $item->hits; ?>" /> | ||
124 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
125 | </div> | ||
126 | </dd> | ||
127 | <?php endif; ?> | ||
128 | <?php endif; ?> | ||
129 | </dl> | ||
130 | </div> | ||
131 | <?php endif; ?> | ||
132 | |||
133 | <?php // Content is generated by content plugin event "onContentBeforeDisplay" ?> | ||
134 | <?php echo $item->event->beforeDisplayContent; ?> | ||
135 | <?php if ($params->get('show_intro')) : ?> | ||
136 | <div class="intro" itemprop="articleBody"> <?php echo JHtml::_('string.truncateComplex', $item->introtext, $params->get('introtext_limit')); ?> </div> | ||
137 | <?php endif; ?> | ||
138 | |||
139 | <?php if ($useDefList && ($info == 1 || $info == 2)) : ?> | ||
140 | <div class="article-info muted"> | ||
141 | <dl class="article-info"> | ||
142 | <dt class="article-info-term"><?php echo JText::_('COM_CONTENT_CUSTOM_ARTICLE_INFO'); ?></dt> | ||
143 | |||
144 | <?php if ($info == 1) : ?> | ||
145 | <?php if ($params->get('show_parent_category') && !empty($item->parent_slug)) : ?> | ||
146 | <dd> | ||
147 | <div class="parent-category-name"> | ||
148 | <?php $title = $this->escape($item->parent_title); ?> | ||
149 | <?php if ($params->get('link_parent_category') && $item->parent_slug) : ?> | ||
150 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->parent_slug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
151 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', $url); ?> | ||
152 | <?php else : ?> | ||
153 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PARENT', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
154 | <?php endif; ?> | ||
155 | </div> | ||
156 | </dd> | ||
157 | <?php endif; ?> | ||
158 | <?php if ($params->get('show_category')) : ?> | ||
159 | <dd> | ||
160 | <div class="category-name"> | ||
161 | <?php $title = $this->escape($item->category_title); ?> | ||
162 | <?php if ($params->get('link_category') && $item->catslug) : ?> | ||
163 | <?php $url = '<a href="' . JRoute::_(ContentCustomHelperRoute::getCategoryRoute($item->catslug)) . '" itemprop="genre">' . $title . '</a>'; ?> | ||
164 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', $url); ?> | ||
165 | <?php else : ?> | ||
166 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CATEGORY', '<span itemprop="genre">' . $title . '</span>'); ?> | ||
167 | <?php endif; ?> | ||
168 | </div> | ||
169 | </dd> | ||
170 | <?php endif; ?> | ||
171 | <?php if ($params->get('show_publish_date')) : ?> | ||
172 | <dd> | ||
173 | <div class="published"> | ||
174 | <span class="icon-calendar" aria-hidden="true"></span> | ||
175 | <time datetime="<?php echo JHtml::_('date', $item->publish_up, 'c'); ?>" itemprop="datePublished"> | ||
176 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_PUBLISHED_DATE_ON', JHtml::_('date', $item->publish_up, JText::_('DATE_FORMAT_LC3'))); ?> | ||
177 | </time> | ||
178 | </div> | ||
179 | </dd> | ||
180 | <?php endif; ?> | ||
181 | <?php endif; ?> | ||
182 | |||
183 | <?php if ($params->get('show_create_date')) : ?> | ||
184 | <dd> | ||
185 | <div class="create"> | ||
186 | <span class="icon-calendar" aria-hidden="true"></span> | ||
187 | <time datetime="<?php echo JHtml::_('date', $item->created, 'c'); ?>" itemprop="dateCreated"> | ||
188 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_CREATED_DATE_ON', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
189 | </time> | ||
190 | </div> | ||
191 | </dd> | ||
192 | <?php endif; ?> | ||
193 | <?php if ($params->get('show_modify_date')) : ?> | ||
194 | <dd> | ||
195 | <div class="modified"> | ||
196 | <span class="icon-calendar" aria-hidden="true"></span> | ||
197 | <time datetime="<?php echo JHtml::_('date', $item->modified, 'c'); ?>" itemprop="dateModified"> | ||
198 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_LAST_UPDATED', JHtml::_('date', $item->modified, JText::_('DATE_FORMAT_LC3'))); ?> | ||
199 | </time> | ||
200 | </div> | ||
201 | </dd> | ||
202 | <?php endif; ?> | ||
203 | <?php if ($params->get('show_hits')) : ?> | ||
204 | <dd> | ||
205 | <div class="hits"> | ||
206 | <span class="icon-eye-open"></span> | ||
207 | <meta content="UserPageVisits:<?php echo $item->hits; ?>" itemprop="interactionCount" /> | ||
208 | <?php echo JText::sprintf('COM_CONTENT_CUSTOM_ARTICLE_HITS', $item->hits); ?> | ||
209 | </div> | ||
210 | </dd> | ||
211 | <?php endif; ?> | ||
212 | </dl> | ||
213 | </div> | ||
214 | <?php endif; ?> | ||
215 | <?php // Content is generated by content plugin event "onContentAfterDisplay" ?> | ||
216 | <?php echo $item->event->afterDisplayContent; ?> | ||
217 | </div> | ||
218 | <?php endforeach; ?> | ||
219 | </div> | ||
220 | <div class="pagination"> | ||
221 | <p class="counter pull-right"> <?php echo $this->pagination->getPagesCounter(); ?> </p> | ||
222 | <?php echo $this->pagination->getPagesLinks(); ?> | ||
223 | </div> |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage com_conten_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 | /** | ||
13 | * HTML View class for the Content component | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ContentViewArchive extends JViewLegacy | ||
18 | { | ||
19 | protected $state = null; | ||
20 | |||
21 | protected $item = null; | ||
22 | |||
23 | protected $items = null; | ||
24 | |||
25 | protected $pagination = null; | ||
26 | |||
27 | /** | ||
28 | * Execute and display a template script. | ||
29 | * | ||
30 | * @param string $tpl The name of the template file to parse; automatically searches through the template paths. | ||
31 | * | ||
32 | * @return mixed A string if successful, otherwise an Error object. | ||
33 | */ | ||
34 | public function display($tpl = null) | ||
35 | { | ||
36 | $user = JFactory::getUser(); | ||
37 | $state = $this->get('State'); | ||
38 | $items = $this->get('Items'); | ||
39 | $pagination = $this->get('Pagination'); | ||
40 | |||
41 | // Flag indicates to not add limitstart=0 to URL | ||
42 | $pagination->hideEmptyLimitstart = true; | ||
43 | |||
44 | // Get the page/component configuration | ||
45 | $params = &$state->params; | ||
46 | |||
47 | JPluginHelper::importPlugin('content_custom'); | ||
48 | |||
49 | foreach ($items as $item) | ||
50 | { | ||
51 | $item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid; | ||
52 | $item->parent_slug = $item->parent_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id; | ||
53 | |||
54 | // No link for ROOT category | ||
55 | if ($item->parent_alias === 'root') | ||
56 | { | ||
57 | $item->parent_slug = null; | ||
58 | } | ||
59 | |||
60 | $item->event = new stdClass; | ||
61 | |||
62 | $dispatcher = JEventDispatcher::getInstance(); | ||
63 | |||
64 | // Old plugins: Ensure that text property is available | ||
65 | if (!isset($item->text)) | ||
66 | { | ||
67 | $item->text = $item->introtext; | ||
68 | } | ||
69 | |||
70 | $dispatcher->trigger('onContentPrepare', array ('com_content_custom.archive', &$item, &$item->params, 0)); | ||
71 | |||
72 | // Old plugins: Use processed text as introtext | ||
73 | $item->introtext = $item->text; | ||
74 | |||
75 | $results = $dispatcher->trigger('onContentAfterTitle', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
76 | $item->event->afterDisplayTitle = trim(implode("\n", $results)); | ||
77 | |||
78 | $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
79 | $item->event->beforeDisplayContent = trim(implode("\n", $results)); | ||
80 | |||
81 | $results = $dispatcher->trigger('onContentAfterDisplay', array('com_content_custom.archive', &$item, &$item->params, 0)); | ||
82 | $item->event->afterDisplayContent = trim(implode("\n", $results)); | ||
83 | } | ||
84 | |||
85 | $this->filter = $state->get('list.filter'); | ||
86 | $this->items = &$items; | ||
87 | $this->params = &$params; | ||
88 | $this->user = &$user; | ||
89 | $this->pagination = &$pagination; | ||
90 | $this->pagination->setAdditionalUrlParam('month', $state->get('filter.month')); | ||
91 | $this->pagination->setAdditionalUrlParam('year', $state->get('filter.year')); | ||
92 | |||
93 | $this->_prepareDocument(); | ||
94 | |||
95 | parent::display($tpl); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * Prepares the document | ||
100 | * | ||
101 | * @return void | ||
102 | */ | ||
103 | protected function _prepareDocument() | ||
104 | { | ||
105 | $app = JFactory::getApplication(); | ||
106 | $menus = $app->getMenu(); | ||
107 | $title = null; | ||
108 | |||
109 | // Because the application sets a default page title, | ||
110 | // we need to get it from the menu item itself | ||
111 | $menu = $menus->getActive(); | ||
112 | |||
113 | if ($menu) | ||
114 | { | ||
115 | $this->params->def('page_heading', $this->params->get('page_title', $menu->title)); | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | $this->params->def('page_heading', JText::_('JGLOBAL_ARTICLES')); | ||
120 | } | ||
121 | |||
122 | $title = $this->params->get('page_title', ''); | ||
123 | |||
124 | if (empty($title)) | ||
125 | { | ||
126 | $title = $app->get('sitename'); | ||
127 | } | ||
128 | elseif ($app->get('sitename_pagetitles', 0) == 1) | ||
129 | { | ||
130 | $title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title); | ||
131 | } | ||
132 | elseif ($app->get('sitename_pagetitles', 0) == 2) | ||
133 | { | ||
134 | $title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename')); | ||
135 | } | ||
136 | |||
137 | $this->document->setTitle($title); | ||
138 | |||
139 | if ($this->params->get('menu-meta_description')) | ||
140 | { | ||
141 | $this->document->setDescription($this->params->get('menu-meta_description')); | ||
142 | } | ||
143 | |||
144 | if ($this->params->get('menu-meta_keywords')) | ||
145 | { | ||
146 | $this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords')); | ||
147 | } | ||
148 | |||
149 | if ($this->params->get('robots')) | ||
150 | { | ||
151 | $this->document->setMetadata('robots', $this->params->get('robots')); | ||
152 | } | ||
153 | } | ||
154 | } |
1 | # インフォメーション用月次アーカイブモジュール | ||
2 | 公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。 | ||
3 | インストールしていない場合は、管理画面よりインストールする必要があります。 | ||
4 | |||
5 | ## このコンポーネントは、インフォメーションカテゴリーに属する記事専用の月次アーカイブモジュールです。 | ||
6 | インフォメーション(メニュー)の子メニューのサイドバーで表示できる様に、83行目でリンクを修正する処理を追加しています | ||
7 | |||
8 | ### インフォメーションカテゴリー以外のカテゴリーに属する記事の月次アーカイブを作成したい場合は以下の手順が必要です。 | ||
9 | #### 手順2,3をせずにインストールしてしまうと、インストーラーが既存のモジュールを上書きしてしまい、サイトに不具合が発生する可能性があるので必ず実行してください。 | ||
10 | [Joomla公式のモジュール作成チュートリアルです。参考にしてください。](https://docs.joomla.org/J3.x:Creating_a_simple_module/Developing_a_Basic_Module) | ||
11 | 1. mod_information_articles_archive_custom/をコピーし、src/mod配下におきます。 | ||
12 | 2. mod_information_articles_archive_customを含む配下のディレクトリ名とファイル名を、新規に月次モジュールを設置するカテゴリーに準じたものに変更します。例:mod_category_articles_archive_custom | ||
13 | 3. mod_information_articles_archive_custom.xmlで、インストーラーがインストールするディレクトリ名とファイル名を指定しているので、手順1で変更したディレクトリ名、ファイル名を指定する様に修正します。 | ||
14 | 4. en-GBから始まる二つのファイルと、ja-JPから始まる二つのファイルで、モジュール内で使用する定数を定義しているので、ファイルを編集し新規に月次モジュールを設置するカテゴリーに準じたものに変更します。 | ||
15 | 例:MOD_CATEGORY_ARTICLES_ARCHIVE_CUSTOM="カスタムカテゴリー名アーカイブ(モジュール)" | ||
16 | 5. 手順4で定数名を変更したので、それぞれの定数が呼び出されている箇所も、変更した定数名が呼び出される様に修正します。 | ||
17 | 6. README下部にあるインストール手順にしたがってインストールをします。 | ||
18 | |||
19 | ## インストール手順 | ||
20 | 1. 管理画面ログイン | ||
21 | 2. エクステンション配下の管理を選択 | ||
22 | 3. (フォルダからインストール)を選択 | ||
23 | 4. フォームにインストールするモジュールまたは、コンポーネントのフォルダを指定(例:/var/www/html/src/com/com_hoge) | ||
24 | 5. チェックしてインストール | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/mod/mod_information_articles_archive_custom/en-GB.mod_information_articles_archive_custom.ini
0 → 100644
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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="InformationArticles - Archived - custom" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="# of Months" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="The number of months to display (the default is 10)." | ||
9 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
10 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="InformationArticles - Archived - custom" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="Display a list of calendar months, including published articles. This list is automatically generated when you create a published article." | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="Default" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_information_articles_archive_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 | /** | ||
13 | * Helper for mod_information_articles_archive_custom | ||
14 | * | ||
15 | * @since 1.5 | ||
16 | */ | ||
17 | class ModArchiveHelper | ||
18 | { | ||
19 | /** | ||
20 | * Retrieve list of archived articles | ||
21 | * | ||
22 | * @param \Joomla\Registry\Registry &$params module parameters | ||
23 | * | ||
24 | * @return array | ||
25 | * | ||
26 | * @since 1.5 | ||
27 | */ | ||
28 | public static function getList(&$params) | ||
29 | { | ||
30 | // Get database | ||
31 | $db = JFactory::getDbo(); | ||
32 | $query = $db->getQuery(true); | ||
33 | $query->select($query->month($db->quoteName('created')) . ' AS created_month') | ||
34 | ->select('MIN(' . $db->quoteName('created') . ') AS created') | ||
35 | ->select($query->year($db->quoteName('created')) . ' AS created_year') | ||
36 | ->from('#__content') | ||
37 | ->where('state = 1') | ||
38 | ->group($query->year($db->quoteName('created')) . ', ' . $query->month($db->quoteName('created'))) | ||
39 | ->order($query->year($db->quoteName('created')) . ' DESC, ' . $query->month($db->quoteName('created')) . ' DESC'); | ||
40 | |||
41 | // Filter by language | ||
42 | if (JFactory::getApplication()->getLanguageFilter()) | ||
43 | { | ||
44 | $query->where('language in (' . $db->quote(JFactory::getLanguage()->getTag()) . ',' . $db->quote('*') . ')'); | ||
45 | } | ||
46 | |||
47 | $db->setQuery($query, 0, (int) $params->get('count')); | ||
48 | |||
49 | try | ||
50 | { | ||
51 | $rows = (array) $db->loadObjectList(); | ||
52 | } | ||
53 | catch (RuntimeException $e) | ||
54 | { | ||
55 | JFactory::getApplication()->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); | ||
56 | |||
57 | return array(); | ||
58 | } | ||
59 | |||
60 | $app = JFactory::getApplication(); | ||
61 | $menu = $app->getMenu(); | ||
62 | $item = $menu->getItems('link', 'index.php?option=com_content_custom&view=archive', true); | ||
63 | $itemid = (isset($item) && !empty($item->id)) ? '&Itemid=' . $item->id : ''; | ||
64 | |||
65 | $i = 0; | ||
66 | $lists = array(); | ||
67 | |||
68 | foreach ($rows as $row) | ||
69 | { | ||
70 | $date = JFactory::getDate($row->created); | ||
71 | |||
72 | $createdMonth = $date->format('n'); | ||
73 | $createdYear = $date->format('Y'); | ||
74 | |||
75 | $createdYearCal = JHtml::_('date', $row->created, 'Y') . "年"; | ||
76 | $monthNameCal = JHtml::_('date', $row->created, 'F'); | ||
77 | $createdDateCal = $createdYearCal . $monthNameCal; | ||
78 | |||
79 | $lists[$i] = new stdClass; | ||
80 | |||
81 | $link = JRoute::_('index.php?option=com_content_custom&view=archive&year=' . $createdYear . '&month=' . $createdMonth . $itemid); | ||
82 | // アーカイブコンポーネント以外でモジュールを表示した場合に以下の様にリンクを書き換える。 | ||
83 | $link = str_replace("/component/content_custom/", "/information/info-archive.html", $link); | ||
84 | |||
85 | $lists[$i]->link = $link; | ||
86 | $lists[$i]->text = JText::sprintf($createdDateCal); | ||
87 | |||
88 | $i++; | ||
89 | } | ||
90 | |||
91 | return $lists; | ||
92 | } | ||
93 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/mod/mod_information_articles_archive_custom/ja-JP.mod_information_articles_archive_custom.ini
0 → 100644
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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="カスタムインフォメーションアーカイブ(モジュール)" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL="表示月数" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC="表示する月数(標準は10)です。" | ||
9 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
10 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_DATE="%1$s, %2$s" | ||
... | \ 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_INFORMATION_ARTICLES_ARCHIVE_CUSTOM="カスタムインフォメーションアーカイブ(モジュール)" | ||
7 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION="公開状態になっている記事を含むカレンダー月の一覧を表示します。公開状態になっている記事を作成すると、この一覧は自動的に生成されます。" | ||
8 | MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_LAYOUT_DEFAULT="標準" | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/mod/mod_information_articles_archive_custom/mod_information_articles_archive_custom.php
0 → 100644
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_articles_archive | ||
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 archive functions only once | ||
13 | JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php'); | ||
14 | |||
15 | $params->def('count', 10); | ||
16 | $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); | ||
17 | $list = ModArchiveHelper::getList($params); | ||
18 | |||
19 | require JModuleHelper::getLayoutPath('mod_information_articles_archive_custom', $params->get('layout', 'default')); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
src/mod/mod_information_articles_archive_custom/mod_information_articles_archive_custom.xml
0 → 100644
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <extension type="module" version="3.1" client="site" method="upgrade"> | ||
3 | <name>MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM</name> | ||
4 | <author>T.Tokudome</author> | ||
5 | <creationDate>June 2020</creationDate> | ||
6 | <copyright></copyright> | ||
7 | <license></license> | ||
8 | <authorEmail>tokudome@lilli.co.jp</authorEmail> | ||
9 | <authorUrl></authorUrl> | ||
10 | <version>0.0.1</version> | ||
11 | <description>MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_XML_DESCRIPTION</description> | ||
12 | <files> | ||
13 | <filename module="mod_information_articles_archive_custom">mod_information_articles_archive_custom.php</filename> | ||
14 | <folder>tmpl</folder> | ||
15 | <filename>helper.php</filename> | ||
16 | </files> | ||
17 | <languages> | ||
18 | <language tag="en-GB">en-GB.mod_information_articles_archive_custom.ini</language> | ||
19 | <language tag="en-GB">en-GB.mod_information_articles_archive_custom.sys.ini</language> | ||
20 | <language tag="ja-JP">ja-JP.mod_information_articles_archive_custom.ini</language> | ||
21 | <language tag="ja-JP">ja-JP.mod_information_articles_archive_custom.sys.ini</language> | ||
22 | </languages> | ||
23 | <help key="JHELP_EXTENSIONS_MODULE_MANAGER_ARTICLES_ARCHIVE" /> | ||
24 | <config> | ||
25 | <fields name="params"> | ||
26 | <fieldset name="basic"> | ||
27 | <field | ||
28 | name="count" | ||
29 | type="number" | ||
30 | label="MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_LABEL" | ||
31 | description="MOD_INFORMATION_ARTICLES_ARCHIVE_CUSTOM_FIELD_COUNT_DESC" | ||
32 | default="120" | ||
33 | filter="integer" | ||
34 | /> | ||
35 | </fieldset> | ||
36 | |||
37 | <fieldset name="advanced"> | ||
38 | <field | ||
39 | name="layout" | ||
40 | type="modulelayout" | ||
41 | label="JFIELD_ALT_LAYOUT_LABEL" | ||
42 | description="JFIELD_ALT_MODULE_LAYOUT_DESC" | ||
43 | /> | ||
44 | |||
45 | <field | ||
46 | name="moduleclass_sfx" | ||
47 | type="textarea" | ||
48 | label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL" | ||
49 | description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" | ||
50 | rows="3" | ||
51 | /> | ||
52 | |||
53 | <field | ||
54 | name="cache" | ||
55 | type="list" | ||
56 | label="COM_MODULES_FIELD_CACHING_LABEL" | ||
57 | description="COM_MODULES_FIELD_CACHING_DESC" | ||
58 | default="1" | ||
59 | filter="integer" | ||
60 | > | ||
61 | <option value="1">JGLOBAL_USE_GLOBAL</option> | ||
62 | <option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option> | ||
63 | </field> | ||
64 | |||
65 | <field | ||
66 | name="cache_time" | ||
67 | type="number" | ||
68 | label="COM_MODULES_FIELD_CACHE_TIME_LABEL" | ||
69 | description="COM_MODULES_FIELD_CACHE_TIME_DESC" | ||
70 | default="900" | ||
71 | filter="integer" | ||
72 | /> | ||
73 | |||
74 | <field | ||
75 | name="cachemode" | ||
76 | type="hidden" | ||
77 | default="static" | ||
78 | > | ||
79 | <option value="static"></option> | ||
80 | </field> | ||
81 | </fieldset> | ||
82 | </fields> | ||
83 | </config> | ||
84 | </extension> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | <?php | ||
2 | /** | ||
3 | * @package Joomla.Site | ||
4 | * @subpackage mod_information_articles_archive_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 | <?php if (!empty($list)) : ?> | ||
13 | <ul class="archive-module-custom<?php echo $moduleclass_sfx; ?> mod-list"> | ||
14 | <?php foreach ($list as $item) : ?> | ||
15 | <li> | ||
16 | <a href="<?php echo $item->link; ?>"> | ||
17 | <?php echo $item->text; ?> | ||
18 | </a> | ||
19 | </li> | ||
20 | <?php endforeach; ?> | ||
21 | </ul> | ||
22 | <?php endif; ?> |
1 | /* コロナ暫定対処 */ | 1 | /* コロナ暫定対処 */ |
2 | .covid-19 .mod-articles-category-category { | 2 | .covid-19 .mod-articles-category-category, |
3 | .covid-19-news .mod-articles-category-category { | ||
4 | display: none; | ||
5 | } | ||
6 | .covid-19-sub-menu.category-list { | ||
3 | display: none; | 7 | display: none; |
4 | } | 8 | } |
5 | 9 | ||
... | @@ -61,7 +65,8 @@ a.outlink { | ... | @@ -61,7 +65,8 @@ a.outlink { |
61 | color: #009fa8; | 65 | color: #009fa8; |
62 | } | 66 | } |
63 | .item-page h4 a, | 67 | .item-page h4 a, |
64 | .blog h4 a { | 68 | .blog h4 a, |
69 | .archive-custom h4 a { | ||
65 | background: url(../images/bg_arrow01.png) no-repeat left 4px; | 70 | background: url(../images/bg_arrow01.png) no-repeat left 4px; |
66 | min-height: 20px; | 71 | min-height: 20px; |
67 | padding-left: 25px; | 72 | padding-left: 25px; |
... | @@ -74,7 +79,11 @@ a.outlink { | ... | @@ -74,7 +79,11 @@ a.outlink { |
74 | .blog h4 a:link, | 79 | .blog h4 a:link, |
75 | .blog h4 a:active, | 80 | .blog h4 a:active, |
76 | .blog h4 a:hover, | 81 | .blog h4 a:hover, |
77 | .blog h4 a:visited { | 82 | .blog h4 a:visited, |
83 | .archive-custom h4 a:link, | ||
84 | .archive-custom h4 a:active, | ||
85 | .archive-custom h4 a:hover, | ||
86 | .archive-custom h4 a:visited { | ||
78 | color: #fff !important; | 87 | color: #fff !important; |
79 | } | 88 | } |
80 | .sp, .sp_gnavi { | 89 | .sp, .sp_gnavi { |
... | @@ -87,7 +96,8 @@ a.outlink { | ... | @@ -87,7 +96,8 @@ a.outlink { |
87 | display: none; | 96 | display: none; |
88 | } | 97 | } |
89 | .item-page .icons, | 98 | .item-page .icons, |
90 | .blog .icons { | 99 | .blog .icons, |
100 | .archive-custom .icons { | ||
91 | /*display: none;*/ | 101 | /*display: none;*/ |
92 | } | 102 | } |
93 | table { | 103 | table { |
... | @@ -273,6 +283,7 @@ h1, h2, h3, h4, h5, h6, .site-title { | ... | @@ -273,6 +283,7 @@ h1, h2, h3, h4, h5, h6, .site-title { |
273 | line-height: 1; | 283 | line-height: 1; |
274 | margin: 0; | 284 | margin: 0; |
275 | } | 285 | } |
286 | /* 記述エラーで機能していないため、コメントアウト | ||
276 | .item-page h2, | 287 | .item-page h2, |
277 | .item-page h3, | 288 | .item-page h3, |
278 | .item-page h4, | 289 | .item-page h4, |
... | @@ -283,16 +294,23 @@ h1, h2, h3, h4, h5, h6, .site-title { | ... | @@ -283,16 +294,23 @@ h1, h2, h3, h4, h5, h6, .site-title { |
283 | .blog h4, | 294 | .blog h4, |
284 | .blog h5, | 295 | .blog h5, |
285 | 296 | ||
297 | .archive-custom h2, | ||
298 | .archive-custom h3, | ||
299 | .archive-custom h4, | ||
300 | .archive-custom h5, | ||
301 | |||
286 | #content h2, | 302 | #content h2, |
287 | #content h3, | 303 | #content h3, |
288 | #content h4, | 304 | #content h4, |
289 | #content h5, { | 305 | #content h5, { |
290 | line-height: 1.3; | 306 | line-height: 1.3; |
291 | } | 307 | } */ |
292 | .item-page h2, | 308 | .item-page h2, |
293 | body.com_monthlyarchive h2, | 309 | body.com_monthlyarchive h2, |
294 | .blog .page-header h2, | 310 | .blog .page-header h2, |
295 | .blog h2 { | 311 | .blog h2, |
312 | .archive-custom .page-header h2, | ||
313 | .archive-custom h2 { | ||
296 | font-size: 150%; | 314 | font-size: 150%; |
297 | color: #222; | 315 | color: #222; |
298 | font-weight: normal; | 316 | font-weight: normal; |
... | @@ -304,7 +322,7 @@ body.com_monthlyarchive h2, | ... | @@ -304,7 +322,7 @@ body.com_monthlyarchive h2, |
304 | .uk-scope .uk-margin-top { | 322 | .uk-scope .uk-margin-top { |
305 | margin-top: 9px !important; | 323 | margin-top: 9px !important; |
306 | } | 324 | } |
307 | #content h3, .item-page h3, .blog h3 { | 325 | #content h3, .item-page h3, .blog h3, .archive-custom h3 { |
308 | border-left: 5px solid #003894; | 326 | border-left: 5px solid #003894; |
309 | font-size: 130%; | 327 | font-size: 130%; |
310 | font-weight: normal; | 328 | font-weight: normal; |
... | @@ -313,7 +331,7 @@ body.com_monthlyarchive h2, | ... | @@ -313,7 +331,7 @@ body.com_monthlyarchive h2, |
313 | margin-top: 20px; | 331 | margin-top: 20px; |
314 | padding: 10px 0 10px 15px; | 332 | padding: 10px 0 10px 15px; |
315 | } | 333 | } |
316 | .item-page h4, .blog h4 { | 334 | .item-page h4, .blog h4, .archive-custom h4 { |
317 | background-color: #00857F; | 335 | background-color: #00857F; |
318 | color: #fff; | 336 | color: #fff; |
319 | font-size: 110%; | 337 | font-size: 110%; |
... | @@ -322,7 +340,7 @@ body.com_monthlyarchive h2, | ... | @@ -322,7 +340,7 @@ body.com_monthlyarchive h2, |
322 | margin-top: 50px; | 340 | margin-top: 50px; |
323 | padding: 7px 10px; | 341 | padding: 7px 10px; |
324 | } | 342 | } |
325 | .item-page h5, .blog h5 { | 343 | .item-page h5, .blog h5, .archive-custom h5 { |
326 | font-size: 120%; | 344 | font-size: 120%; |
327 | font-weight: normal; | 345 | font-weight: normal; |
328 | background: url(../images/bg_h5.png) no-repeat left center; | 346 | background: url(../images/bg_h5.png) no-repeat left center; |
... | @@ -539,14 +557,19 @@ div.search input.button { | ... | @@ -539,14 +557,19 @@ div.search input.button { |
539 | 557 | ||
540 | .blog .subnavi01 ol, | 558 | .blog .subnavi01 ol, |
541 | .blog .subnavi01 ul, | 559 | .blog .subnavi01 ul, |
542 | .blog .subnavi01 ul.style01 { | 560 | .blog .subnavi01 ul.style01, |
561 | .archive-custom .subnavi01 ol, | ||
562 | .archive-custom .subnavi01 ul, | ||
563 | .archive-custom .subnavi01 ul.style01 { | ||
543 | overflow: hidden; | 564 | overflow: hidden; |
544 | margin: 0; | 565 | margin: 0; |
545 | } | 566 | } |
546 | .item-page .subnavi01 ol li, | 567 | .item-page .subnavi01 ol li, |
547 | .item-page .subnavi01 ul li, | 568 | .item-page .subnavi01 ul li, |
548 | .blog .subnavi01 ol li, | 569 | .blog .subnavi01 ol li, |
549 | .blog .subnavi01 ul li { | 570 | .blog .subnavi01 ul li, |
571 | .archive-custom.subnavi01 ol li, | ||
572 | .archive-custom .subnavi01 ul li { | ||
550 | float: left; | 573 | float: left; |
551 | list-style-type: none; | 574 | list-style-type: none; |
552 | width: 33.3%; | 575 | width: 33.3%; |
... | @@ -558,24 +581,29 @@ div.search input.button { | ... | @@ -558,24 +581,29 @@ div.search input.button { |
558 | .item-page .subnavi01 ul.style01 li, | 581 | .item-page .subnavi01 ul.style01 li, |
559 | .item-page .subnavi01 ol.style01 li, | 582 | .item-page .subnavi01 ol.style01 li, |
560 | .blog .subnavi01 ul.style01 li, | 583 | .blog .subnavi01 ul.style01 li, |
561 | .blog .subnavi01 ol.style01 li { | 584 | .blog .subnavi01 ol.style01 li, |
585 | .archive-custom .subnavi01 ul.style01 li, | ||
586 | .archive-custom .subnavi01 ol.style01 li { | ||
562 | width: 50%; | 587 | width: 50%; |
563 | padding-right: 20px; | 588 | padding-right: 20px; |
564 | box-sizing: border-box; | 589 | box-sizing: border-box; |
565 | } | 590 | } |
566 | .item-page .subnavi01 ol.style01 li, | 591 | .item-page .subnavi01 ol.style01 li, |
567 | .blog .subnavi01 ol.style01 li { | 592 | .blog .subnavi01 ol.style01 li, |
593 | .archive-custom .subnavi01 ol.style01 li { | ||
568 | border: none; | 594 | border: none; |
569 | padding-bottom: inherit; | 595 | padding-bottom: inherit; |
570 | margin-bottom: 15px; | 596 | margin-bottom: 15px; |
571 | } | 597 | } |
572 | 598 | ||
573 | .item-page .subnavi01 ul.style02 li, | 599 | .item-page .subnavi01 ul.style02 li, |
574 | .blog .subnavi01 ul.style02 li { | 600 | .blog .subnavi01 ul.style02 li, |
601 | .archive-custom .subnavi01 ul.style02 li { | ||
575 | width: inherit; | 602 | width: inherit; |
576 | } | 603 | } |
577 | .item-page .subnavi01 ul.style03 li, | 604 | .item-page .subnavi01 ul.style03 li, |
578 | .blog .subnavi01 ul.style03 li { | 605 | .blog .subnavi01 ul.style03 li, |
606 | .archive-custom .subnavi01 ul.style03 li { | ||
579 | width: auto; | 607 | width: auto; |
580 | float: none; | 608 | float: none; |
581 | } | 609 | } |
... | @@ -1097,7 +1125,8 @@ div#n2-ss-64 .n2-ss-slide { | ... | @@ -1097,7 +1125,8 @@ div#n2-ss-64 .n2-ss-slide { |
1097 | overflow: hidden; | 1125 | overflow: hidden; |
1098 | } | 1126 | } |
1099 | .item-page #topinfo_twitarea h2, | 1127 | .item-page #topinfo_twitarea h2, |
1100 | .blog #topinfo_twitarea h2 { | 1128 | .blog #topinfo_twitarea h2, |
1129 | .archive-custom #topinfo_twitarea h2 { | ||
1101 | border: none; | 1130 | border: none; |
1102 | text-align: center; | 1131 | text-align: center; |
1103 | margin: 0 0 20px; | 1132 | margin: 0 0 20px; |
... | @@ -1475,7 +1504,8 @@ table.Cindex .ph { | ... | @@ -1475,7 +1504,8 @@ table.Cindex .ph { |
1475 | margin-bottom: 15px; | 1504 | margin-bottom: 15px; |
1476 | } | 1505 | } |
1477 | .item-page table.Cindex ul, | 1506 | .item-page table.Cindex ul, |
1478 | .blog table.Cindex ul{ | 1507 | .blog table.Cindex ul, |
1508 | .archive-custom table.Cindex ul { | ||
1479 | margin: 0; | 1509 | margin: 0; |
1480 | font-size: 90%; | 1510 | font-size: 90%; |
1481 | } | 1511 | } |
... | @@ -1528,7 +1558,8 @@ td.num01 { | ... | @@ -1528,7 +1558,8 @@ td.num01 { |
1528 | } | 1558 | } |
1529 | 1559 | ||
1530 | .item-page table ul, | 1560 | .item-page table ul, |
1531 | .blog table ul { | 1561 | .blog table ul, |
1562 | .archive-custom table ul { | ||
1532 | margin: 0 0 0 15px; | 1563 | margin: 0 0 0 15px; |
1533 | } | 1564 | } |
1534 | 1565 | ||
... | @@ -1575,16 +1606,19 @@ table.style01 th.group { | ... | @@ -1575,16 +1606,19 @@ table.style01 th.group { |
1575 | width: 12%; | 1606 | width: 12%; |
1576 | } | 1607 | } |
1577 | .item-page table.style01 ul li, | 1608 | .item-page table.style01 ul li, |
1578 | .blog table.style01 ul li { | 1609 | .blog table.style01 ul li, |
1610 | .archive-custom table.style01 ul li { | ||
1579 | list-style-type: none; | 1611 | list-style-type: none; |
1580 | margin: 0; | 1612 | margin: 0; |
1581 | } | 1613 | } |
1582 | .item-page table.style01 ul.mark, | 1614 | .item-page table.style01 ul.mark, |
1583 | .blog table.style01 ul.mark { | 1615 | .blog table.style01 ul.mark, |
1616 | .archive-custom table.style01 ul.mark { | ||
1584 | margin-left: 20px; | 1617 | margin-left: 20px; |
1585 | } | 1618 | } |
1586 | .item-page table.style01 ul.mark li, | 1619 | .item-page table.style01 ul.mark li, |
1587 | .blog table.style01 ul.mark li { | 1620 | .blog table.style01 ul.mark li, |
1621 | .archive-custom table.style01 ul.mark li { | ||
1588 | list-style-type: disc; | 1622 | list-style-type: disc; |
1589 | margin-bottom: 7px; | 1623 | margin-bottom: 7px; |
1590 | } | 1624 | } |
... | @@ -1695,33 +1729,40 @@ address .title { | ... | @@ -1695,33 +1729,40 @@ address .title { |
1695 | ul, ol { | 1729 | ul, ol { |
1696 | } | 1730 | } |
1697 | .item-page ul, .item-page ol, | 1731 | .item-page ul, .item-page ol, |
1698 | .blog ul, .blog ol { | 1732 | .blog ul, .blog ol, |
1733 | .archive-custom ul, .archive-custom ol { | ||
1699 | margin-bottom: 30px; | 1734 | margin-bottom: 30px; |
1700 | } | 1735 | } |
1701 | .item-page ul ul, .item-page ol ul, | 1736 | .item-page ul ul, .item-page ol ul, |
1702 | .item-page ul ol, .item-page ol ol, | 1737 | .item-page ul ol, .item-page ol ol, |
1703 | .blog ul ul, .blog ol ul, | 1738 | .blog ul ul, .blog ol ul, |
1704 | .blog ul ol, .blog ol ul { | 1739 | .blog ul ol, .blog ol ul, |
1740 | .archive-custom ul ul, .archive-custom ol ul, | ||
1741 | .archive-custom ul ol, .archive-custom ol ul { | ||
1705 | margin-left: 20px; | 1742 | margin-left: 20px; |
1706 | margin-top: 10px; | 1743 | margin-top: 10px; |
1707 | } | 1744 | } |
1708 | .item-page ul li, .item-page ol li, | 1745 | .item-page ul li, .item-page ol li, |
1709 | .blog ul li, .blog ol li { | 1746 | .blog ul li, .blog ol li, |
1747 | .archive-custom ul li, .archive-custom ol li { | ||
1710 | margin-bottom: 12px; | 1748 | margin-bottom: 12px; |
1711 | 1749 | ||
1712 | margin-bottom: 15px; | 1750 | margin-bottom: 15px; |
1713 | } | 1751 | } |
1714 | .item-page ul li, | 1752 | .item-page ul li, |
1715 | .blog ul li { | 1753 | .blog ul li, |
1754 | .archive-custom ul li { | ||
1716 | list-style-type: disc; | 1755 | list-style-type: disc; |
1717 | line-height: 1.5; | 1756 | line-height: 1.5; |
1718 | } | 1757 | } |
1719 | .item-page li ul | 1758 | .item-page li ul |
1720 | .blog li ul { | 1759 | .blog li ul, |
1760 | .archive-custom li ul { | ||
1721 | margin-top: 15px; | 1761 | margin-top: 15px; |
1722 | } | 1762 | } |
1723 | .item-page ul.kome, | 1763 | .item-page ul.kome, |
1724 | .blog ul.kome { | 1764 | .blog ul.kome, |
1765 | .archive-custom ul.kome { | ||
1725 | /*margin-left: 10px;*/ | 1766 | /*margin-left: 10px;*/ |
1726 | } | 1767 | } |
1727 | .item-page ul.kome li, | 1768 | .item-page ul.kome li, |
... | @@ -1739,17 +1780,20 @@ ol li .title { | ... | @@ -1739,17 +1780,20 @@ ol li .title { |
1739 | padding-bottom: 5px; | 1780 | padding-bottom: 5px; |
1740 | } | 1781 | } |
1741 | .item-page ol.style01 li, | 1782 | .item-page ol.style01 li, |
1742 | .blog ol.style01 li { | 1783 | .blog ol.style01 li, |
1784 | .archive-custom ol.style01 li { | ||
1743 | border-bottom: 1px solid #b3caf0; | 1785 | border-bottom: 1px solid #b3caf0; |
1744 | padding-bottom: 10px; | 1786 | padding-bottom: 10px; |
1745 | margin-bottom: 20px; | 1787 | margin-bottom: 20px; |
1746 | } | 1788 | } |
1747 | .item-page ol.style01 li ul, | 1789 | .item-page ol.style01 li ul, |
1748 | .blog ol.style01 li ul { | 1790 | .blog ol.style01 li ul, |
1791 | .archive-custom ol.style01 li ul { | ||
1749 | margin-bottom: 0; | 1792 | margin-bottom: 0; |
1750 | } | 1793 | } |
1751 | .item-page ol.style01 li li, | 1794 | .item-page ol.style01 li li, |
1752 | .blog ol.style01 li li { | 1795 | .blog ol.style01 li li, |
1796 | .archive-custom ol.style01 li li { | ||
1753 | border: none; | 1797 | border: none; |
1754 | margin-bottom: 10px; | 1798 | margin-bottom: 10px; |
1755 | } | 1799 | } |
... | @@ -1920,7 +1964,8 @@ dl.article-info dd.create { | ... | @@ -1920,7 +1964,8 @@ dl.article-info dd.create { |
1920 | margin-bottom: 20px; | 1964 | margin-bottom: 20px; |
1921 | } | 1965 | } |
1922 | .item-page .bikoubox01 ul.kome, | 1966 | .item-page .bikoubox01 ul.kome, |
1923 | .blog .bikoubox01 ul.kome { | 1967 | .blog .bikoubox01 ul.kome, |
1968 | .archive-custom .bikoubox01 ul.kome { | ||
1924 | margin-left: 0; | 1969 | margin-left: 0; |
1925 | } | 1970 | } |
1926 | .bikoubox01 .title { | 1971 | .bikoubox01 .title { |
... | @@ -2102,7 +2147,13 @@ table.listimg td { | ... | @@ -2102,7 +2147,13 @@ table.listimg td { |
2102 | .blog .wrap_fac .subnavi02 ul li a:link, | 2147 | .blog .wrap_fac .subnavi02 ul li a:link, |
2103 | .blog .wrap_fac .subnavi02 ul li a:active, | 2148 | .blog .wrap_fac .subnavi02 ul li a:active, |
2104 | .blog .wrap_fac .subnavi02 ul li a:hover, | 2149 | .blog .wrap_fac .subnavi02 ul li a:hover, |
2105 | .blog .wrap_fac .subnavi02 ul li a:visited { | 2150 | .blog .wrap_fac .subnavi02 ul li a:visited, |
2151 | |||
2152 | .archive-custom .wrap_fac .subnavi02 ul li a, | ||
2153 | .archive-custom .wrap_fac .subnavi02 ul li a:link, | ||
2154 | .archive-custom .wrap_fac .subnavi02 ul li a:active, | ||
2155 | .archive-custom .wrap_fac .subnavi02 ul li a:hover, | ||
2156 | .archive-custom .wrap_fac .subnavi02 ul li a:visited { | ||
2106 | color: #333 !important; | 2157 | color: #333 !important; |
2107 | } | 2158 | } |
2108 | 2159 | ||
... | @@ -2210,7 +2261,8 @@ table.listimg td { | ... | @@ -2210,7 +2261,8 @@ table.listimg td { |
2210 | /*競技成績一覧ページ | 2261 | /*競技成績一覧ページ |
2211 | https://www.nifs-k.ac.jp/campus-life/activities/record.html | 2262 | https://www.nifs-k.ac.jp/campus-life/activities/record.html |
2212 | */ | 2263 | */ |
2213 | body.itemid-795 .blog .cat-children { | 2264 | body.itemid-795 .blog .cat-children, |
2265 | body.itemid-795 .archive-custom .cat-children { | ||
2214 | display: none; | 2266 | display: none; |
2215 | } | 2267 | } |
2216 | 2268 | ||
... | @@ -2272,7 +2324,19 @@ body.itemid-795 .blog .cat-children { | ... | @@ -2272,7 +2324,19 @@ body.itemid-795 .blog .cat-children { |
2272 | .blog #wrap_sitemap a:link, | 2324 | .blog #wrap_sitemap a:link, |
2273 | .blog #wrap_sitemap a:active, | 2325 | .blog #wrap_sitemap a:active, |
2274 | .blog #wrap_sitemap a:hover, | 2326 | .blog #wrap_sitemap a:hover, |
2275 | .blog #wrap_sitemap a:visited { | 2327 | .blog #wrap_sitemap a:visited, |
2328 | |||
2329 | .archive-custom #wrap_sitemap ul li a, | ||
2330 | .archive-custom #wrap_sitemap ul li a:link, | ||
2331 | .archive-custom #wrap_sitemap ul li a:active, | ||
2332 | .archive-custom #wrap_sitemap ul li a:hover, | ||
2333 | .archive-custom #wrap_sitemap ul li a:visited, | ||
2334 | |||
2335 | .archive-custom #wrap_sitemap a, | ||
2336 | .archive-custom #wrap_sitemap a:link, | ||
2337 | .archive-custom #wrap_sitemap a:active, | ||
2338 | .archive-custom #wrap_sitemap a:hover, | ||
2339 | .archive-custom #wrap_sitemap a:visited { | ||
2276 | color: #003894; | 2340 | color: #003894; |
2277 | } | 2341 | } |
2278 | 2342 | ||
... | @@ -2350,17 +2414,20 @@ body.itemid-795 .blog .cat-children { | ... | @@ -2350,17 +2414,20 @@ body.itemid-795 .blog .cat-children { |
2350 | /* ------------------------------------------------------------------------- | 2414 | /* ------------------------------------------------------------------------- |
2351 | ブログ系(information) | 2415 | ブログ系(information) |
2352 | ------------------------------------------------------------------------- */ | 2416 | ------------------------------------------------------------------------- */ |
2353 | /*.blog .page-header h2 { | 2417 | /*.blog .page-header h2, |
2418 | .archive-custom .page-header h2 { | ||
2354 | margin-top: 30px; | 2419 | margin-top: 30px; |
2355 | font-size: 130%; | 2420 | font-size: 130%; |
2356 | padding-bottom: 17px; | 2421 | padding-bottom: 17px; |
2357 | padding-top: 17px; | 2422 | padding-top: 17px; |
2358 | }*/ | 2423 | }*/ |
2359 | .blog a:link, .blog a:active, .blog a:hover, .blog a:visited { | 2424 | .blog a:link, .blog a:active, .blog a:hover, .blog a:visited, |
2425 | .archive-custom a:link, .archive-custom a:active, .archive-custom a:hover, .archive-custom a:visited { | ||
2360 | color: #009fa8; | 2426 | color: #009fa8; |
2361 | } | 2427 | } |
2362 | 2428 | ||
2363 | body.itemid-792 .blog .cat-children { | 2429 | body.itemid-792 .blog .cat-children, |
2430 | body.itemid-792 .archive-custom .cat-children { | ||
2364 | display: none; | 2431 | display: none; |
2365 | } | 2432 | } |
2366 | 2433 | ||
... | @@ -3039,12 +3106,14 @@ body.itemid-132 table { | ... | @@ -3039,12 +3106,14 @@ body.itemid-132 table { |
3039 | } | 3106 | } |
3040 | 3107 | ||
3041 | .item-page .subnavi01 ol li, .item-page .subnavi01 ul li, | 3108 | .item-page .subnavi01 ol li, .item-page .subnavi01 ul li, |
3042 | .blog .subnavi01 ol li, .blog .subnavi01 ul li { | 3109 | .blog .subnavi01 ol li, .blog .subnavi01 ul li, |
3110 | .archive-custom .subnavi01 ol li, .archive-custom .subnavi01 ul li { | ||
3043 | width: auto; | 3111 | width: auto; |
3044 | margin-right: 30px; | 3112 | margin-right: 30px; |
3045 | } | 3113 | } |
3046 | .item-page .subnavi01 ul.style01 li, .item-page .subnavi01 ol.style01 li, | 3114 | .item-page .subnavi01 ul.style01 li, .item-page .subnavi01 ol.style01 li, |
3047 | .blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li { | 3115 | .blog .subnavi01 ul.style01 li, .blog .subnavi01 ol.style01 li, |
3116 | .archive-custom .subnavi01 ul.style01 li, .archive-custom .subnavi01 ol.style01 li { | ||
3048 | width: 100%; | 3117 | width: 100%; |
3049 | float: none; | 3118 | float: none; |
3050 | } | 3119 | } |
... | @@ -3186,7 +3255,7 @@ body.itemid-132 table { | ... | @@ -3186,7 +3255,7 @@ body.itemid-132 table { |
3186 | } | 3255 | } |
3187 | 3256 | ||
3188 | /*見出し*/ | 3257 | /*見出し*/ |
3189 | .item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2 { | 3258 | .item-page h2, body.com_monthlyarchive h2, .blog .page-header h2, .blog h2, .archive-custom .page-header h2, .archive-custom h2 { |
3190 | font-size: 130%; | 3259 | font-size: 130%; |
3191 | padding-bottom: 20px; | 3260 | padding-bottom: 20px; |
3192 | padding-top: 20px; | 3261 | padding-top: 20px; |
... | @@ -3271,12 +3340,12 @@ body.itemid-132 table { | ... | @@ -3271,12 +3340,12 @@ body.itemid-132 table { |
3271 | } | 3340 | } |
3272 | 3341 | ||
3273 | @media (max-width: 400px) { | 3342 | @media (max-width: 400px) { |
3274 | .item-page h2, .blog h2 { | 3343 | .item-page h2, .blog h2, .archive-custom h2 { |
3275 | font-size: 140%; | 3344 | font-size: 140%; |
3276 | padding-top: 20px; | 3345 | padding-top: 20px; |
3277 | padding-bottom: 20px; | 3346 | padding-bottom: 20px; |
3278 | } | 3347 | } |
3279 | .item-page h3, .blog h3 { | 3348 | .item-page h3, .blog h3, .archive-custom h3 { |
3280 | margin-bottom: 15px; | 3349 | margin-bottom: 15px; |
3281 | padding-left: 10px; | 3350 | padding-left: 10px; |
3282 | font-size: 120%; | 3351 | font-size: 120%; |
... | @@ -3419,4 +3488,37 @@ body.itemid-132 table { | ... | @@ -3419,4 +3488,37 @@ body.itemid-132 table { |
3419 | /* 上記の自動設定の、最大値を指定 */ | 3488 | /* 上記の自動設定の、最大値を指定 */ |
3420 | max-height: 75px; | 3489 | max-height: 75px; |
3421 | max-width: 100px; | 3490 | max-width: 100px; |
3491 | } | ||
3492 | |||
3493 | /* ------------------------------------------------------------------------- | ||
3494 | app/modules/mod_information_articles_archive_custom/tmpl/default.phpのスタイルを変更 | ||
3495 | ------------------------------------------------------------------------- */ | ||
3496 | .archive-module-custom { | ||
3497 | height: 460px; | ||
3498 | overflow: auto; | ||
3499 | } | ||
3500 | |||
3501 | #aside > .custom-archive-module { | ||
3502 | position: relative; | ||
3503 | } | ||
3504 | |||
3505 | #aside > .custom-archive-module:after { | ||
3506 | content: ' '; | ||
3507 | position: absolute; | ||
3508 | bottom: 12px; | ||
3509 | left: calc(50% - 6px); | ||
3510 | display: block; | ||
3511 | width: 12px; | ||
3512 | height: 12px; | ||
3513 | border: 2px solid; | ||
3514 | border-color: transparent transparent #009fa8 #009fa8; | ||
3515 | transform: rotate(-45deg); | ||
3516 | opacity: 0.6; | ||
3517 | border-radius: 4px; | ||
3518 | } | ||
3519 | |||
3520 | @media (max-width: 980px) { | ||
3521 | #aside > .custom-archive-module:after { | ||
3522 | bottom: 47px; | ||
3523 | } | ||
3422 | } | 3524 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -45,7 +45,7 @@ JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true) | ... | @@ -45,7 +45,7 @@ JHtml::_('script', 'template.js', array('version' => 'auto', 'relative' => true) |
45 | JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); | 45 | JHtml::_('script', 'jui/html5.js', array('version' => 'auto', 'relative' => true, 'conditional' => 'lt IE 9')); |
46 | 46 | ||
47 | // Add Stylesheets | 47 | // Add Stylesheets |
48 | JHtml::_('stylesheet', 'template.css', array('version' => '20200702001', 'relative' => true)); | 48 | JHtml::_('stylesheet', 'template.css', array('version' => '20200811002', 'relative' => true)); |
49 | 49 | ||
50 | 50 | ||
51 | // Use of Google Font | 51 | // Use of Google Font |
... | @@ -203,37 +203,53 @@ if ($this->params->get('logoFile')) { | ... | @@ -203,37 +203,53 @@ if ($this->params->get('logoFile')) { |
203 | <link rel="apple-touch-icon" href="/apple-touch-icon.png"> | 203 | <link rel="apple-touch-icon" href="/apple-touch-icon.png"> |
204 | 204 | ||
205 | <script> | 205 | <script> |
206 | jQuery(function($) { | 206 | window.onload = function() { |
207 | var obj = $("#aside"); | 207 | covid19RedicretTarget = document.querySelector('.covid-19-sub-menu.category-list'); |
208 | var offset = $(obj).offset(); | 208 | if (covid19RedicretTarget) window.location.href = '/covid-19.html'; |
209 | var topPadding = 135; | 209 | jQuery(function($) { |
210 | var sW = window.innerWidth; | 210 | var obj = $("#aside"); |
211 | var sH = window.innerHeight; | 211 | var sW = window.innerWidth; |
212 | var cW = obj.width(); | 212 | var sH = window.innerHeight; |
213 | var cH = obj.height(); | 213 | var cW = obj.width(); |
214 | var cwrapH = $("#c_wrap").height(); | 214 | var cH = obj.height(); |
215 | 215 | var cwrapH = $("#c_wrap").height(); | |
216 | if (cH) { | 216 | // 特定のページではスクロールしない |
217 | if (sH > cH) { | 217 | var excludedPages = [".record-page", ".information-page"]; |
218 | $(window).scroll(function() { | 218 | var excludedPagesSelector = excludedPages.join(', '); |
219 | if ($(window).scrollTop() > offset.top) { | 219 | var isExcluded = false; |
220 | if ($(window).scrollTop() < cwrapH) { | 220 | if (document.querySelector(excludedPagesSelector)) { |
221 | isExcluded = true; | ||
222 | } | ||
223 | var customHeight = $(".custom").height(); | ||
224 | var paddingTop = customHeight - 80; | ||
225 | |||
226 | if (cH) { | ||
227 | if (sH > cH) { | ||
228 | if (isExcluded) return false; | ||
229 | $(window).resize(function() { | ||
230 | customHeight = $(".custom").height(); | ||
231 | paddingTop = customHeight - 80; | ||
232 | }); | ||
233 | $(window).scroll(function() { | ||
234 | if ($(window).scrollTop() > customHeight) { | ||
235 | if ($(window).scrollTop() < cwrapH) { | ||
236 | $(obj).stop().animate({ | ||
237 | duration: 'fast', | ||
238 | marginTop: $(window).scrollTop() - paddingTop | ||
239 | }); | ||
240 | } else { | ||
241 | $(obj).stop().animate({}); | ||
242 | } | ||
243 | } else { | ||
221 | $(obj).stop().animate({ | 244 | $(obj).stop().animate({ |
222 | duration: 'fast', | 245 | marginTop: 0 |
223 | marginTop: $(window).scrollTop() - offset.top + topPadding | ||
224 | }); | 246 | }); |
225 | } else { | ||
226 | $(obj).stop().animate({}); | ||
227 | } | 247 | } |
228 | } else { | 248 | }); |
229 | $(obj).stop().animate({ | 249 | } |
230 | marginTop: 0 | ||
231 | }); | ||
232 | } | ||
233 | }); | ||
234 | } | 250 | } |
235 | } | 251 | }); |
236 | }); | 252 | }; |
237 | </script> | 253 | </script> |
238 | 254 | ||
239 | </head> | 255 | </head> |
... | @@ -673,8 +689,8 @@ if ($this->params->get('logoFile')) { | ... | @@ -673,8 +689,8 @@ if ($this->params->get('logoFile')) { |
673 | <li><a href="/entrance/selective/pe/ao.html">総合型選抜(SS)入試</a></li> | 689 | <li><a href="/entrance/selective/pe/ao.html">総合型選抜(SS)入試</a></li> |
674 | <li><a href="/entrance/selective/pe/recommendation.html">学校推薦型選抜</a></li> | 690 | <li><a href="/entrance/selective/pe/recommendation.html">学校推薦型選抜</a></li> |
675 | <li><a href="/entrance/selective/pe/exam.html">一般選抜</a></li> | 691 | <li><a href="/entrance/selective/pe/exam.html">一般選抜</a></li> |
676 | <li><a href="/entrance/selective/pe/returnee.html">帰国子女入試</a></li> | 692 | <li><a href="/entrance/selective/pe/returnee.html">帰国生徒選抜</a></li> |
677 | <li><a href="/entrance/selective/pe/society.html">社会人入試</a></li> | 693 | <li><a href="/entrance/selective/pe/society.html">社会人選抜</a></li> |
678 | <li><a href="/entrance/selective/pe/foreign.html">私費外国人留学生入試</a></li> | 694 | <li><a href="/entrance/selective/pe/foreign.html">私費外国人留学生入試</a></li> |
679 | <li><a href="/entrance/selective/pe/transfer.html">第3年次編入学試験</a></li> | 695 | <li><a href="/entrance/selective/pe/transfer.html">第3年次編入学試験</a></li> |
680 | </ul> | 696 | </ul> |
... | @@ -858,7 +874,7 @@ if ($this->params->get('logoFile')) { | ... | @@ -858,7 +874,7 @@ if ($this->params->get('logoFile')) { |
858 | <li><a href="/campus-life/activities/trainer.html">アスレティックトレーナー部</a></li> | 874 | <li><a href="/campus-life/activities/trainer.html">アスレティックトレーナー部</a></li> |
859 | <li><a href="/campus-life/activities/golf.html">ゴルフ部</a></li> | 875 | <li><a href="/campus-life/activities/golf.html">ゴルフ部</a></li> |
860 | <li><a href="/campus-life/activities/dance.html">ダンス部</a></li> | 876 | <li><a href="/campus-life/activities/dance.html">ダンス部</a></li> |
861 | <li><a href="/campus-life/activities/culture.html">伝統文化・スポーツ研究会</a></li> | 877 | <li><a href="/campus-life/activities/esports.html">eスポーツ競技・研究会</a></li> |
862 | </ul> | 878 | </ul> |
863 | </li> | 879 | </li> |
864 | <li><a href="/campus-life/activities/activities-apply.html" title="申請書様式(在学生向け)">申請書様式(在学生向け)</a></li> | 880 | <li><a href="/campus-life/activities/activities-apply.html" title="申請書様式(在学生向け)">申請書様式(在学生向け)</a></li> |
... | @@ -1450,6 +1466,7 @@ if ($this->params->get('logoFile')) { | ... | @@ -1450,6 +1466,7 @@ if ($this->params->get('logoFile')) { |
1450 | JRequest::getInt('Itemid') == 799 || | 1466 | JRequest::getInt('Itemid') == 799 || |
1451 | JRequest::getInt('Itemid') == 575 || | 1467 | JRequest::getInt('Itemid') == 575 || |
1452 | JRequest::getInt('Itemid') == 803 || | 1468 | JRequest::getInt('Itemid') == 803 || |
1469 | JRequest::getInt('Itemid') == 893 || | ||
1453 | $itemid == 871 || | 1470 | $itemid == 871 || |
1454 | JRequest::getInt('catid') == 142 | 1471 | JRequest::getInt('catid') == 142 |
1455 | ) : ?> | 1472 | ) : ?> | ... | ... |
-
Please register or sign in to post a comment