function hs_menu_form_alter in Hierarchical Select 5.3
Same name and namespace in other branches
- 6.3 modules/hs_menu.module \hs_menu_form_alter()
Implementation of hook_form_alter().
File
- modules/
hs_menu.module, line 34 - Implementation of the Hierarchical Select API for the Menu module.
Code
function hs_menu_form_alter($form_id, &$form) {
if (isset($form['type']) && $form['type']['#value'] . '_node_form' == $form_id) {
// Content authoring form settings: "Restrict parent items to" setting.
$parent_mid = variable_get('menu_parent_items', 0);
_hs_menu_apply($form['menu']['pid'], NULL, $parent_mid);
}
if ($form_id == 'menu_edit_item_form') {
$mid = isset($form['mid']) ? $form['mid']['#value'] : NULL;
_hs_menu_apply($form['pid'], $mid, NULL);
}
}