move language to submenu

main
Philip Häusler 10 years ago
parent 094715e6ee
commit 07b6541204

@ -48,7 +48,7 @@ function make_langselect() {
$items = array();
foreach ($locales as $locale => $name)
$items[] = toolbar_item_link(htmlspecialchars($URL) . $locale, '', '<img src="pic/flag/' . $locale . '.png" alt="' . $name . '" title="' . $name . '"> ' . $name);
return toolbar_dropdown('', '<img src="pic/flag/' . $_SESSION['locale'] . '.png" alt="' . $locales[$_SESSION['locale']] . '" title="' . $locales[$_SESSION['locale']] . '">', $items);
return $items;
}
?>

@ -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') . '&amp;action=view', ' icon-icon_angel', $user['Nick'], $p == 'users');

@ -36,6 +36,10 @@ function toolbar_item_link($href, $glyphicon, $label, $selected = false) {
return '<li class="' . ($selected ? 'active' : '') . '"><a href="' . $href . '">' . ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '') . $label . '</a></li>';
}
function toolbar_item_divider() {
return '<li class="divider"></li>';
}
function toolbar_dropdown($glyphicon, $label, $submenu) {
return '<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . ($glyphicon != '' ? '<span class="glyphicon glyphicon-' . $glyphicon . '"></span> ' : '') . $label . ' <span class="caret"></span></a>

Loading…
Cancel
Save