1.20.x views_handler_argument.inc views_handler_argument::options_validate(&$form, &$form_state)

Validate the options form.

Overrides views_handler::options_validate

File

modules/views/handlers/views_handler_argument.inc, line 429
@todo.

Class

views_handler_argument
Base class for arguments.

Code

function options_validate(&$form, &$form_state) {
  if (empty($form_state['values']['options'])) {
    return;
  }

  // Let the plugins do validation.
  $default_id = $form_state['values']['options']['default_argument_type'];
  $plugin = $this->get_plugin('argument default', $default_id);
  if ($plugin && isset($form['argument_default'][$default_id]) && isset($form_state['values']['options']['argument_default'][$default_id])) {
    $plugin->options_validate($form['argument_default'][$default_id], $form_state, $form_state['values']['options']['argument_default'][$default_id]);
  }

  // summary plugin
  $summary_id = $form_state['values']['options']['summary']['format'];
  $plugin = $this->get_plugin('style', $summary_id);
  if ($plugin) {
    $plugin->options_validate($form['summary']['options'][$summary_id], $form_state, $form_state['values']['options']['summary']['options'][$summary_id]);
  }

  $validate_id = $form_state['values']['options']['validate']['type'];
  $plugin = $this->get_plugin('argument validator', $validate_id);
  if ($plugin) {
    $plugin->options_validate($form['validate']['options'][$default_id], $form_state, $form_state['values']['options']['validate']['options'][$validate_id]);
  }

}