You are here

function menu_attributes_form_alter in Menu Attributes 6

Same name and namespace in other branches
  1. 6.2 menu_attributes.module \menu_attributes_form_alter()

Implements hook_form_alter().

Adds menu attribute options to the node's edit menu item form.

See also

_menu_attributes_form_alter()

File

./menu_attributes.module, line 136
Alters the menu item form to allow the administrator to specify additional attributes for the menu link

Code

function menu_attributes_form_alter(&$form, $form_state, $form_id) {
  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] . '_node_form' == $form_id && isset($form['menu'])) {
    $item = $form['#node']->menu;
    _menu_attributes_form_alter($form['menu'], $item, $form);
    array_unshift($form['#submit'], 'menu_attributes_form_node_form_submit');
  }
}