diff --git a/includes/sys_menu.php b/includes/sys_menu.php index b6dec73c..c8f69ac0 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -60,24 +60,24 @@ function make_user_submenu() $user_submenu = make_language_select(); if (auth()->can('user_settings') || auth()->can('logout')) { - $user_submenu[] = toolbar_item_divider(); + $user_submenu[] = toolbar_dropdown_item_divider(); } if (auth()->can('user_settings')) { - $user_submenu[] = toolbar_item_link( + $user_submenu[] = toolbar_dropdown_item( page_link_to('user_settings'), - 'list-alt', __('Settings'), - $page == 'user_settings' + $page == 'user_settings', + 'bi-gear' ); } if (auth()->can('logout')) { - $user_submenu[] = toolbar_item_link( + $user_submenu[] = toolbar_dropdown_item( page_link_to('logout'), - 'log-out', __('Logout'), - $page == 'logout' + $page == 'logout', + 'bi-box-arrow-left', ); } @@ -138,9 +138,8 @@ function make_navigation() } $title = ((array)$options)[0]; - $admin_menu[] = toolbar_item_link( + $admin_menu[] = toolbar_dropdown_item( page_link_to($menu_page), - '', __($title), $menu_page == $page ); @@ -150,7 +149,7 @@ function make_navigation() $menu[] = toolbar_dropdown('', __('Admin'), $admin_menu); } - return '
'; + return ' '; } /** @@ -187,13 +186,13 @@ function make_room_navigation($menu) $rooms = Rooms(); $room_menu = []; if (auth()->can('admin_rooms')) { - $room_menu[] = toolbar_item_link(page_link_to('admin_rooms'), 'list', __('Manage rooms')); + $room_menu[] = toolbar_dropdown_item(page_link_to('admin_rooms'), __('Manage rooms'), false, 'list'); } if (count($room_menu) > 0) { - $room_menu[] = toolbar_item_divider(); + $room_menu[] = toolbar_dropdown_item_divider(); } foreach ($rooms as $room) { - $room_menu[] = toolbar_item_link(room_link($room), 'map-marker', $room->name); + $room_menu[] = toolbar_dropdown_item(room_link($room), $room->name, false, 'map-marker'); } if (count($room_menu) > 0) { $menu[] = toolbar_dropdown('map-marker', __('Rooms'), $room_menu); @@ -215,9 +214,8 @@ function make_language_select() foreach (config('locales') as $locale => $name) { $url = url($request->getPathInfo(), ['set-locale' => $locale]); - $items[] = toolbar_item_link( + $items[] = toolbar_dropdown_item( htmlspecialchars($url), - '', $name, $locale == $activeLocale ); diff --git a/includes/sys_template.php b/includes/sys_template.php index 79e32531..0a7aeb98 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -169,46 +169,68 @@ function toolbar_pills($items) * Render a link for a toolbar. * * @param string $href - * @param string $glyphicon + * @param string $icon * @param string $label - * @param bool $selected + * @param bool $active * @return string */ -function toolbar_item_link($href, $glyphicon, $label, $selected = false) +function toolbar_item_link($href, $icon, $label, $active = false) { - return '- {% for type in types %} - {{ type|capitalize }} + {% for type in types_color %} + {{ type[0]|capitalize }} {% endfor %}