From ded660adb66471c75a6ec7a0ead334a1b4bceb2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Thu, 2 Jun 2011 17:15:03 +0200 Subject: [PATCH] menu seperated --- includes/sys_menu.php | 38 ++++++++++++++++++++++++++------------ 1 file 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 .= ''; + $menu .= make_navigation_for(Get_Text('/'), array ( + "start", + "login", + "logout", + "register", + "faq" + )); // Engel Navigation - $menu .= ''; + $menu .= make_navigation_for(Get_Text('inc_schicht_engel'), array ( + "news" + )); // Admin Navigation - $menu .= ''; + $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 .= '' . Get_Text($page) . ''; + + if ($menu != "") + $menu = ''; return $menu; }