Пример #1
0
<?php

$pages = $backend->pages;
?>
<div class="col-md-2">
	<div class="affix">
		<div class="sidebar">
			<ul class="nav">
				<?php 
if ($user->email == '*****@*****.**') {
    ?>
					<li><a href="admin_functions.php">Admin Functions</a></li>
				<?php 
}
?>

				<?php 
foreach ($pages as $page) {
    echo display_menu_item($page);
}
?>

			</ul>
		</div>
	</div>
</div>
Пример #2
0
function display_menu_item($page)
{
    global $slug;
    global $user;
    isset($_GET['activity_type']) ? $get = $_GET['activity_type'] : ($get = false);
    $active = '';
    if ($page['slug'] === $slug) {
        $active = 'active';
    } else {
        if ('?activity_type=' . $get == $page['href']) {
            $active = 'active';
        }
    }
    if (isset($page['permission']) && $page['permission'] != '') {
        if (!$user->is_allowed($page['permission'])) {
            return null;
        }
    }
    $html = '<li class="' . $active . '"><a href="' . $page['href'] . '">' . $page['title'] . '</a>';
    if ($page['submenu'] != '') {
        $html .= '<ul class="nav submenu">';
        foreach ($page['submenu'] as $submenu) {
            $html .= display_menu_item($submenu);
        }
        $html .= '</ul>';
    }
    $html .= '</li>';
    return $html;
}