17 lines
497 B
PHP
17 lines
497 B
PHP
<?php
|
|
|
|
function getCSSPageMenuOpen($tree, $isMenu)
|
|
{
|
|
if (is_null($isMenu)) {
|
|
if (get_instance()->uri->segment(2)) {
|
|
if (in_array(get_instance()->uri->segment(2), $tree)) {
|
|
return ' active';
|
|
}
|
|
} else if (in_array(get_instance()->uri->segment(1), $tree)) {
|
|
return ' active';
|
|
}
|
|
} else if (in_array(get_instance()->uri->segment(1), $tree)) {
|
|
return ' ' . ($isMenu ? 'menu-open' : 'active menu-open');
|
|
}
|
|
}
|