You are here

function messaging_debug_menu in Messaging 5

Same name and namespace in other branches
  1. 6 messaging_debug/messaging_debug.module \messaging_debug_menu()
  2. 6.2 messaging_debug/messaging_debug.module \messaging_debug_menu()
  3. 6.3 messaging_debug/messaging_debug.module \messaging_debug_menu()

Implementation of hook_menu().

File

messaging_debug/messaging_debug.module, line 15
Simple messaging using html page. Messaging method plug-in

Code

function messaging_debug_menu($may_cache) {
  global $user;

  // we need the user to to build some urls
  $items = array();
  if (!$may_cache) {
    if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
      $account = user_load(array(
        'uid' => arg(1),
      ));
      if ($account->uid == $user->uid || user_access('administer messaging')) {
        $items[] = array(
          'path' => 'user/' . $account->uid . '/messagelog',
          'type' => MENU_LOCAL_TASK,
          'title' => t('Message log'),
          'callback' => 'messaging_debug_user_page',
          'callback arguments' => array(
            $account,
          ),
        );
      }
    }
  }
  return $items;
}