You are here

public function date_views_argument_handler_simple::options_validate in Date 7.2

Same name and namespace in other branches
  1. 8 date_views/includes/date_views_argument_handler_simple.inc \date_views_argument_handler_simple::options_validate()
  2. 7.3 date_views/includes/date_views_argument_handler_simple.inc \date_views_argument_handler_simple::options_validate()

Validate the options form.

Overrides views_handler_argument::options_validate

1 call to date_views_argument_handler_simple::options_validate()
date_views_argument_handler::options_validate in date_views/includes/date_views_argument_handler.inc
Validate the options form.
1 method overrides date_views_argument_handler_simple::options_validate()
date_views_argument_handler::options_validate in date_views/includes/date_views_argument_handler.inc
Validate the options form.

File

date_views/includes/date_views_argument_handler_simple.inc, line 213
Date API views argument handler.

Class

date_views_argument_handler_simple
Date API views argument handler.

Code

public function options_validate(&$form, &$form_state) {

  // It is very important to call the parent function here:
  parent::options_validate($form, $form_state);
  if (!preg_match('/^(?:\\-[0-9]{1,4}|[0-9]{4}):(?:[\\+\\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {
    form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9'));
  }
}