summaryrefslogtreecommitdiff
path: root/includes/sys_menu.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-10-05 18:56:50 +0200
committermsquare <msquare@notrademark.de>2016-10-05 18:56:50 +0200
commit6fff6a6c1a5a4ae6c6977c3aeb4ac532ba09a395 (patch)
treeb32209aa2907e34a7e52d41b6754382fa23d6151 /includes/sys_menu.php
parent27c9650dc4064ec5b40c5041d8291a7ce0e5305e (diff)
begin room view and shifts filter renderer
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r--includes/sys_menu.php28
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();
}