removing tabbed display : drupal : user relationships...  

Posted by Satish Eerpini in

so if you have used the user_relationships module in Drupal ( 5.x) , u would know that the My relationships link in the navigation menu , when clicked displays a page with two internal tabs, 'all' and 'pending'. If u didn't like the tabbed display , (i did not like it , so i made this change)u can as well change it to display any one of the options , pending or all , this is what has to be done , u will have to edit the hook file for the user relationships module , so the required file is
"your drupal installation"/modules/user_relationships/user_relationships_hooks.inc
find the following code in the file and make the following changes .

$items[] = array(
'path' => "relationships/list",
'title' => t('All'),
'access' => $view_access,
'type' => MENU_NORMAL_ITEM|MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
if (true || ($approval_required && $edit_access)) {
$items[] = array(
'path' => "relationships/requests",
'title' => t('Pending'),
'access' => $edit_access,
'callback' => 'theme',
'type' => MENU_NORMAL_ITEM|MENU_LOCAL_TASK,
'weight' => -9,
'callback arguments' => array('user_relationships_pending_requests_page', $user->uid)
);
}

change it to the following ,...

$items[] = array(
'path' => "relationships/list",
'title' => t('All'),
'access' => $view_access,
'type' => MENU_NORMAL_ITEM/*|MENU_DEFAULT_LOCAL_TASK*/,
'weight' => -10,
);
if (true || ($approval_required && $edit_access)) {
$items[] = array(
'path' => "relationships/requests",
'title' => t('Pending'),
'access' => $edit_access,
'callback' => 'theme',
'type' => MENU_NORMAL_ITEM/*|MENU_LOCAL_TASK*/,
'weight' => -9,
'callback arguments' => array('user_relationships_pending_requests_page', $user->uid)
);
}



we are just changing the menu hooking behaviour, ... this is just a choice of look , a small tweak , nothing more,...... u can just ignore this if u like the tabbed display .

This entry was posted on Friday, May 23, 2008 at 1:14 AM and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment

About Me

My photo

I am a Linux geek currently pursuing my bachelor's degree in computer science and engineering.