You are here

function purl_item_edit_validate in Persistent URL 6

Same name and namespace in other branches
  1. 7 purl.admin.inc \purl_item_edit_validate()

Validate handler for menu_edit_item

Doesn't actually validate, but rather moves data to where menu_edit_item_submit() expects it.

1 string reference to 'purl_item_edit_validate'
_purl_form_alter in ./purl.admin.inc
Private implementation of hook_form_alter()

File

./purl.admin.inc, line 283
Admin pages for the purl module.

Code

function purl_item_edit_validate($form, &$form_state) {
  $form_state['values']['menu']['options']['purl'] = array();
  if (!empty($form_state['values']['purl']['modifier'])) {
    list($provider, $id) = explode(':', $form_state['values']['purl']['modifier']);
    $form_state['values']['menu']['options']['purl']['provider'] = $provider;
    $form_state['values']['menu']['options']['purl']['id'] = $id;
  }
  if (!empty($form_state['values']['purl']['disabled'])) {
    $form_state['values']['menu']['options']['purl']['disabled'] = 1;
  }
  if (empty($form_state['values']['menu']['options']['purl'])) {
    unset($form_state['values']['menu']['options']['purl']);
  }
}