diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-06-02 17:15:03 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-06-02 17:15:03 +0200 |
commit | ded660adb66471c75a6ec7a0ead334a1b4bceb2c (patch) | |
tree | a7e5608a4d00ed03161b65e18ad4907182a6a540 | |
parent | de66e87c6f0c81d73a27d62a38c162a7aba905ad (diff) |
menu seperated
-rw-r--r-- | includes/sys_menu.php | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php index a2f8c577..924d8e64 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -11,22 +11,36 @@ function make_navigation() { $menu = ""; // Standard Navigation - $menu .= '<nav class="container"><h4>' . Get_Text('/') . '</h4><ul class="content">'; - foreach ($menu_items as $item) - $menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>'; - $menu .= '</ul></nav>'; + $menu .= make_navigation_for(Get_Text('/'), array ( + "start", + "login", + "logout", + "register", + "faq" + )); // Engel Navigation - $menu .= '<nav class="container"><h4>' . Get_Text('inc_schicht_engel') . '</h4><ul class="content">'; - foreach ($menu_items as $item) - $menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>'; - $menu .= '</ul></nav>'; + $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( + "news" + )); // Admin Navigation - $menu .= '<nav class="container"><h4>' . Get_Text('admin/') . '</h4><ul class="content">'; - foreach ($menu_items as $item) - $menu .= '<li' . ($item == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($item) . '">' . Get_Text($item) . '</a></li>'; - $menu .= '</ul></nav>'; + $menu .= make_navigation_for(Get_Text('admin/'), array ( + "admin_rooms" + )); + return $menu; +} + +function make_navigation_for($name, $pages) { + global $privileges, $p; + + $menu = ""; + foreach ($pages as $page) + if (in_array($page, $privileges)) + $menu .= '<li' . ($page == $p ? ' class="selected"' : '') . '><a href="' . page_link_to($page) . '">' . Get_Text($page) . '</a></li>'; + + if ($menu != "") + $menu = '<nav class="container"><h4>' . $name . '</h4><ul class="content">' . $menu . '</ul></nav>'; return $menu; } |