- md5
- d69a132d4a3a13957f269eb01ceddeec
- sha1
- e970ce3a60310d85ae1514645cc3171312df333f
- sha256
- 4bd1f2eeb4d127bc3ee94a9d4c730ce98216400ebb67b3eeb94bc9d44e07ee48
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access.
defined('_JEXEC') or die;
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
* @since 1.6
*/
abstract class modQuickIconHelper
{
/**
* Stack to hold buttons
*
* @since 1.6
*/
protected static $buttons = array();
/**
* Helper method to return button list.
*
* This method returns the array by reference so it can be
* used to add custom buttons or remove default ones.
*
* @param JRegistry The module parameters.
*
* @return array An array of buttons
* @since 1.6
*/
public static function &getButtons($params)
{
$key = (string)$params;
if (!isset(self::$buttons[$key])) {
$context = $params->get('context', 'mod_quickicon');
if ($context == 'mod_quickicon')
{
// Load mod_quickicon language file in case this method is called before rendering the module
JFactory::getLanguage()->load('mod_quickicon');
self::$buttons[$key] = array(
array(
'link' => JRoute::_('index.php?option=com_content&task=article.add'),
'image' => 'header/icon-48-article-add.png',
'text' => JText::_('MOD_QUICKICON_ADD_NEW_ARTICLE'),
'access' => array('core.manage', 'com_content', 'core.create', 'com_content', )
),
array(
'link' => JRoute::_('index.php?option=com_content'),
'image' => 'header/icon-48-article.png',
'text' => JText::_('MOD_QUICKICON_ARTICLE_MANAGER'),
'access' => array('core.manage', 'com_content')
),
array(
'link' => JRoute::_('index.php?option=com_categories&extension=com_content'),
'image' => 'header/icon-48-category.png',
'text' => JText::_('MOD_QUICKICON_CATEGORY_MANAGER'),
'access' => array('core.manage', 'com_content')
),
array(
'link' => JRoute::_('index.php?option=com_media'),
'image' => 'header/icon-48-media.png',
'text' => JText::_('MOD_QUICKICON_MEDIA_MANAGER'),
'access' => array('core.manage', 'com_media')
),
array(
'link' => JRoute::_('index.php?option=com_menus'),
'image' => 'header/icon-48-menumgr.png',
'text' => JText::_('MOD_QUICKICON_MENU_MANAGER'),
'access' => array('core.manage', 'com_menus')
),
array(
'link' => JRoute::_('index.php?option=com_users'),
'image' => 'header/icon-48-user.png',
'text' => JText::_('MOD_QUICKICON_USER_MANAGER'),
'access' => array('core.manage', 'com_users')
),
array(
'link' => JRoute::_('index.php?option=com_modules'),
'image' => 'header/icon-48-module.png',
'text' => JText::_('MOD_QUICKICON_MODULE_MANAGER'),
'access' => array('core.manage', 'com_modules')
),
array(
'link' => JRoute::_('index.php?option=com_installer'),
'image' => 'header/icon-48-extension.png',
'text' => JText::_('MOD_QUICKICON_EXTENSION_MANAGER'),
'access' => array('core.manage', 'com_installer')
),
array(
'link' => JRoute::_('index.php?option=com_languages'),
'image' => 'header/icon-48-language.png',
'text' => JText::_('MOD_QUICKICON_LANGUAGE_MANAGER'),
'access' => array('core.manage', 'com_languages')
),
array(
'link' => JRoute::_('index.php?option=com_config'),
'image' => 'header/icon-48-config.png',
'text' => JText::_('MOD_QUICKICON_GLOBAL_CONFIGURATION'),
'access' => array('core.manage', 'com_config', 'core.admin', 'com_config')
),
array(
'link' => JRoute::_('index.php?option=com_templates'),
'image' => 'header/icon-48-themes.png',
'text' => JText::_('MOD_QUICKICON_TEMPLATE_MANAGER'),
'access' => array('core.manage', 'com_templates')
),
array(
'link' => JRoute::_('index.php?option=com_admin&task=profile.edit&id='.JFactory::getUser()->id),
'image' => 'header/icon-48-user-profile.png',
'text' => JText::_('MOD_QUICKICON_PROFILE'),
'access' => true
),
);
}
else
{
self::$buttons[$key] = array();
}
// Include buttons defined by published quickicon plugins
JPluginHelper::importPlugin('quickicon');
$app = JFactory::getApplication();
$arrays = (array) $app->triggerEvent('onGetIcons', array($context));
foreach ($arrays as $response) {
foreach ($response as $icon) {
$default = array(
'link' => null,
'image' => 'header/icon-48-config.png',
'text' => null,
'access' => true
);
$icon = array_merge($default, $icon);
if (!is_null($icon['link']) && !is_null($icon['text'])) {
self::$buttons[$key][] = $icon;
}
}
}
}
return self::$buttons[$key];
}
/**
* Get the alternate title for the module
*
* @param JRegistry The module parameters.
* @param object The module.
*
* @return string The alternate title for the module.
*/
public static function getTitle($params, $module)
{
$key = $params->get('context', 'mod_quickicon') . '_title';
if (JFactory::getLanguage()->hasKey($key))
{
return JText::_($key);
}
else
{
return $module->title;
}
}
}
The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.