function persistent_menu_items_form_submit in Persistent Menu Items 7
Instance of hook _form_submit(); Custom additional submit hook for the menu add/edit form, only called if the form is loaded by someone with permission to administer the persistent menu item option. Handles the saving of the persistent menu flag against the menu item's entry in the database.
_state
Parameters
array $form:
1 string reference to 'persistent_menu_items_form_submit'
- persistent_menu_items_form_menu_edit_item_alter in ./
persistent_menu_items.module - Instance of hook _form_menu_edit_item_alter(). Alters the menu item add/edit form to add the "persistent menu item" checkbox if the person viewing the form has sufficient permissions set.
File
- ./
persistent_menu_items.module, line 87 - Allows menu links to be visible irrespective of content restriction.
Code
function persistent_menu_items_form_submit($form, &$form_state) {
$menu =& $form_state['values'];
if ($menu['persistent_menu_item']) {
$menu['options']['persistent_menu_item'] = 1;
$menu['options']['alter'] = 1;
}
else {
$menu['options']['persistent_menu_item'] = 0;
$menu['options']['alter'] = 0;
}
}