From 5bbbf6904dae4da185ec7b680fafd1868104749f Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Wed, 28 Dec 2016 16:50:29 +0000 Subject: [PATCH 1/7] Move weblinks stats to weblinks repo --- .../manifests/packages/pkg_weblinks.xml | 1 + src/pkg_weblinks.xml | 1 + .../en-GB/en-GB.plg_system_weblinks.ini | 8 +++ .../en-GB/en-GB.plg_system_weblinks.sys.ini | 7 ++ src/plugins/system/weblinks/weblinks.php | 66 +++++++++++++++++++ src/plugins/system/weblinks/weblinks.xml | 19 ++++++ 6 files changed, 102 insertions(+) create mode 100644 src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini create mode 100644 src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.sys.ini create mode 100644 src/plugins/system/weblinks/weblinks.php create mode 100644 src/plugins/system/weblinks/weblinks.xml diff --git a/src/administrator/manifests/packages/pkg_weblinks.xml b/src/administrator/manifests/packages/pkg_weblinks.xml index 88d01fe..13588c5 100644 --- a/src/administrator/manifests/packages/pkg_weblinks.xml +++ b/src/administrator/manifests/packages/pkg_weblinks.xml @@ -19,6 +19,7 @@ mod_weblinks.zip plg_finder_weblinks.zip plg_search_weblinks.zip + plg_system_weblinks.zip en-GB/en-GB.pkg_weblinks.sys.ini diff --git a/src/pkg_weblinks.xml b/src/pkg_weblinks.xml index 353e0ee..92308d3 100644 --- a/src/pkg_weblinks.xml +++ b/src/pkg_weblinks.xml @@ -19,6 +19,7 @@ mod_weblinks.zip plg_finder_weblinks.zip plg_search_weblinks.zip + plg_system_weblinks.zip en-GB/en-GB.pkg_weblinks.sys.ini diff --git a/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini new file mode 100644 index 0000000..5582ea3 --- /dev/null +++ b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini @@ -0,0 +1,8 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_WEBLINKS="System - Web Links" +PLG_SYSTEM_WEBLINKS_STATISTICS="Web Links" +PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION="This plugin returns statistical information about Joomla! Web Links." diff --git a/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.sys.ini b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.sys.ini new file mode 100644 index 0000000..f9e4af1 --- /dev/null +++ b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2016 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_WEBLINKS="System - Web Links" +PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION="This plugin returns statistical information about Joomla! Web Links." diff --git a/src/plugins/system/weblinks/weblinks.php b/src/plugins/system/weblinks/weblinks.php new file mode 100644 index 0000000..c6c10eb --- /dev/null +++ b/src/plugins/system/weblinks/weblinks.php @@ -0,0 +1,66 @@ +getQuery(true) + ->select('COUNT(id) AS count_links') + ->from('#__weblinks') + ->where('state = 1'); + $links = $db->setQuery($query)->loadResult(); + + if (!$links) + { + return array(); + } + + // Link to web links component page. + $adminLink = JUri::root() . 'administrator/index.php?option=com_weblinks&view=weblinks&filter[published]=1'; + + return array(array( + 'title' => JText::sprintf('PLG_SYSTEM_WEBLINKS_STATISTICS', $adminLink), + 'icon' => 'out-2', + 'data' => $links, + )); + } +} diff --git a/src/plugins/system/weblinks/weblinks.xml b/src/plugins/system/weblinks/weblinks.xml new file mode 100644 index 0000000..75d6326 --- /dev/null +++ b/src/plugins/system/weblinks/weblinks.xml @@ -0,0 +1,19 @@ + + + plg_system_weblinks + Joomla! Project + 2016-12-19 + (C) 2005 - 2016 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 3.6.0-beta + PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION + + weblinks.xml + language + weblinks.php + + + + From 896efa4a6a5ef947243eab42a0bbf0c8a0b28083 Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Thu, 29 Dec 2016 00:34:45 +0000 Subject: [PATCH 2/7] Remove link from language file --- .../weblinks/language/en-GB/en-GB.plg_system_weblinks.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini index 5582ea3..a2b402d 100644 --- a/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini +++ b/src/plugins/system/weblinks/language/en-GB/en-GB.plg_system_weblinks.ini @@ -4,5 +4,5 @@ ; Note : All ini files need to be saved as UTF-8 PLG_SYSTEM_WEBLINKS="System - Web Links" -PLG_SYSTEM_WEBLINKS_STATISTICS="Web Links" +PLG_SYSTEM_WEBLINKS_STATISTICS="Web Links" PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION="This plugin returns statistical information about Joomla! Web Links." From b7a90bad2ca97a3b8db4403f529894ac75e4dd91 Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Thu, 29 Dec 2016 23:48:23 +0000 Subject: [PATCH 3/7] Add link as separate entry in array --- src/plugins/system/weblinks/weblinks.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/system/weblinks/weblinks.php b/src/plugins/system/weblinks/weblinks.php index c6c10eb..1311d6a 100644 --- a/src/plugins/system/weblinks/weblinks.php +++ b/src/plugins/system/weblinks/weblinks.php @@ -54,13 +54,11 @@ class PlgSystemWeblinks extends JPlugin return array(); } - // Link to web links component page. - $adminLink = JUri::root() . 'administrator/index.php?option=com_weblinks&view=weblinks&filter[published]=1'; - return array(array( - 'title' => JText::sprintf('PLG_SYSTEM_WEBLINKS_STATISTICS', $adminLink), + 'title' => JText::sprintf('PLG_SYSTEM_WEBLINKS_STATISTICS'), 'icon' => 'out-2', 'data' => $links, + 'link' => JUri::root() . 'administrator/index.php?option=com_weblinks&view=weblinks&filter[published]=1', )); } } From 0e5dc69bc104f8a95636575776fc3e347979f6c3 Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Sat, 31 Dec 2016 22:15:43 +0000 Subject: [PATCH 4/7] Use JRoute instead --- src/plugins/system/weblinks/weblinks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/system/weblinks/weblinks.php b/src/plugins/system/weblinks/weblinks.php index 1311d6a..b05a66a 100644 --- a/src/plugins/system/weblinks/weblinks.php +++ b/src/plugins/system/weblinks/weblinks.php @@ -58,7 +58,7 @@ class PlgSystemWeblinks extends JPlugin 'title' => JText::sprintf('PLG_SYSTEM_WEBLINKS_STATISTICS'), 'icon' => 'out-2', 'data' => $links, - 'link' => JUri::root() . 'administrator/index.php?option=com_weblinks&view=weblinks&filter[published]=1', + 'link' => JRoute::_('index.php?option=com_weblinks&view=weblinks&filter[published]=1'), )); } } From 6caa06509ba6249cb624259e887c3051c2ae5bab Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Sun, 1 Jan 2017 22:36:14 +0000 Subject: [PATCH 5/7] Set version number --- src/plugins/system/weblinks/weblinks.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/system/weblinks/weblinks.php b/src/plugins/system/weblinks/weblinks.php index b05a66a..d83d3d7 100644 --- a/src/plugins/system/weblinks/weblinks.php +++ b/src/plugins/system/weblinks/weblinks.php @@ -14,7 +14,7 @@ use Joomla\Registry\Registry; /** * System plugin for Joomla Web Links. * - * @since __DEPLOY_VERSION__ + * @since 3.6.0 */ class PlgSystemWeblinks extends JPlugin { @@ -22,7 +22,7 @@ class PlgSystemWeblinks extends JPlugin * Load the language file on instantiation. * * @var boolean - * @since __DEPLOY_VERSION__ + * @since 3.6.0 */ protected $autoloadLanguage = true; @@ -33,7 +33,7 @@ class PlgSystemWeblinks extends JPlugin * * @return array containing statistical information. * - * @since __DEPLOY_VERSION__ + * @since 3.6.0 */ public function onGetStats($extension) { From c0d7a9407f3a9bcd79eae2a818f5bbc9f2c606d7 Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Mon, 2 Jan 2017 01:23:02 +0000 Subject: [PATCH 6/7] Use substitution codes in XML file --- src/plugins/system/weblinks/weblinks.xml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/system/weblinks/weblinks.xml b/src/plugins/system/weblinks/weblinks.xml index 75d6326..624a17f 100644 --- a/src/plugins/system/weblinks/weblinks.xml +++ b/src/plugins/system/weblinks/weblinks.xml @@ -2,18 +2,17 @@ plg_system_weblinks Joomla! Project - 2016-12-19 + ##DATE## (C) 2005 - 2016 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org - 3.6.0-beta + ##VERSION## PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION - weblinks.xml - language - weblinks.php + ##FILES## + ##LANGUAGE_FILES## From e6a50f1fdbbd65708b0d30dcd596a6ae9be1bd22 Mon Sep 17 00:00:00 2001 From: chrisdavenport Date: Mon, 2 Jan 2017 09:43:22 +0000 Subject: [PATCH 7/7] Missed the year --- src/plugins/system/weblinks/weblinks.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/system/weblinks/weblinks.xml b/src/plugins/system/weblinks/weblinks.xml index 624a17f..18f786b 100644 --- a/src/plugins/system/weblinks/weblinks.xml +++ b/src/plugins/system/weblinks/weblinks.xml @@ -3,7 +3,7 @@ plg_system_weblinks Joomla! Project ##DATE## - (C) 2005 - 2016 Open Source Matters. All rights reserved. + (C) 2005 - ##YEAR## Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org