AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.112
Web Server : Apache
System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/coopiak/amisdesseniors-fr/biarritz/plugins/system/regularlabs/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/coopiak/amisdesseniors-fr/biarritz/plugins/system/regularlabs/src/AdminMenu.php
<?php
/**
 * @package         Regular Labs Library
 * @version         25.9.9174
 * 
 * @author          Peter van Westen <info@regularlabs.com>
 * @link            https://regularlabs.com
 * @copyright       Copyright © 2025 Regular Labs All Rights Reserved
 * @license         GNU General Public License version 2 or later
 */

namespace RegularLabs\Plugin\System\RegularLabs;

defined('_JEXEC') or die;

use Joomla\CMS\Factory as JFactory;
use RegularLabs\Library\RegEx as RL_RegEx;

class AdminMenu
{
    public static function combine(): void
    {
        $params = Params::get();

        if ( ! $params->combine_admin_menu)
        {
            return;
        }

        $html = JFactory::getApplication()->getBody();

        if ($html == '')
        {
            return;
        }

        if (
            ! str_contains($html, '<nav class="main-nav-container"')
            || ! str_contains($html, '">Regular Labs - ')
        )
        {
            return;
        }

        if ( ! RL_RegEx::matchAll(
            '<li class="item item-level-2"><a class="no-dropdown"[^>]*"Regular Labs - .*?</a></li>',
            $html,
            $matches,
            null,
            PREG_PATTERN_ORDER
        )
        )
        {
            return;
        }

        $menu_items = $matches[0];

        if (count($menu_items) < 2)
        {
            return;
        }

        $manager = null;

        foreach ($menu_items as $i => &$menu_item)
        {
            $menu_item = str_replace('item-level-2', 'item-level-3', $menu_item);
            $menu_item = str_replace('Regular Labs - ', '', $menu_item);

            if (str_contains($menu_item, 'index.php?option=com_regularlabsmanager'))
            {
                $manager = $menu_item;
                unset($menu_items[$i]);
            }
        }

        $main_link = '#';

        if ( ! is_null($manager))
        {
            array_unshift($menu_items, $manager);
            $main_link = 'href="index.php?option=com_regularlabsmanager"';
        }

        $new_menu_item =
            '<li class="item parent item-level-2">'
            . '<a class="has-arrow" href=" ' . $main_link . '" aria-label="Regular Labs"><span class="sidebar-item-title">Regular Labs</span></a>'
            . "\n" . '<ul id="menu-regularlabs" class="mm-collapse collapse-level-2">'
            . "\n" . implode("\n", $menu_items)
            . "\n" . '</ul>'
            . '</li>';

        $first = array_shift($matches[0]);

        $html = str_replace($first, $new_menu_item, $html);
        $html = str_replace($matches[0], '', $html);

        JFactory::getApplication()->setBody($html);
    }
}

Anon7 - 2022
AnonSec Team