summaryrefslogtreecommitdiff
path: root/includes/sys_menu.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-09-08 14:45:41 +0200
committerPhilip Häusler <msquare@notrademark.de>2014-09-08 14:45:41 +0200
commit46575d90c276bbf10d28d19900790c454dbe96ff (patch)
treed39a3b33d611b8c165c24e8a245a535801ee50dd /includes/sys_menu.php
parent8a0bd3d55cb0a012056a13ab8e4158a69ccb4764 (diff)
pulled complete menu to the top (go for mobile...)
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r--includes/sys_menu.php42
1 files changed, 28 insertions, 14 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php
index 56b25a78..4841dd52 100644
--- a/includes/sys_menu.php
+++ b/includes/sys_menu.php
@@ -23,29 +23,32 @@ function header_toolbar() {
$toolbar_items[] = make_langselect();
- if (in_array('register', $privileges))
+ if (! isset($user) && in_array('register', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('register'), 'plus', register_title(), $p == 'register');
+ if (in_array('login', $privileges))
+ $toolbar_items[] = toolbar_item_link(page_link_to('login'), 'log-in', login_title(), $p == 'login');
+
+ $user_submenu = array();
if (in_array('user_myshifts', $privileges))
$toolbar_items[] = toolbar_item_link(page_link_to('users') . '&amp;action=view', ' icon-icon_angel', $user['Nick'], $p == 'users');
if (in_array('user_settings', $privileges))
- $toolbar_items[] = toolbar_item_link(page_link_to('user_settings'), 'list-alt', settings_title(), $p == 'user_settings');
-
- if (in_array('login', $privileges))
- $toolbar_items[] = toolbar_item_link(page_link_to('login'), 'log-in', login_title(), $p == 'login');
+ $user_submenu[] = toolbar_item_link(page_link_to('user_settings'), 'list-alt', settings_title(), $p == 'user_settings');
if (in_array('logout', $privileges))
- $toolbar_items[] = toolbar_item_link(page_link_to('logout'), 'log-out', logout_title(), $p == 'logout');
+ $user_submenu[] = toolbar_item_link(page_link_to('logout'), 'log-out', logout_title(), $p == 'logout');
- return toolbar($toolbar_items);
+ if (count($user_submenu) > 0)
+ $toolbar_items[] = toolbar_dropdown('', '', $user_submenu);
+
+ return toolbar($toolbar_items, true);
}
function make_navigation() {
- global $p;
- global $privileges;
- $menu = "";
+ global $p, $privileges;
+ $menu = array();
$pages = array(
"news" => news_title(),
"user_meetings" => meetings_title(),
@@ -53,7 +56,15 @@ function make_navigation() {
"user_shifts" => shifts_title(),
"angeltypes" => angeltypes_title(),
"user_messages" => messages_title() . ' ' . user_unread_messages(),
- "user_questions" => questions_title(),
+ "user_questions" => questions_title()
+ );
+
+ foreach ($pages as $page => $title)
+ if (in_array($page, $privileges))
+ $menu[] = toolbar_item_link(page_link_to($page), '', $title, $page == $p);
+
+ $admin_menu = array();
+ $admin_pages = array(
"admin_arrive" => admin_arrive_title(),
"admin_active" => admin_active_title(),
"admin_user" => admin_user_title(),
@@ -66,11 +77,14 @@ function make_navigation() {
"admin_log" => admin_log_title()
);
- foreach ($pages as $page => $title)
+ foreach ($admin_pages as $page => $title)
if (in_array($page, $privileges))
- $menu .= '<li class="' . ($page == $p ? 'active' : '') . '"><a href="' . page_link_to($page) . '">' . $title . '</a></li>';
+ $admin_menu[] = toolbar_item_link(page_link_to($page), '', $title, $page == $p);
+
+ if (count($admin_menu) > 0)
+ $menu[] = toolbar_dropdown('', _("Admin"), $admin_menu);
- return '<ul class="nav nav-pills nav-stacked">' . $menu . '</ul>';
+ return toolbar($menu);
}
function make_navigation_for($name, $pages) {