Hello,
I would like to add a sub menu item to the menu 'Forms' through the use of a different module then the one that the 'Forms' menu is declared in.
The 'Forms' menu is declared in formexample.module shown here:
function formexample_menu() {
$items['form'] = array(
'title' => 'Forms',
'page callback' => 'forms_overview',
'access callback' => 'user_access',
'access arguments' => array('form example'),
'type' => MENU_NORMAL_ITEM
);
$items['form/fromex'] = array(
'title' => t('View the sample form'),
'page callback' => 'drupal_get_form',
'page arguments' => array('formexample_nameform'),
'access callback' => 'user_access',
'access arguments' => array('form example'),
'type' => MENU_NORMAL_ITEM,
'weight' => 0
);
return $items;
}
The sub menu item will be coming from the module form_example_dynamic.module, shown here:
function form_example_dynamic_menu_alter(&$items) {
$items['form/form_example_dynamic'] = array(
'title' => t('Form Example Dynamic Form'),
'page callback' => 'drupal_get_form',
'page arguments' => array('form_example_dynamic_form'),
'access callback' => 'user_access',
'access arguments' => array('form example'),
'type' => MENU_NORMAL_ITEM
);
}