32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-25 17:51:07 +00:00

apply changes

This commit is contained in:
zero-24 2017-03-24 12:51:56 +01:00
commit efc3e398d6
5 changed files with 95 additions and 0 deletions

View File

@ -20,6 +20,7 @@
<file type="module" id="mod_weblinks" client="site">mod_weblinks.zip</file>
<file type="plugin" id="weblinks" group="finder">plg_finder_weblinks.zip</file>
<file type="plugin" id="weblinks" group="search">plg_search_weblinks.zip</file>
<file type="plugin" id="weblinks" group="system">plg_system_weblinks.zip</file>
</files>
<languages folder="language">
<language tag="en-GB">en-GB/en-GB.pkg_weblinks.sys.ini</language>

View File

@ -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."

View File

@ -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."

View File

@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage Weblinks
*
* @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* System plugin for Joomla Web Links.
*
* @since __DEPLOY_VERSION__
*/
class PlgSystemWeblinks extends JPlugin
{
/**
* Load the language file on instantiation.
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $autoloadLanguage = true;
/**
* Method to add statistics information to Administrator control panel.
*
* @param string $extension The extension requesting information.
*
* @return array containing statistical information.
*
* @since __DEPLOY_VERSION__
*/
public function onGetStats($extension)
{
if (!JComponentHelper::isEnabled('com_weblinks'))
{
return array();
}
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('COUNT(id) AS count_links')
->from('#__weblinks')
->where('state = 1');
$webLinks = $db->setQuery($query)->loadResult();
if (!$webLinks)
{
return array();
}
return array(array(
'title' => JText::_('PLG_SYSTEM_WEBLINKS_STATISTICS'),
'icon' => 'out-2',
'data' => $webLinks
));
}
}

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<extension version="3.7" type="plugin" group="system" method="upgrade">
<name>plg_system_weblinks</name>
<author>Joomla! Project</author>
<creationDate>##DATE##</creationDate>
<copyright>(C) 2005 - ##YEAR## Open Source Matters. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>##VERSION##</version>
<description>PLG_SYSTEM_WEBLINKS_XML_DESCRIPTION</description>
<files>
##FILES##
</files>
<languages folder="language">
##LANGUAGE_FILES##
</languages>
</extension>