diff options
author | msquare <msquare@notrademark.de> | 2016-10-05 18:56:50 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-10-05 18:56:50 +0200 |
commit | 6fff6a6c1a5a4ae6c6977c3aeb4ac532ba09a395 (patch) | |
tree | b32209aa2907e34a7e52d41b6754382fa23d6151 /includes/sys_menu.php | |
parent | 27c9650dc4064ec5b40c5041d8291a7ce0e5305e (diff) |
begin room view and shifts filter renderer
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r-- | includes/sys_menu.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 112c490f..a5971ace 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -129,6 +129,8 @@ function make_navigation() { } } + $menu = make_room_navigation($menu); + $admin_menu = []; $admin_pages = [ "admin_arrive" => admin_arrive_title(), @@ -158,6 +160,32 @@ function make_navigation() { return toolbar($menu); } +/** + * Adds room navigation to the given menu. + * + * @param string[] $menu + * Rendered menu + */ +function make_room_navigation($menu) { + global $privileges; + + $rooms = Rooms(); + $room_menu = []; + if (in_array('admin_rooms', $privileges)) { + $room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', _("Manage rooms")); + } + if (count($room_menu) > 0) { + $room_menu[] = toolbar_item_divider(); + } + foreach ($rooms as $room) { + $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']); + } + if (count($room_menu > 0)) { + $menu[] = toolbar_dropdown('map-marker', _("Rooms"), $room_menu); + } + return $menu; +} + function make_menu() { return make_navigation(); } |