You are here

function menu_badges_privatemsg_unread_count in Menu Badges 7

PrivateMsg unread message count callback.

Parameters

array $arguments:

2 string references to 'menu_badges_privatemsg_unread_count'
menu_badges_menu_badges_options in ./menu_badges.module
Implements hook_menu_badges_options().
_menu_badges_7102_fix_deprecated_callback in ./menu_badges.install
Update to array-based format for version 7.x-1.2.

File

./menu_badges.module, line 355
Menu Badges module file.

Code

function menu_badges_privatemsg_unread_count($arguments) {
  if (module_exists('privatemsg')) {
    if (isset($arguments['menu_arg'])) {
      $arguments['uid'] = arg($arguments['menu_arg']);
    }
    if (isset($arguments['uid'])) {
      $unread_count = privatemsg_unread_count(user_load($arguments['uid']));
    }
    else {
      $unread_count = privatemsg_unread_count();
    }
    if ($unread_count > 0) {
      return $unread_count;
    }
  }
  return NULL;
}