Esempio n. 1
0
 /**
  * Builds the 3rd half of the menu. This is the one with the configuration features
  *
  * At some point this might be displayed differently than the 1st half.
  */
 function build_menu_3()
 {
     global $dispatcher;
     /**
      * @var User
      */
     global $current_User;
     /**
      * @var AdminUI_general
      */
     global $AdminUI;
     if (!$current_User->check_perm('admin', 'restricted')) {
         return;
     }
     if ($current_User->check_perm('perm_messaging', 'reply')) {
         // Permission to view messaging:
         $AdminUI->add_menu_entries(NULL, array('messaging' => array('text' => T_('Messages'), 'title' => T_('Messages'), 'href' => $dispatcher . '?ctrl=threads', 'entries' => get_messaging_sub_entries(true))), 'users');
     }
 }
Esempio n. 2
0
 /**
  * Builds the 3rd half of the menu. This is the one with the configuration features
  *
  * At some point this might be displayed differently than the 1st half.
  */
 function build_menu_3()
 {
     global $admin_url;
     /**
      * @var User
      */
     global $current_User;
     /**
      * @var AdminUI_general
      */
     global $AdminUI;
     if (!$current_User->check_perm('admin', 'restricted')) {
         return;
     }
     if ($current_User->check_perm('perm_messaging', 'reply')) {
         // Permission to view messaging:
         // Count unread messages for current user
         $unread_messages_count = get_unread_messages_count();
         if ($unread_messages_count > 0) {
             $messages_counter = ' <span class="badge badge-important">' . $unread_messages_count . '</span>';
         } else {
             $messages_counter = '';
         }
         $AdminUI->add_menu_entries(NULL, array('messaging' => array('text' => T_('Messages') . $messages_counter, 'title' => T_('Messages'), 'href' => $admin_url . '?ctrl=threads', 'entries' => get_messaging_sub_entries(true))), 'users');
     }
 }