You are here

function apachesolr_nan_nan_settings_form_validate in Apache Solr Not-A-Node 7

Same name and namespace in other branches
  1. 7.2 apachesolr_nan.admin.inc \apachesolr_nan_nan_settings_form_validate()

Validation for the admin page.

See also

apachesolr_nan_nan_settings_form().

apachesolr_nan_nan_settings_form_submit().

File

./apachesolr_nan.admin.inc, line 161
Administrative functions and form builders for Apache Solr NAN Search.

Code

function apachesolr_nan_nan_settings_form_validate($form, &$form_state) {

  // Validate the paths.
  if (!empty($form_state['items'])) {
    foreach ($form_state['items'] as $i => $data) {
      $path = $form_state['values']['item'][$i]['path'];
      if (!drupal_valid_path(drupal_get_normal_path($path))) {
        if (empty($form_state['all_removed']) && $path != '') {
          form_set_error("item][{$i}][path", t('The path is not valid or you do not have access to it.'));
        }
      }
    }
  }
}