function _datex_date_views_argument_handler_simple::options_validate in Datex 7.3
Validate the options form.
Overrides views_handler_argument::options_validate
File
- ./
datex.views.inc, line 726 - Datex views integration.
Class
- _datex_date_views_argument_handler_simple
- Copied from date_views module. So we have no hard dependency on it.
Code
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'));
}
}