You are here

function taxo_faceted_navigation_admin_settings_validate in Taxonomy Facets 7

Validate the configuration form.

File

./taxo_faceted_navigation.admin.inc, line 150
taxo_faceted_navigation.admin.inc Admin section of the taxo faceted navigation module

Code

function taxo_faceted_navigation_admin_settings_validate($form, &$form_state) {

  // Get firs argument as entered by user.
  $first_arg = $form_state['values']['taxo_faceted_navigation_first_argument'];

  // Query menu router table and see if this argument has been already used.
  $duplicate_menu_item = taxo_faceted_navigation_firstarg_exsists_in_menu_router($first_arg);
  if ($duplicate_menu_item) {
    form_set_error('taxo_faceted_navigation_first_argument', t('The keyword') . ' ' . $first_arg . ' ' . t('can not be used as first argument. It has already been used in the first elementh of fallowing menu path(s)') . ':<br />' . $duplicate_menu_item . '</br>' . t('Please either rename this item or go to clean urls page end rename exsisting item, or examine router page to see which item is cousing the problem.'));
  }
  else {
    global $base_url;
    $link = l(t('this page to clear the cache'), check_plain($base_url) . '/admin/config/development/performance');
    drupal_set_message(t('Value saved, please clear all caches now or you may get unexpected results. Go to: !link', array(
      '!link' => $link,
    )), 'warning');
  }
}