You are here

function finder_admin_edit_validate in Finder 6

Same name and namespace in other branches
  1. 7 includes/finder.admin.inc \finder_admin_edit_validate()

Validate function for admin finder add/edit page.

File

includes/finder.admin.inc, line 472
The finder admin screens.

Code

function finder_admin_edit_validate($form, &$form_state) {
  $values =& $form_state['values'];
  $arg_sep = preg_replace("/[\\/\\-\\_\\s]/", "", $values['settings']['advanced']['arg_sep']);
  if (!$arg_sep) {
    form_set_error('arg_sep', t('Multiple value URL arguments separator must contain at least one character that is not a space ( ), forward-slash (/), hyphen (-), or underscore (_).'));
  }
  if (!empty($values['settings']['advanced']['empty_symbol'])) {
    $empty_symbol = preg_replace("/[\\/\\-\\_\\s]/", "", $values['settings']['advanced']['empty_symbol']);
    if (!$empty_symbol) {
      form_set_error('arg_sep', t('Empty value URL arguments symbol must contain at least one character that is not a space ( ), forward-slash (/), hyphen (-), or underscore (_).'));
    }
    if ($arg_sep == $empty_symbol) {
      form_set_error('empty_symbol', t('The "empty value URL arguments symbol" should not be the same as the "multiple value URL arguments separator".'));
    }
  }
}