--- buddylist copy.module
+++ (clipboard)
@@ -73,189 +73,189 @@
 }
 
 /**
- * Implementation of hook_menu
- */
+* Implementation of hook_menu
+*/
 function buddylist_menu($may_cache) {
-  global $user;
-
-  $items = array();
-  $id = is_numeric(arg(1)) ? arg(1) : $user->uid;
-
-  if ($may_cache) {
-    // buddylist settings page
-    $items[] = array(
-      'path' => 'admin/settings/buddylist',
-      'title' => t('Buddylist'), // Note that this isn't translated on purpose since it is for the admin
-      'description' => t('Buddylist configuration options for blocks, email, etc.'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => 'buddylist_admin_settings',
-      'access' => user_access('administer site configuration'),
-   );
-    // my buddylist menu item
-    $items[] = array(
-      'path' => 'buddylist',
-      'title' => t('My @buddylist', buddylist_translation()),
-      'access' => (user_access('maintain buddy list') && $id),
-      'callback' => 'buddylist_buddylisting_page',
-      'callback arguments' => array($user->uid, 'buddies'),
-    );
-  }
-  else {
-    // 'edit access' only granted to user's own buddy list or to administrative users
-    $editAccess = (
-      ($id == $user->uid && user_access('maintain buddy list') && $user->uid)
-      || user_access('administer users'));
-
-    $approval_required = variable_get('buddylist_require_approval', 0);
-
-    $items[] = array(
-      'path' => 'buddy/add',
-      'title' => t('Add to @buddylist', buddylist_translation()),
-      'access' => $editAccess,
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('buddylist_addbuddy', arg(2)),
-      'type' => MENU_CALLBACK,
-    );
-    $items[] = array(
-      'path' => 'buddy/delete',
-      'title' => t('Delete from @buddylist', buddylist_translation()),
-      'access' => $editAccess,
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('buddylist_deletebuddy', arg(2)),
-      'type' => MENU_CALLBACK,
-    );
-
-    // 'view only' tabs
-    $viewAccess = (($id == $user->uid && user_access('maintain buddy list')) || user_access('view buddy lists'));
+global $user;
 
-    // If buddylist approval is required, then upon approval, both parties become buddies of each other.
-    // So, in effect, idea 'buddyof' becomes redundant.
-    if (!$approval_required) {
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies',
-        'title' => t('@Buddies', buddylist_translation()),
-        'access' => $viewAccess,
-        'callback' => 'buddylist_buddylisting_page',
-        'type' => MENU_DEFAULT_LOCAL_TASK,
-        'weight' => -1,
-        'callback arguments' => array($id)
-      );
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddyof',
-        'title' => t('@Buddyof', buddylist_translation()),
-        'access' => $viewAccess,
-        'callback' => 'buddylist_buddylisting_page',
-        'type' => MENU_LOCAL_TASK,
-        'weight' => 1,
-        'callback arguments' => array($id, 'buddyof')
-      );
-    }
+$items = array();
+$id = is_numeric(arg(1)) ? arg(1) : $user->uid;
 
-    // subtabs
-    $items[] = array(
-      'path' => 'buddylist/'. $id .'/buddies/list',
-      'title' => t('@Buddylist', buddylist_translation()),
-      'access' => $viewAccess,
-      'callback' => 'buddylist_buddylisting_page',
-      'type' => MENU_DEFAULT_LOCAL_TASK,
-      'weight' => -1,
-      'callback arguments' => array($id),
-    );
-    $items[] = array(
-      'path' => 'buddylist/'. $id .'/buddies/recent',
-      'title' => t('Recent posts'),
-      'access' => ($viewAccess && module_exists('tracker')),
-      'callback' => 'buddylist_buddiesrecent_page',
-      'type' => MENU_LOCAL_TASK,
-      'weight' => 3,
-      'callback arguments' => array($id),
-    );
-    if (variable_get('buddylist_buddygroups', FALSE)) {
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/groups/view',
-        'title' => t('View groups'),
-        'access' => $viewAccess,
-        'callback' => 'buddylist_buddiesgroups_page',
-        'type' => MENU_LOCAL_TASK,
-        'weight' => 5,
-        'callback arguments' => array($id),
-      );
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/groups/edit',
-        'title' => t('Edit groups'),
-        'access' => $editAccess,
-        'callback' => 'buddylist_buddiesgroups_edit',
-        'type' => MENU_LOCAL_TASK,
-        'weight' => 6,
-        'callback arguments' => array($id),
-      );
-    }
-
-    // sub-subtabs
-    if ($approval_required && $editAccess) {
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/requests',
-        'title' => t('Pending requests'),
-        'access' => $editAccess,
-        'callback' => 'theme',
-        'type' => MENU_LOCAL_TASK,
-        'weight' => 0,
-        'callback arguments' => array('buddylist_pending_requests', $id)
-      );
-
-      $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/requested/accept',
-        'title' => t('Accept Request'),
-        'access' => $editAccess,
-        'type' => MENU_CALLBACK,
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('buddylist_pending_requested_accept',$id),
-      );
-
-	  $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/requested/deny',
-        'title' => t('Deny Request'),
-        'access' => $editAccess,
-        'type' => MENU_CALLBACK,
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('buddylist_pending_requested_deny',$id),
-      );
-
-       $items[] = array(
-        'path' => 'buddylist/'. $id .'/buddies/request/cancel',
-        'title' => t('Cancel Request'),
-        'access' => $editAccess,
-        'type' => MENU_CALLBACK,
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('buddylist_cancel_request',$id),
-      );
-
-    }
-
-    // other callbacks
-    if ($id != $user->uid) {
-      // This callback can interfere with the 'my buddylist' menu item,
-      // so we only load it if the user is viewing another user's list.
-      $items[] = array(
-        'path' => 'buddylist/'. $id,
-        'title' => t('@Buddylist', buddylist_translation()),
-        'access' => (($viewAccess || $editAccess) && $id),
-        'callback' => 'buddylist_buddylisting_page',
-        'type' => MENU_CALLBACK,
-        'callback arguments' => array($id),
-      );
-    }
-    $items[] = array(
-      'path' => 'buddylist/'. $id .'/buddies/recent/feed',
-      'title' => t('Xml feed'),
-      'access' => $viewAccess,
-      'callback' => 'buddylist_buddyfeed',
-      'type' => MENU_CALLBACK,
-      'callback arguments' => array($id),
-    );
-  }
+if ($may_cache) {
+// buddylist settings page
+$items[] = array(
+'path' => 'admin/settings/buddylist',
+'title' => t('Buddylist'), // Note that this isn't translated on purpose since it is for the admin
+'description' => t('Buddylist configuration options for blocks, email, etc.'),
+'callback' => 'drupal_get_form',
+'callback arguments' => 'buddylist_admin_settings',
+'access' => user_access('administer site configuration'),
+);
+// my buddylist menu item
+$items[] = array(
+'path' => 'buddylist',
+'title' => t('My @buddylist', buddylist_translation()),
+'access' => (user_access('maintain buddy list') && $id),
+'callback' => 'buddylist_buddylisting_page',
+'callback arguments' => array($user->uid, 'buddies'),
+);
+}
+else {
+// 'edit access' only granted to user's own buddy list or to administrative users
+$editAccess = (
+($id == $user->uid && user_access('maintain buddy list') && $user->uid)
+|| user_access('administer users'));
+
+$approval_required = variable_get('buddylist_require_approval', 0);
+
+$items[] = array(
+'path' => 'buddy/add',
+'title' => t('Add to @buddylist', buddylist_translation()),
+'access' => $editAccess,
+'callback' => 'drupal_get_form',
+'callback arguments' => array('buddylist_addbuddy', arg(2)),
+'type' => MENU_CALLBACK,
+);
+$items[] = array(
+'path' => 'buddy/delete',
+'title' => t('Delete from @buddylist', buddylist_translation()),
+'access' => $editAccess,
+'callback' => 'drupal_get_form',
+'callback arguments' => array('buddylist_deletebuddy', arg(2)),
+'type' => MENU_CALLBACK,
+);
+
+// 'view only' tabs
+$viewAccess = (($id == $user->uid && user_access('maintain buddy list')) || user_access('view buddy lists'));
+
+// If buddylist approval is required, then upon approval, both parties become buddies of each other.
+// So, in effect, idea 'buddyof' becomes redundant.
+if (!$approval_required) {
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies',
+'title' => t('@Buddies', buddylist_translation()),
+'access' => $viewAccess,
+'callback' => 'buddylist_buddylisting_page',
+'type' => MENU_LOCAL_TASK,
+'weight' => 1,
+'callback arguments' => array($id)
+);
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddyof',
+'title' => t('@Buddyof', buddylist_translation()),
+'access' => $viewAccess,
+'callback' => 'buddylist_buddylisting_page',
+'type' => MENU_LOCAL_TASK,
+'weight' => 1,
+'callback arguments' => array($id, 'buddyof')
+);
+}
+
+// subtabs
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/list',
+'title' => t('@Buddylist', buddylist_translation()),
+'access' => $viewAccess,
+'callback' => 'buddylist_buddylisting_page',
+'type' => MENU_DEFAULT_LOCAL_TASK,
+'weight' => -1,
+'callback arguments' => array($id),
+);
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/recent',
+'title' => t('Recent posts'),
+'access' => ($viewAccess && module_exists('tracker')),
+'callback' => 'buddylist_buddiesrecent_page',
+'type' => MENU_LOCAL_TASK,
+'weight' => 3,
+'callback arguments' => array($id),
+);
+if (variable_get('buddylist_buddygroups', FALSE)) {
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/groups/view',
+'title' => t('View groups'),
+'access' => $viewAccess,
+'callback' => 'buddylist_buddiesgroups_page',
+'type' => MENU_LOCAL_TASK,
+'weight' => 5,
+'callback arguments' => array($id),
+);
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/groups/edit',
+'title' => t('Edit groups'),
+'access' => $editAccess,
+'callback' => 'buddylist_buddiesgroups_edit',
+'type' => MENU_LOCAL_TASK,
+'weight' => 6,
+'callback arguments' => array($id),
+);
+}
+
+// sub-subtabs
+if ($approval_required && $editAccess) {
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/requests',
+'title' => t('Pending requests'),
+'access' => $editAccess,
+'callback' => 'theme',
+'type' => MENU_LOCAL_TASK,
+'weight' => 0,
+'callback arguments' => array('buddylist_pending_requests', $id)
+);
+
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/requested/accept',
+'title' => t('Accept Request'),
+'access' => $editAccess,
+'type' => MENU_CALLBACK,
+'callback' => 'drupal_get_form',
+'callback arguments' => array('buddylist_pending_requested_accept',$id),
+);
+
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/requested/deny',
+'title' => t('Deny Request'),
+'access' => $editAccess,
+'type' => MENU_CALLBACK,
+'callback' => 'drupal_get_form',
+'callback arguments' => array('buddylist_pending_requested_deny',$id),
+);
+
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/request/cancel',
+'title' => t('Cancel Request'),
+'access' => $editAccess,
+'type' => MENU_CALLBACK,
+'callback' => 'drupal_get_form',
+'callback arguments' => array('buddylist_cancel_request',$id),
+);
+
+}
+
+// other callbacks
+if ($id != $user->uid) {
+// This callback can interfere with the 'my buddylist' menu item,
+// so we only load it if the user is viewing another user's list.
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id,
+'title' => t('@Buddylist', buddylist_translation()),
+'access' => (($viewAccess || $editAccess) && $id),
+'callback' => 'buddylist_buddylisting_page',
+'type' => MENU_CALLBACK,
+'callback arguments' => array($id),
+);
+}
+$items[] = array(
+'path' => 'user/'. $id .'/buddylist/'. $id .'/buddies/recent/feed',
+'title' => t('Xml feed'),
+'access' => $viewAccess,
+'callback' => 'buddylist_buddyfeed',
+'type' => MENU_CALLBACK,
+'callback arguments' => array($id),
+);
+}
 
-  return $items;
+return $items;
 }
 
 /**
