You are here

function menu_badges_ur_pending in Menu Badges 7

User Relationships incoming relationship requests.

Parameters

unknown_type $arguments:

2 string references to 'menu_badges_ur_pending'
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 316
Menu Badges module file.

Code

function menu_badges_ur_pending($arguments) {
  if (module_exists('user_relationships')) {
    if (isset($arguments['menu_arg'])) {
      $arguments['uid'] = arg($arguments['menu_arg']);
    }
    if (!isset($arguments['uid'])) {
      global $user;
      $arguments['uid'] = $user->uid;
    }
    $count = db_select('user_relationships', 'ur')
      ->condition($arguments['role'] . '_id', $arguments['uid'])
      ->condition('approved', 0)
      ->countQuery()
      ->execute()
      ->fetchField();
    if ($count > 0) {
      return $count;
    }
  }
  return NULL;
}