Doesn't rename menu items

  1. function aic_menu($may_cache) {
  2.   $items = array();
  3.  
  4.   if ($may_cache) {
  5.    
  6.   }
  7.   else {
  8.    
  9.     // Rename the user/view and user/edit tabs.  I hope this works. :-)
  10.     if (arg(0) == 'user' && is_numeric(arg(1)) && arg(1) > 0) {
  11.       $account = user_load(array('uid' => arg(1)));
  12.  
  13.       $admin_access = user_access('administer users');
  14.       $access_access = user_access('administer access control');
  15.       $view_access = user_access('access user profiles');
  16.      
  17.       if ($user !== FALSE) {
  18.         // Always let a user view their own account
  19.         $view_access |= $user->uid == arg(1);
  20.         // Only admins can view blocked accounts
  21.         $view_access &= $account->status || $admin_access;
  22.  
  23.         $items[] = array('path' => 'user/'. arg(1) .'/view', 'title' => t('Learn more'),
  24.           'access' => $view_access, 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
  25.  
  26.         $items[] = array('path' => 'user/'. arg(1) .'/edit', 'title' => t('Edit my profile'),
  27.           'callback' => 'drupal_get_form', 'callback arguments' => array('user_edit'),
  28.           'access' => $admin_access || $user->uid == arg(1), 'type' => MENU_LOCAL_TASK);
  29.       }
  30.     }
  31.   }
  32.  
  33.   return $items;
  34. }