You are here

function menu_block_configure_form_parent_validate in Menu Block 6.2

Same name and namespace in other branches
  1. 7.3 menu_block.admin.inc \menu_block_configure_form_parent_validate()
  2. 7.2 menu_block.admin.inc \menu_block_configure_form_parent_validate()

Validates the parent element of the block configuration form.

1 string reference to 'menu_block_configure_form_parent_validate'
menu_block_configure_form in ./menu_block.admin.inc
Returns the configuration form for a menu tree.

File

./menu_block.admin.inc, line 325
Provides infrequently used functions for menu_block.

Code

function menu_block_configure_form_parent_validate($element, &$form_state) {

  // Determine the fixed parent item's menu and mlid.
  list($menu_name, $parent_mlid) = explode(':', $form_state['values']['parent_mlid']);
  if ($parent_mlid) {

    // If mlid is set, its menu overrides the menu_name option.
    $form_state['values']['menu_name'] = $menu_name;
  }
  else {

    // Otherwise the menu_name overrides the parent item option.
    $form_state['values']['parent_mlid'] = $menu_name . ':0';
  }

  // The value of "parent" stored in the database/config array is the menu name
  // combined with the optional parent menu item's mlid.
  $form_state['values']['parent'] = $form_state['values']['parent_mlid'];
}