From f06e4a0f4783638ef1929939b4cdbb45c9243a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20H=C3=A4usler?= Date: Wed, 24 Sep 2014 15:24:32 +0200 Subject: [PATCH] move user messages to menu icon right --- includes/pages/user_messages.php | 2 +- includes/sys_menu.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php index 2a5fb917..4f3e2e88 100644 --- a/includes/pages/user_messages.php +++ b/includes/pages/user_messages.php @@ -9,7 +9,7 @@ function user_unread_messages() { if (isset($user)) { $new_messages = sql_num_query("SELECT * FROM `Messages` WHERE isRead='N' AND `RUID`=" . sql_escape($user['UID'])); if ($new_messages > 0) - return ' ' . $new_messages . ''; + return ' ' . $new_messages . ''; } return ''; } diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 5ff415fb..fc17699f 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -27,6 +27,9 @@ function header_toolbar() { if (in_array('login', $privileges)) $toolbar_items[] = toolbar_item_link(page_link_to('login'), 'log-in', login_title(), $p == 'login'); + if(isset($user) && in_array('user_messages', $privileges)) + $toolbar_items[] = toolbar_item_link(page_link_to('user_messages'), 'envelope', user_unread_messages()); + $user_submenu = make_langselect(); $user_submenu[] = toolbar_item_divider(); if (in_array('user_myshifts', $privileges)) @@ -53,7 +56,6 @@ function make_navigation() { "user_meetings" => meetings_title(), "user_shifts" => shifts_title(), "angeltypes" => angeltypes_title(), - "user_messages" => messages_title() . ' ' . user_unread_messages(), "user_questions" => questions_title() );