From 07b65412043c89a6a3176f202498f8a603c15dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Wed, 24 Sep 2014 15:11:50 +0200 Subject: [PATCH] move language to submenu --- includes/helper/internationalization_helper.php | 2 +- includes/sys_menu.php | 5 ++--- includes/sys_template.php | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/helper/internationalization_helper.php b/includes/helper/internationalization_helper.php index 6a1f172d..836bbc6a 100644 --- a/includes/helper/internationalization_helper.php +++ b/includes/helper/internationalization_helper.php @@ -48,7 +48,7 @@ function make_langselect() { $items = array(); foreach ($locales as $locale => $name) $items[] = toolbar_item_link(htmlspecialchars($URL) . $locale, '', '' . $name . ' ' . $name); - return toolbar_dropdown('', '' . $locales[$_SESSION['locale']] . '', $items); + return $items; } ?> \ No newline at end of file diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 8b3e7f5e..5ff415fb 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -21,15 +21,14 @@ function header_toolbar() { if (isset($user)) $toolbar_items[] = toolbar_item_link('#', 'time', User_shift_state_render($user)); - $toolbar_items[] = make_langselect(); - 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(); + $user_submenu = make_langselect(); + $user_submenu[] = toolbar_item_divider(); if (in_array('user_myshifts', $privileges)) $toolbar_items[] = toolbar_item_link(page_link_to('users') . '&action=view', ' icon-icon_angel', $user['Nick'], $p == 'users'); diff --git a/includes/sys_template.php b/includes/sys_template.php index b18abe53..aaa79993 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -36,6 +36,10 @@ function toolbar_item_link($href, $glyphicon, $label, $selected = false) { return '
  • ' . ($glyphicon != '' ? ' ' : '') . $label . '
  • '; } +function toolbar_item_divider() { + return '
  • '; +} + function toolbar_dropdown($glyphicon, $label, $submenu) { return '