On the /user page i've created two tabs:
function hook_menu() {
$items['user/%/My-Courses'] = array(
'title' => 'My Courses',
'type' => MENU_LOCAL_TASK,
'page callback' => 'drupal_get_form',
'page arguments' => array('hook_form'),
'access callback' => 'hook_access',
'access arguments' => array('access content'),
);
$items['user/%/Privacy-Statement'] = array(
'title' => 'Privacy Statement',
'type' => MENU_LOCAL_TASK,
'page callback' => 'drupal_get_form',
'page arguments' => array('hook_form'),
'access callback' => 'hook_access',
'access arguments' => array('access content'),
);
return $items;
}
What i'm trying to do is add a link to the my courses tab, and a privacy statement (just text) to the privacy statement tab.
function hook_form(){
$form['privacy'] = array(
'#type' => 'textfield',
'#value' => 'Privacy statement',
);
// returns whatever you want to appear in that tab.
$form['link1'] = array(
'#type' => 'submit',
'#value' => t('This will show the customers courses.'),
);
return $form;
}
The problem is that it's adding both the link and statement to both tabs.
How would I go about targeting each tab individually?
'page arguments' => array('hook_form')
line is the one you are actually using?