You are here

function hansel_ui_settings_validate in Hansel breadcrumbs 7

Same name and namespace in other branches
  1. 8 hansel_ui/hansel_ui.module \hansel_ui_settings_validate()

Validate callback for the Hansel settings form.

File

hansel_ui/hansel_ui.module, line 229
Hansel UI module

Code

function hansel_ui_settings_validate($form, &$form_state) {
  if (!preg_match('/^[0-9]+$/', $form_state['values']['hansel_max_item_length'])) {
    form_set_error('hansel_max_item_length', t('The maximum length of individual breadcrumb items must be a number.'));
  }
  if (!preg_match('/^[0-9]+$/', $form_state['values']['hansel_max_item_count'])) {
    form_set_error('hansel_max_item_count', t('The maximum number of items must be a number.'));
  }
}