You are here

function advanced_menu_edit_item_form_validate in Advanced Menu 5

Validate the additional fields and merge them into $edit['type']

File

./advanced_menu.module, line 61
Add additional menu options for trees, breadcrumbs, and children.

Code

function advanced_menu_edit_item_form_validate() {
  $edit =& $GLOBALS['form_values'];
  if ($edit['tree']) {
    $edit['type'] |= MENU_VISIBLE_IN_TREE;
  }
  else {
    $edit['type'] &= ~MENU_VISIBLE_IN_TREE;
  }
  if ($edit['breadcrumb']) {
    $edit['type'] |= MENU_VISIBLE_IN_BREADCRUMB;
  }
  else {
    $edit['type'] &= ~MENU_VISIBLE_IN_BREADCRUMB;
  }
  if ($edit['children']) {
    $edit['type'] |= MENU_VISIBLE_IF_HAS_CHILDREN;
  }
  else {
    $edit['type'] &= ~MENU_VISIBLE_IF_HAS_CHILDREN;
  }
  return $edit;
}