/** * 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. * * @return array An array of buttons * @since 1.6 */ public static function &getButtons() { if (empty(self::$buttons)) { self::$buttons = 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'), 'image' => 'header/icon-48-user-profile.png', 'text' => JText::_('MOD_QUICKICON_PROFILE'), 'access' => true)); } return self::$buttons; }
/** * 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. * * @return array An array of buttons * @since 1.6 */ public static function &getButtons() { if (empty(self::$buttons)) { // Load mod_quickicon language file in case this method is called before rendering the module JFactory::getLanguage()->load('mod_quickicon'); self::$buttons = 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)); // Include buttons defined by published quickicon plugins JPluginHelper::importPlugin('quickicon'); $app = JFactory::getApplication(); $response = $app->triggerEvent('onGetIcon'); if (!empty($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[] = $icon; } } } } return self::$buttons; }
<?php /** * @package Joomla.Administrator * @subpackage mod_quickicon * * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; require_once dirname(__FILE__) . '/helper.php'; $buttons = modQuickIconHelper::getButtons($params); require JModuleHelper::getLayoutPath('mod_quickicon', $params->get('layout', 'default'));
<?php /** * @version $Id$ * @package Joomla.Administrator * @subpackage mod_quickicon * @copyright Copyright (C) 2005 - 2011 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; $buttons = modQuickIconHelper::getButtons(); ?> <div id="cpanel"> <?php foreach ($buttons as $button) { echo modQuickIconHelper::button($button); } ?> </div>