function cami_form_menu_edit_item_alter in Custom Active Menu Item 7
Implements hook_menu_edit_item_alter().
File
- ./
cami.module, line 57 - Allows to specify which menu item is active and the classes that will be added to it.
Code
function cami_form_menu_edit_item_alter(&$form, &$form_state) {
if (user_access('administer cami')) {
$form['options'] = array(
'#tree' => TRUE,
'#weight' => 50,
);
$form['options']['cami'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#title' => t('Custom Active Menu Item'),
'#weight' => 0,
);
$form['options']['cami']['pages'] = array(
'#type' => 'textarea',
'#title' => t('Pages'),
'#description' => t("Pages where the menu item will be active, Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are blog for the blog page and blog/* for every personal blog."),
'#default_value' => isset($form['original_item']['#value']['options']['cami']['pages']) ? $form['original_item']['#value']['options']['cami']['pages'] : '',
);
}
}