You are here

function search_api_page_admin_add_validate in Search API Pages 7

Validation callback for search_api_page_admin_add().

File

./search_api_page.admin.inc, line 273
Admin page callbacks for the Search pages module.

Code

function search_api_page_admin_add_validate(array $form, array &$form_state) {
  if (empty($form_state['step_one'])) {
    $form_state['values']['path'] = drupal_strtolower(trim($form_state['values']['path']));
    if (search_api_page_load_multiple(FALSE, array(
      'path' => $form_state['values']['path'],
    ))) {
      form_set_error('path', t('The entered path is already in use. Please enter a unique path.'));
    }
  }
}