__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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  com_menus
 *
 * @copyright   (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\Component\Menus\Administrator\Field;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\Language\Text;
use Joomla\Database\ParameterType;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * Menu Ordering field.
 *
 * @since  1.6
 */
class MenuOrderingField extends ListField
{
    /**
     * The form field type.
     *
     * @var        string
     * @since   1.7
     */
    protected $type = 'MenuOrdering';

    /**
     * Method to get the list of siblings in a menu.
     * The method requires that parent be set.
     *
     * @return  array|boolean  The field option objects or false if the parent field has not been set
     *
     * @since   1.7
     */
    protected function getOptions()
    {
        $options = [];

        // Get the parent
        $parent_id = (int) $this->form->getValue('parent_id', 0);

        if (!$parent_id) {
            return false;
        }

        $db    = $this->getDatabase();
        $query = $db->getQuery(true)
            ->select(
                [
                    $db->quoteName('a.id', 'value'),
                    $db->quoteName('a.title', 'text'),
                    $db->quoteName('a.client_id', 'clientId'),
                ]
            )
            ->from($db->quoteName('#__menu', 'a'))

            ->where($db->quoteName('a.published') . ' >= 0')
            ->where($db->quoteName('a.parent_id') . ' = :parentId')
            ->bind(':parentId', $parent_id, ParameterType::INTEGER);

        if ($menuType = $this->form->getValue('menutype')) {
            $query->where($db->quoteName('a.menutype') . ' = :menuType')
                ->bind(':menuType', $menuType);
        } else {
            $query->where($db->quoteName('a.menutype') . ' != ' . $db->quote(''));
        }

        $query->order($db->quoteName('a.lft') . ' ASC');

        // Get the options.
        $db->setQuery($query);

        try {
            $options = $db->loadObjectList();
        } catch (\RuntimeException $e) {
            Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
        }

        // Allow translation of custom admin menus
        foreach ($options as &$option) {
            if ($option->clientId != 0) {
                $option->text = Text::_($option->text);
            }
        }

        $options = array_merge(
            [['value' => '-1', 'text' => Text::_('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_FIRST')]],
            $options,
            [['value' => '-2', 'text' => Text::_('COM_MENUS_ITEM_FIELD_ORDERING_VALUE_LAST')]]
        );

        // Merge any additional options in the XML definition.
        $options = array_merge(parent::getOptions(), $options);

        return $options;
    }

    /**
     * Method to get the field input markup.
     *
     * @return  string  The field input markup.
     *
     * @since   1.7
     */
    protected function getInput()
    {
        if ($this->form->getValue('id', 0) == 0) {
            return '<span class="readonly">' . Text::_('COM_MENUS_ITEM_FIELD_ORDERING_TEXT') . '</span>';
        }

        return parent::getInput();
    }
}

Filemanager

Name Type Size Permission Actions
Modal Folder 0775
MenuItemByComponentField.php File 2.7 KB 0664
MenuItemByTypeField.php File 7.9 KB 0664
MenuOrderingField.php File 3.35 KB 0664
MenuParentField.php File 3.53 KB 0664
MenuPresetField.php File 1.25 KB 0664
MenutypeField.php File 4.37 KB 0664
Filemanager