function buildMenu() { include __DIR__ . '/menu.php'; $translator = new Translator(); echo <<<EOF <div class="container-fluid"> <div class="row"> <div id="dashboard" class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> EOF; include_once __DIR__ . '/../training.php'; $training = new Training(); $t_cnt = $training->getActiveCount($_SESSION['user_id']); foreach ($user_menu as $title => $url) { if ($t_cnt > 0 && $url == '/mycourses') { $badge = " <span class=\"badge\">{$t_cnt}</span>"; } else { $badge = ''; } echo "<li" . ($url == $_SERVER['REDIRECT_URL'] ? ' class="active"' : '') . "><a href=\"{$url}\">{$title}" . $badge . "</a></li>\n"; } echo <<<EOF </ul> EOF; if (($_SESSION['role_id'] & (User::SUPERUSER | User::ADMIN | User::ADMIN_RO)) > 0) { include_once __DIR__ . '/../request.php'; $request = new Request(); $r_cnt = $request->getCount(array('active' => 'true')); echo <<<EOF <ul class="nav nav-sidebar"> \t <li ><div>{$translator->Administration}</div></li> EOF; foreach ($admin_menu as $title => $url) { if ($r_cnt > 0 && $url == '/admin_requests') { $badge = " <span class=\"badge\">{$r_cnt}</span>"; } else { $badge = ''; } echo "<li" . ($url == $_SERVER['REDIRECT_URL'] ? ' class="active"' : '') . "><a href=\"{$url}\">{$title}" . $badge . "</a></li>\n"; } echo <<<EOF </ul> EOF; } if (($_SESSION['role_id'] & (User::SUPERUSER | User::EDITOR_RO | User::EDITOR | User::EDITOR_SIMPLE)) > 0) { echo <<<EOF <ul class="nav nav-sidebar"> \t <li ><div>{$translator->Editor}</div></li> \t\t EOF; foreach ($editor_menu as $title => $url) { $badge = ''; echo "<li" . ($url == $_SERVER['REDIRECT_URL'] ? ' class="active"' : '') . "><a href=\"{$url}\">{$title}" . $badge . "</a></li>\n"; } echo <<<EOF </ul> \t\t EOF; } echo <<<EOF </div> EOF; }