function views_handler_argument::options_submit
3.x views_handler_argument.inc | views_handler_argument::options_submit(&$form, &$form_state) |
Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
Overrides views_handler::options_submit
File
- handlers/
views_handler_argument.inc, line 441 - @todo.
Class
- views_handler_argument
- Base class for arguments.
Code
function options_submit(&$form, &$form_state) {
if (empty($form_state['values']['options'])) {
return;
}
// Let the plugins make submit modifications if necessary.
$default_id = $form_state['values']['options']['default_argument_type'];
$plugin = $this->get_plugin('argument default', $default_id);
if ($plugin) {
$options = &$form_state['values']['options']['argument_default'][$default_id];
$plugin->options_submit($form['argument_default'][$default_id], $form_state, $options);
// Copy the now submitted options to their final resting place so they get saved.
$form_state['values']['options']['default_argument_options'] = $options;
}
// summary plugin
$summary_id = $form_state['values']['options']['summary']['format'];
$plugin = $this->get_plugin('style', $summary_id);
if ($plugin) {
$options = &$form_state['values']['options']['summary']['options'][$summary_id];
$plugin->options_submit($form['summary']['options'][$summary_id], $form_state, $options);
// Copy the now submitted options to their final resting place so they get saved.
$form_state['values']['options']['summary_options'] = $options;
}
$validate_id = $form_state['values']['options']['validate']['type'];
$plugin = $this->get_plugin('argument validator', $validate_id);
if ($plugin) {
$options = &$form_state['values']['options']['validate']['options'][$validate_id];
$plugin->options_submit($form['validate']['options'][$validate_id], $form_state, $options);
// Copy the now submitted options to their final resting place so they get saved.
$form_state['values']['options']['validate_options'] = $options;
}
// Clear out the content of title if it's not enabled.
$options = &$form_state['values']['options'];
if (empty($options['title_enable'])) {
$options['title'] = '';
}
}