You are here

function _menu_badges_7102_fix_deprecated_callback in Menu Badges 7

Update to array-based format for version 7.x-1.2.

Parameters

$callback:

$arguments:

1 call to _menu_badges_7102_fix_deprecated_callback()
menu_badges_update_7102 in ./menu_badges.install
Updates existing badges to new specification format.

File

./menu_badges.install, line 43
Install file for Menu Badges.

Code

function _menu_badges_7102_fix_deprecated_callback($callback, $arguments = array()) {
  $key = $callback;
  if (is_null($arguments)) {
    $arguments = array();
  }
  switch ($callback) {
    case 'menu_badges_ur_pending_incoming_current':
      $callback = 'menu_badges_ur_pending';
      $arguments += array(
        'role' => 'requestee',
      );
      break;
    case 'menu_badges_ur_pending_incoming_uid':
      $callback = 'menu_badges_ur_pending';
      $arguments += array(
        'role' => 'requestee',
        'menu_arg' => 1,
      );
      break;
    case 'menu_badges_ur_pending_outgoing_current':
      $callback = 'menu_badges_ur_pending';
      $arguments += array(
        'role' => 'requester',
      );
      break;
    case 'menu_badges_ur_pending_outgoing_uid':
      $callback = 'menu_badges_ur_pending';
      $arguments += array(
        'role' => 'requester',
        'menu_arg' => 1,
      );
      break;
    case 'menu_badges_privatemsg_unread_count_uid':
      $callback = 'menu_badges_privatemsg_unread_count';
      $arguments += array(
        'menu_arg' => 1,
      );
      break;
  }
  return array(
    'key' => $key,
    'callback' => $callback,
    'arguments' => $arguments,
  );
}