By moksa on
Hi,
i try to upgrade this function from drupal 5 to drupal 6, i read this link (http://drupal.org/node/103114) but it's don't work. Somebody can help me ?
my V5 function :
function dimar_address_menu($may_cache) {
global $user;
$uid = $user->uid;
$items = array();
if ($may_cache) {
}
else {
if (arg(0) == 'user') {
if (user_access('administer users')) {
$uid = arg(1);
}
if ($uid) {
$items[] = array(
'path' => "user/$uid/dimar_address",
'title' => t('Address Book'),
'callback' => 'dimar_address_page',
'access' => TRUE,
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
}
}
}
return $items;
}
phpon V6 :
function dimar_address_menu() {
$items['user/%user_uid/dimar_address'] = array(
'title' => 'Address Book',
'page callback' => 'dimar_address_page',
'access arguments' => array('administer users'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
return $items;
}
phpThanks in advance !
Comments
What does not work mean? Do
What does not work mean? Do you get a page not found or something else?
There is no "Address Book"
There is no "Address Book" tabmenu on 'My account' page. With the first function on my drupal 5 it's work.
Looking at tracker.module I
Looking at tracker.module I think you want
Note your callback will be pased an user object as an argument (look at tracker_page in tracker.pages.inc). Also, if the a tab still does not show visit the menu admin page (this should cause the menus to be rebuilt).
Thanks a lot, it's ok.
Thanks a lot, it's ok.
Having a problem with this
Hello,
I ran across this post and thought maybe someone could help me getting this to work. This is my code.
function onthisdate_menu(){
$items['user/%user/onthisdate'] = array(
'title' => 'Address Book',
'page callback' => 'onthisdate_contact_info',
'access arguments' => array('administer users'),
'type' => MENU_LOCAL_TASK,
'weight' => 1,
);
}
function onthisdate_contact_info() {
echo "Test";
}
The tab will not even show up on the page for me, this is supposed to show up next to the View - Edit - Track tabs correct?
Duh
Nevermind I forgot to put the return in the function.