You are here

function purl_redirect_edit_validate in Persistent URL 7

Submit handler for menu_edit_menu

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

File

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

Code

function purl_redirect_edit_validate($form, &$form_state) {
  if ($form_state['values']['purl']['disabled'] == 0 && $form_state['values']['purl']['modifier']) {
    $purl_settings = explode(':', $form_state['values']['purl']['modifier']);
    $form_state['values']['redirect_options'] = array(
      'purl' => array(
        'add' => array(
          array(
            'provider' => $purl_settings[0],
            'id' => $purl_settings[1],
          ),
        ),
      ),
    );
  }
  else {
    $form_state['values']['redirect_options'] = array();
  }
}