<commit_before><?php
use Cake\Event\Event;
use Cake\Event\EventManager;
/**
 * This is elements/admin_sidebar template file. 
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil
 * @subpackage    lil.views.elements
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
if (empty($admin_sidebar)) {
	$admin_sidebar = [
		'welcome' => [
			'title'   => __d('lil', 'Dashboard'),
			'visible' => true,
			'active'  => false,
			'url'     => '/',
			'items'   => [],
		],
	];
}

class Sidebar {
	public $sidebar = [];
}
$AdminSidebar = new Sidebar();
$AdminSidebar->sidebar = $admin_sidebar;

$event = new Event('Lil.Sidebar.beforeRender', $this, $AdminSidebar);
$this->eventManager()->dispatch($event);
if (!empty($event->result)) {
    $admin_sidebar = $event->result->sidebar;
}

if ($this->request->is('mobile')) {
    $popup_headerMenu = [];
    foreach ($admin_sidebar as $panel_name => $panel) {
    	if (!empty($panel['active']) && !empty($panel['items'])) {
    	    foreach ($panel['items'] as $li_name => $li) {
    	       if (!empty($li['visible'])) {
    	            $expanded = (((!isset($li['expand']) || is_null($li['expand'])) && !empty($li['submenu'])) ||
    					(!empty($li['expand'])));
    					
            	    $popup_headerMenu['items'][] = [
            	       'title' => $li['title'],
            	       'url' => (!empty($li['url'])) ? $li['url'] : '#',
            	       'active' => !empty($li['active'])
            	    ];
            	    
            	    if (!empty($li['submenu'])) {
            	        foreach ($li['submenu'] as $lis) {
    						if (!empty($lis['visible'])) {
                                $popup_headerMenu['items'][] = [
                        	       'title' => '- ' . $lis['title'],
                        	       'url' => (!empty($lis['url'])) ? $lis['url'] : '#',
                        	       'active' => !empty($lis['active'])
                        	    ];
    						}
                        }<commit_msg>Fixing sidebar<commit_after><?php
use Cake\Event\Event;
use Cake\Event\EventManager;
/**
 * This is elements/admin_sidebar template file. 
 *
 * @copyright     Copyright 2008-2010, LilCake.net
 * @link          http://lilcake.net LilCake.net
 * @package       lil
 * @subpackage    lil.views.elements
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
if (empty($admin_sidebar)) {
	$admin_sidebar = [
		'welcome' => [
			'title'   => __d('lil', 'Dashboard'),
			'visible' => true,
			'active'  => false,
			'url'     => '/',
			'items'   => [],
		],
	];
}

class Sidebar {
	public $sidebar = [];
}
$AdminSidebar = new Sidebar();
$AdminSidebar->sidebar = $admin_sidebar;

$event = new Event('Lil.Sidebar.beforeRender', $this, ['sidebar' => $AdminSidebar]);
$this->eventManager()->dispatch($event);
if (!empty($event->result['sidebar'])) {
    $admin_sidebar = $event->result['sidebar']->sidebar;
}

if ($this->request->is('mobile')) {
    $popup_headerMenu = [];
    foreach ($admin_sidebar as $panel_name => $panel) {
    	if (!empty($panel['active']) && !empty($panel['items'])) {
    	    foreach ($panel['items'] as $li_name => $li) {
    	       if (!empty($li['visible'])) {
    	            $expanded = (((!isset($li['expand']) || is_null($li['expand'])) && !empty($li['submenu'])) ||
    					(!empty($li['expand'])));
    					
            	    $popup_headerMenu['items'][] = [
            	       'title' => $li['title'],
            	       'url' => (!empty($li['url'])) ? $li['url'] : '#',
            	       'active' => !empty($li['active'])
            	    ];
            	    
            	    if (!empty($li['submenu'])) {
            	        foreach ($li['submenu'] as $lis) {
    						if (!empty($lis['visible'])) {
                                $popup_headerMenu['items'][] = [
                        	       'title' => '- ' . $lis['title'],
                        	       'url' => (!empty($lis['url'])) ? $lis['url'] : '#',
                        	       'active' => !empty($lis['active'])
                        	    ];
    						}
                        }
{'fraction_non_alphanumeric': 0.21102661596958175, 'fraction_numerical': 0.0038022813688212928, 'mean_word_length': 1.9557584269662922, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5503884', 'n_tokens_mistral': 1409, 'n_tokens_neox': 1310, 'n_words': 210}