graphonline/core/init/admin_menu.php
2017-04-15 01:34:36 +03:00

33 lines
1.2 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Этот файл должен вызываться, когда меню уже заполнено. Добавляем в конце кнопку 'выход':
$g_config['admin_menu'][] = array
(
'link' => SiteRoot('admin/logout'),
'name' => '<span class="glyphicon glyphicon-log-out"></span>',
'label' => 'Выйти',
'css' => '',
'list' => array()
);
// Выделяем нужный элемент в меню:
foreach ($g_config['admin_menu'] as $k => $v)
{
// Выделять если это текущая страница или страница в ее выподающем списке
$links = array($v['link']);
foreach ($v['list'] as $subLink)
{
if (is_array($subLink))
{
$links[] = $subLink['link'];
}
}
if (in_array(GetCurUrl(), $links))
{
$v['css'] = empty($v['css']) ? 'active' : "{$v['css']} active";
$g_config['admin_menu'][$k] = $v;
}
}
?>