public function ArgumentPluginBase::validateOptionsForm in Views (for Drupal 7) 8.3
Validate the options form.
Overrides HandlerBase::validateOptionsForm
File
- lib/
Drupal/ views/ Plugin/ views/ argument/ ArgumentPluginBase.php, line 367 - Definition of Drupal\views\Plugin\views\argument\ArgumentPluginBase.
Class
- ArgumentPluginBase
- Base class for arguments.
Namespace
Drupal\views\Plugin\views\argumentCode
public function validateOptionsForm(&$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) {
$plugin
->validateOptionsForm($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
->validateOptionsForm($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
->validateOptionsForm($form['validate']['options'][$default_id], $form_state, $form_state['values']['options']['validate']['options'][$validate_id]);
}
}