summaryrefslogtreecommitdiff
path: root/includes/sys_menu.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-19 20:52:31 +0200
committerGitHub <noreply@github.com>2017-07-19 20:52:31 +0200
commit0d772ec9082ef780ec67c239eba61e979143ad05 (patch)
treeba68d1f00a0c9fb434f24f03eaaf2b7a8a9ec4e2 /includes/sys_menu.php
parent20e0765f571ed60aa21c07502ee7efcbe9995a6e (diff)
parent04217834fa4e6f94fec0836a80ea5526b8ebc9bc (diff)
Merge pull request #326 from MyIgel/master
Reapplied missing commits
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r--includes/sys_menu.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php
index 0b7d6b37..f160441c 100644
--- a/includes/sys_menu.php
+++ b/includes/sys_menu.php
@@ -197,7 +197,8 @@ function make_room_navigation($menu)
return $menu;
}
- $rooms = Rooms();
+ // Get a list of all rooms
+ $rooms = Rooms(true);
$room_menu = [];
if (in_array('admin_rooms', $privileges)) {
$room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', _('Manage rooms'));
@@ -206,7 +207,16 @@ function make_room_navigation($menu)
$room_menu[] = toolbar_item_divider();
}
foreach ($rooms as $room) {
- $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room['Name']);
+ if (
+ $room['show'] == 'Y' // room is public
+ || (
+ // room is not public, but user can admin_rooms
+ $room['show'] != 'Y'
+ && in_array('admin_rooms', $privileges)
+ )
+ ) {
+ $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);