You've already forked joomla_test
first commit
This commit is contained in:
194
administrator/modules/mod_quickicon/helper.php
Normal file
194
administrator/modules/mod_quickicon/helper.php
Normal file
@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_quickicon
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
/**
|
||||
* Helper for mod_quickicon
|
||||
*
|
||||
* @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 JObject $params 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' => 'file-add',
|
||||
'icon' => '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' => 'pencil-2',
|
||||
'icon' => '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' => 'folder',
|
||||
'icon' => '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' => 'pictures',
|
||||
'icon' => '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' => 'list-view',
|
||||
'icon' => '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' => 'address',
|
||||
'icon' => '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' => 'cube',
|
||||
'icon' => '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' => 'puzzle',
|
||||
'icon' => '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' => 'comments-2',
|
||||
'icon' => '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' => 'cog',
|
||||
'icon' => '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' => 'eye',
|
||||
'icon' => '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' => 'vcard',
|
||||
'icon' => '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' => 'cog',
|
||||
'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 JObject $params The module parameters.
|
||||
* @param JObject $module 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;
|
||||
}
|
||||
}
|
||||
}
|
1
administrator/modules/mod_quickicon/index.html
Normal file
1
administrator/modules/mod_quickicon/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
16
administrator/modules/mod_quickicon/mod_quickicon.php
Normal file
16
administrator/modules/mod_quickicon/mod_quickicon.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_quickicon
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 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 __DIR__ . '/helper.php';
|
||||
|
||||
$buttons = ModQuickIconHelper::getButtons($params);
|
||||
|
||||
require JModuleHelper::getLayoutPath('mod_quickicon', $params->get('layout', 'default'));
|
83
administrator/modules/mod_quickicon/mod_quickicon.xml
Normal file
83
administrator/modules/mod_quickicon/mod_quickicon.xml
Normal file
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension
|
||||
type="module"
|
||||
version="3.1"
|
||||
client="administrator">
|
||||
<name>mod_quickicon</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>Nov 2005</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2013 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>3.0.0</version>
|
||||
<description>MOD_QUICKICON_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename module="mod_quickicon">mod_quickicon.php</filename>
|
||||
<filename>helper.php</filename>
|
||||
<filename>index.html</filename>
|
||||
<folder>tmpl</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.mod_quickicon.ini</language>
|
||||
<language tag="en-GB">en-GB.mod_quickicon.sys.ini</language>
|
||||
</languages>
|
||||
<help key="JHELP_EXTENSIONS_MODULE_MANAGER_ADMIN_QUICKICON" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field name="context"
|
||||
type="text"
|
||||
default="mod_quickicon"
|
||||
description="MOD_QUICKICON_GROUP_DESC"
|
||||
label="MOD_QUICKICON_GROUP_LABEL"
|
||||
/>
|
||||
</fieldset>
|
||||
<fieldset name="advanced">
|
||||
<field
|
||||
name="layout"
|
||||
type="modulelayout"
|
||||
label="JFIELD_ALT_LAYOUT_LABEL"
|
||||
description="JFIELD_ALT_MODULE_LAYOUT_DESC" />
|
||||
|
||||
<field
|
||||
name="moduleclass_sfx"
|
||||
type="textarea" rows="3"
|
||||
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
|
||||
description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
|
||||
|
||||
<field
|
||||
name="cache"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_MODULES_FIELD_CACHING_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHING_DESC">
|
||||
<option
|
||||
value="1">JGLOBAL_USE_GLOBAL</option>
|
||||
<option
|
||||
value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="cache_time"
|
||||
type="text"
|
||||
default="900"
|
||||
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
|
||||
description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
|
||||
|
||||
<field
|
||||
name="automatic_title"
|
||||
type="radio"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
label="COM_MODULES_FIELD_AUTOMATIC_TITLE_LABEL"
|
||||
description="COM_MODULES_FIELD_AUTOMATIC_TITLE_DESC">
|
||||
<option
|
||||
value="0">JNO</option>
|
||||
<option
|
||||
value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
18
administrator/modules/mod_quickicon/tmpl/default.php
Normal file
18
administrator/modules/mod_quickicon/tmpl/default.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage mod_quickicon
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
$html = JHtml::_('icons.buttons', $buttons);
|
||||
?>
|
||||
<?php if (!empty($html)) : ?>
|
||||
<div class="row-striped">
|
||||
<?php echo $html;?>
|
||||
</div>
|
||||
<?php endif;?>
|
1
administrator/modules/mod_quickicon/tmpl/index.html
Normal file
1
administrator/modules/mod_quickicon/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
Reference in New Issue
Block a user