first commit

This commit is contained in:
2025-06-17 11:53:18 +02:00
commit 9f0f7ba12b
8804 changed files with 1369176 additions and 0 deletions

View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="module" client="administrator" method="upgrade">
<name>mod_quickicon</name>
<author>Joomla! Project</author>
<creationDate>2005-11</creationDate>
<copyright>(C) 2005 Open Source Matters, Inc.</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>
<namespace path="src">Joomla\Module\Quickicon</namespace>
<files>
<folder module="mod_quickicon">services</folder>
<folder>src</folder>
<folder>tmpl</folder>
</files>
<languages>
<language tag="en-GB">language/en-GB/mod_quickicon.ini</language>
<language tag="en-GB">language/en-GB/mod_quickicon.sys.ini</language>
</languages>
<help key="Admin_Modules:_Quick_Icons" />
<config>
<fields name="params">
<fieldset name="basic">
<field
name="context"
type="text"
label="MOD_QUICKICON_GROUP_LABEL"
description="MOD_QUICKICON_GROUP_DESC"
default="mod_quickicon"
/>
<field
name="header_icon"
type="text"
label="MOD_QUICKICON_HEADER_ICON_LABEL"
hint="icon-crosshairs"
default=""
/>
<field
name="show_global"
type="radio"
label="MOD_QUICKICON_SHOW_GLOBAL_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_checkin"
type="list"
label="MOD_QUICKICON_SHOW_CHECKIN_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_cache"
type="list"
label="MOD_QUICKICON_SHOW_CACHE_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_users"
type="list"
label="MOD_QUICKICON_SHOW_USERS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_articles"
type="list"
label="MOD_QUICKICON_SHOW_ARTICLES_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_featured"
type="list"
label="MOD_QUICKICON_SHOW_FEATURED_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_menuitems"
type="list"
label="MOD_QUICKICON_SHOW_MENUITEMS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_workflow"
type="radio"
label="MOD_QUICKICON_SHOW_WORKFLOW_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_banners"
type="list"
label="MOD_QUICKICON_SHOW_BANNERS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_finder"
type="radio"
label="MOD_QUICKICON_SHOW_FINDER_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_newsfeeds"
type="list"
label="MOD_QUICKICON_SHOW_NEWSFEEDS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_tags"
type="list"
label="MOD_QUICKICON_SHOW_TAGS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_redirect"
type="radio"
label="MOD_QUICKICON_SHOW_REDIRECT_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_associations"
type="radio"
label="MOD_QUICKICON_SHOW_ASSOCIATIONS_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_languages"
type="list"
label="MOD_QUICKICON_SHOW_LANGUAGES_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_modules"
type="list"
label="MOD_QUICKICON_SHOW_MODULES_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_contact"
type="list"
label="MOD_QUICKICON_SHOW_CONTACT_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_categories"
type="list"
label="MOD_QUICKICON_SHOW_CATEGORIES_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_media"
type="radio"
label="MOD_QUICKICON_SHOW_MEDIA_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_menuitems"
type="list"
label="MOD_QUICKICON_SHOW_MENUITEMS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_plugins"
type="list"
label="MOD_QUICKICON_SHOW_PLUGINS_LABEL"
default="0"
validate="options"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
<option value="2">MOD_QUICKICON_WITH_COUNT</option>
</field>
<field
name="show_template_styles"
type="radio"
label="MOD_QUICKICON_SHOW_TEMPLATE_STYLES_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_template_code"
type="radio"
label="MOD_QUICKICON_SHOW_TEMPLATE_CODE_LABEL"
layout="joomla.form.field.radio.switcher"
default="0"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
<fieldset name="advanced">
<field
name="layout"
type="modulelayout"
label="JFIELD_ALT_LAYOUT_LABEL"
class="form-select"
validate="moduleLayout"
/>
<field
name="moduleclass_sfx"
type="textarea"
label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
rows="3"
validate="CssIdentifier"
/>
<field
name="cache"
type="list"
label="COM_MODULES_FIELD_CACHING_LABEL"
default="0"
filter="integer"
validate="options"
>
<option value="1">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
</field>
<field
name="cache_time"
type="number"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
default="900"
filter="integer"
min="1"
validate="number"
/>
</fieldset>
</fields>
</config>
</extension>

View File

@ -0,0 +1,41 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
\defined('_JEXEC') or die;
use Joomla\CMS\Extension\Service\Provider\HelperFactory;
use Joomla\CMS\Extension\Service\Provider\Module;
use Joomla\CMS\Extension\Service\Provider\ModuleDispatcherFactory;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* The quickicon module service provider.
*
* @since 4.0.0
*/
return new class () implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since 4.0.0
*/
public function register(Container $container)
{
$container->registerServiceProvider(new ModuleDispatcherFactory('\\Joomla\\Module\\Quickicon'));
$container->registerServiceProvider(new HelperFactory('\\Joomla\\Module\\Quickicon\\Administrator\\Helper'));
$container->registerServiceProvider(new Module());
}
};

View File

@ -0,0 +1,45 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
*
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Quickicon\Administrator\Dispatcher;
use Joomla\CMS\Dispatcher\AbstractModuleDispatcher;
use Joomla\CMS\Helper\HelperFactoryAwareInterface;
use Joomla\CMS\Helper\HelperFactoryAwareTrait;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Dispatcher class for mod_quickicon
*
* @since 4.0.0
*/
class Dispatcher extends AbstractModuleDispatcher implements HelperFactoryAwareInterface
{
use HelperFactoryAwareTrait;
/**
* Returns the layout data.
*
* @return array
*
* @since 4.0.0
*/
protected function getLayoutData()
{
$data = parent::getLayoutData();
$data['buttons'] = $this->getHelperFactory()->getHelper('QuickIconHelper')->getButtons($data['params'], $this->getApplication());
return $data;
}
}

View File

@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
*
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Quickicon\Administrator\Event;
use Joomla\CMS\Event\AbstractEvent;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Event object for retrieving pluggable quick icons
*
* @since 4.0.0
*/
class QuickIconsEvent extends AbstractEvent
{
/**
* The event context
*
* @var string
* @since 4.0.0
*/
private $context;
/**
* Get the event context
*
* @return string
*
* @since 4.0.0
*/
public function getContext()
{
return $this->context;
}
/**
* Set the event context
*
* @param string $context The event context
*
* @return string
*
* @since 4.0.0
*/
public function setContext($context)
{
$this->context = $context;
return $context;
}
}

View File

@ -0,0 +1,418 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Module\Quickicon\Administrator\Helper;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Module\Quickicon\Administrator\Event\QuickIconsEvent;
use Joomla\Registry\Registry;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* Helper for mod_quickicon
*
* @since 1.6
*/
class QuickIconHelper
{
/**
* Stack to hold buttons
*
* @var array[]
* @since 1.6
*/
protected $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.
*
* @param Registry $params The module parameters
* @param ?CMSApplication $application The application
*
* @return array An array of buttons
*
* @since 1.6
*/
public function getButtons(Registry $params, CMSApplication $application = null)
{
if ($application == null) {
$application = Factory::getApplication();
}
$key = (string) $params;
$context = (string) $params->get('context', 'mod_quickicon');
if (!isset($this->buttons[$key])) {
// Load mod_quickicon language file in case this method is called before rendering the module
$application->getLanguage()->load('mod_quickicon');
$this->buttons[$key] = [];
if ($params->get('show_users')) {
$tmp = [
'image' => 'icon-users',
'link' => Route::_('index.php?option=com_users&view=users'),
'linkadd' => Route::_('index.php?option=com_users&task=user.add'),
'name' => 'MOD_QUICKICON_USER_MANAGER',
'access' => ['core.manage', 'com_users', 'core.create', 'com_users'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_users') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_users&amp;task=users.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_menuitems')) {
$tmp = [
'image' => 'icon-list',
'link' => Route::_('index.php?option=com_menus&view=items&menutype='),
'linkadd' => Route::_('index.php?option=com_menus&task=item.add'),
'name' => 'MOD_QUICKICON_MENUITEMS_MANAGER',
'access' => ['core.manage', 'com_menus', 'core.create', 'com_menus'],
'group' => 'MOD_QUICKICON_STRUCTURE',
];
if ($params->get('show_menuitems') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_menus&amp;task=items.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_articles')) {
$tmp = [
'image' => 'icon-file-alt',
'link' => Route::_('index.php?option=com_content&view=articles'),
'linkadd' => Route::_('index.php?option=com_content&task=article.add'),
'name' => 'MOD_QUICKICON_ARTICLE_MANAGER',
'access' => ['core.manage', 'com_content', 'core.create', 'com_content'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_articles') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_content&amp;task=articles.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if (ComponentHelper::isEnabled('com_tags') && $params->get('show_tags')) {
$tmp = [
'image' => 'icon-tag',
'link' => Route::_('index.php?option=com_tags&view=tags'),
'linkadd' => Route::_('index.php?option=com_tags&task=tag.edit'),
'name' => 'MOD_QUICKICON_TAGS_MANAGER',
'access' => ['core.manage', 'com_tags', 'core.create', 'com_tags'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_tags') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_tags&amp;task=tags.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_categories')) {
$tmp = [
'image' => 'icon-folder-open',
'link' => Route::_('index.php?option=com_categories&view=categories&extension=com_content'),
'linkadd' => Route::_('index.php?option=com_categories&task=category.add'),
'name' => 'MOD_QUICKICON_CATEGORY_MANAGER',
'access' => ['core.manage', 'com_content', 'core.create', 'com_content'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_categories') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_categories&amp;task=categories.getQuickiconContent&amp;extension=content&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_media')) {
$this->buttons[$key][] = [
'image' => 'icon-images',
'link' => Route::_('index.php?option=com_media'),
'name' => 'MOD_QUICKICON_MEDIA_MANAGER',
'access' => ['core.manage', 'com_media'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if ($params->get('show_modules')) {
$tmp = [
'image' => 'icon-cube',
'link' => Route::_('index.php?option=com_modules&view=modules&client_id=0'),
'linkadd' => Route::_('index.php?option=com_modules&view=select&client_id=0'),
'name' => 'MOD_QUICKICON_MODULE_MANAGER',
'access' => ['core.manage', 'com_modules'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_modules') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_modules&amp;task=modules.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_plugins')) {
$tmp = [
'image' => 'icon-plug',
'link' => Route::_('index.php?option=com_plugins'),
'name' => 'MOD_QUICKICON_PLUGIN_MANAGER',
'access' => ['core.manage', 'com_plugins'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_plugins') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_plugins&amp;task=plugins.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_template_styles')) {
$this->buttons[$key][] = [
'image' => 'icon-paint-brush',
'link' => Route::_('index.php?option=com_templates&view=styles&client_id=0'),
'name' => 'MOD_QUICKICON_TEMPLATE_STYLES',
'access' => ['core.admin', 'com_templates'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if ($params->get('show_template_code')) {
$this->buttons[$key][] = [
'image' => 'icon-code',
'link' => Route::_('index.php?option=com_templates&view=templates&client_id=0'),
'name' => 'MOD_QUICKICON_TEMPLATE_CODE',
'access' => ['core.admin', 'com_templates'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if ($params->get('show_checkin')) {
$tmp = [
'image' => 'icon-unlock-alt',
'link' => Route::_('index.php?option=com_checkin'),
'name' => 'MOD_QUICKICON_CHECKINS',
'access' => ['core.admin', 'com_checkin'],
'group' => 'MOD_QUICKICON_SYSTEM',
];
if ($params->get('show_checkin') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_checkin&amp;task=getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_cache')) {
$tmp = [
'image' => 'icon-cloud',
'link' => Route::_('index.php?option=com_cache'),
'name' => 'MOD_QUICKICON_CACHE',
'access' => ['core.admin', 'com_cache'],
'group' => 'MOD_QUICKICON_SYSTEM',
];
if ($params->get('show_cache') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_cache&amp;task=display.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_global')) {
$this->buttons[$key][] = [
'image' => 'icon-cog',
'link' => Route::_('index.php?option=com_config'),
'name' => 'MOD_QUICKICON_GLOBAL_CONFIGURATION',
'access' => ['core.manage', 'com_config', 'core.admin', 'com_config'],
'group' => 'MOD_QUICKICON_SYSTEM',
];
}
if ($params->get('show_featured')) {
$tmp = [
'image' => 'icon-star featured',
'link' => Route::_('index.php?option=com_content&view=featured'),
'name' => 'MOD_QUICKICON_FEATURED_MANAGER',
'access' => ['core.manage', 'com_content'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_featured') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_content&amp;task=featured.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if ($params->get('show_workflow')) {
$this->buttons[$key][] = [
'image' => 'icon-file-alt contact',
'link' => Route::_('index.php?option=com_workflow&view=workflows&extension=com_content.article'),
'linkadd' => Route::_('index.php?option=com_workflow&view=workflow&layout=edit&extension=com_content.article'),
'name' => 'MOD_QUICKICON_WORKFLOW_MANAGER',
'access' => ['core.manage', 'com_workflow', 'core.create', 'com_workflow'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if (ComponentHelper::isEnabled('com_banners') && $params->get('show_banners')) {
$tmp = [
'image' => 'icon-bookmark banners',
'link' => Route::_('index.php?option=com_banners&view=banners'),
'linkadd' => Route::_('index.php?option=com_banners&view=banner&layout=edit'),
'name' => 'MOD_QUICKICON_BANNER_MANAGER',
'access' => ['core.manage', 'com_banners', 'core.create', 'com_banners'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_banners') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_banners&amp;task=banners.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if (ComponentHelper::isEnabled('com_contact') && $params->get('show_contact')) {
$tmp = [
'image' => 'icon-address-book contact',
'link' => Route::_('index.php?option=com_contact&view=contacts'),
'linkadd' => Route::_('index.php?option=com_contact&view=contact&layout=edit'),
'name' => 'MOD_QUICKICON_CONTACT_MANAGER',
'access' => ['core.manage', 'com_contact', 'core.create', 'com_contact'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_contact') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_contact&amp;task=contacts.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if (ComponentHelper::isEnabled('com_newsfeeds') && $params->get('show_newsfeeds')) {
$tmp = [
'image' => 'icon-rss newsfeeds',
'link' => Route::_('index.php?option=com_newsfeeds&view=newsfeeds'),
'linkadd' => Route::_('index.php?option=com_newsfeeds&view=newsfeed&layout=edit'),
'name' => 'MOD_QUICKICON_NEWSFEEDS_MANAGER',
'access' => ['core.manage', 'com_newsfeeds', 'core.create', 'com_newsfeeds'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_newsfeeds') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_newsfeeds&amp;task=newsfeeds.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
if (ComponentHelper::isEnabled('com_redirect') && $params->get('show_redirect')) {
$this->buttons[$key][] = [
'image' => 'icon-map-signs redirect',
'link' => Route::_('index.php?option=com_redirect&view=links'),
'linkadd' => Route::_('index.php?option=com_redirect&view=link&layout=edit'),
'name' => 'MOD_QUICKICON_REDIRECT_MANAGER',
'access' => ['core.manage', 'com_redirect', 'core.create', 'com_redirect'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if (ComponentHelper::isEnabled('com_associations') && $params->get('show_associations')) {
$this->buttons[$key][] = [
'image' => 'icon-language',
'link' => Route::_('index.php?option=com_associations&view=associations'),
'name' => 'MOD_QUICKICON_ASSOCIATIONS_MANAGER',
'access' => ['core.manage', 'com_associations'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if (ComponentHelper::isEnabled('com_finder') && $params->get('show_finder')) {
$this->buttons[$key][] = [
'image' => 'icon-search-plus finder',
'link' => Route::_('index.php?option=com_finder&view=index'),
'name' => 'MOD_QUICKICON_FINDER_MANAGER',
'access' => ['core.manage', 'com_finder'],
'group' => 'MOD_QUICKICON_SITE',
];
}
if ($params->get('show_languages')) {
$tmp = [
'image' => 'icon-comments langmanager',
'link' => Route::_('index.php?option=com_languages&view=languages'),
'linkadd' => Route::_('index.php?option=com_installer&view=languages'),
'name' => 'MOD_QUICKICON_LANGUAGES_MANAGER',
'access' => ['core.manage', 'com_languages'],
'group' => 'MOD_QUICKICON_SITE',
];
if ($params->get('show_languages') == 2) {
$tmp['ajaxurl'] = 'index.php?option=com_languages&amp;task=languages.getQuickiconContent&amp;format=json';
}
$this->buttons[$key][] = $tmp;
}
PluginHelper::importPlugin('quickicon');
$arrays = (array) $application->triggerEvent(
'onGetIcons',
new QuickIconsEvent('onGetIcons', ['context' => $context])
);
foreach ($arrays as $response) {
if (!\is_array($response)) {
continue;
}
foreach ($response as $icon) {
$default = [
'link' => null,
'image' => null,
'text' => null,
'name' => null,
'linkadd' => null,
'access' => true,
'class' => null,
'group' => 'MOD_QUICKICON',
];
$icon = array_merge($default, $icon);
if (!\is_null($icon['link']) && (!\is_null($icon['text']) || !\is_null($icon['name']))) {
$this->buttons[$key][] = $icon;
}
}
}
}
return $this->buttons[$key];
}
}

View File

@ -0,0 +1,30 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage mod_quickicon
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
$wa->useScript('core')
->useScript('bootstrap.dropdown');
$wa->registerAndUseScript('mod_quickicon', 'mod_quickicon/quickicon.min.js', ['relative' => true, 'version' => 'auto'], ['type' => 'module']);
$html = HTMLHelper::_('icons.buttons', $buttons);
?>
<?php if (!empty($html)) : ?>
<nav class="quick-icons px-3 pb-3" aria-label="<?php echo Text::_('MOD_QUICKICON_NAV_LABEL') . ' ' . $module->title; ?>">
<ul class="nav flex-wrap">
<?php echo $html; ?>
</ul>
</nav>
<?php endif; ?>