Sindbad~EG File Manager

Current Path : /home/sarayaglobal/saraya.com.au/plugins/system/advancedmodules/
Upload File :
Current File : /home/sarayaglobal/saraya.com.au/plugins/system/advancedmodules/script.install.php

<?php
/**
 * @package         Advanced Module Manager
 * @version         9.5.8
 * 
 * @author          Peter van Westen <info@regularlabs.com>
 * @link            http://regularlabs.com
 * @copyright       Copyright © 2023 Regular Labs All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory as JFactory;

class PlgSystemAdvancedModulesInstallerScript
{
    public function postflight($install_type, $adapter)
    {
        if ( ! in_array($install_type, ['install', 'update']))
        {
            return true;
        }

        self::setPluginOrdering();

        return true;
    }

    private static function setPluginOrdering()
    {
        $db = JFactory::getDbo();

        $query = $db->getQuery(true)
            ->update('#__extensions')
            ->set($db->quoteName('ordering') . ' = -1')
            ->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
            ->where($db->quoteName('element') . ' = ' . $db->quote('advancedmodules'))
            ->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
        $db->setQuery($query);
        $db->execute();

        JFactory::getCache()->clean('_system');
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists