function views_handler_argument::options_submit

Same name in other branches
  1. 6.x-3.x handlers/views_handler_argument.inc \views_handler_argument::options_submit()

Overrides views_handler::options_submit

File

handlers/views_handler_argument.inc, line 486

Class

views_handler_argument
Base class for arguments.

Code

public 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;
    }
    // Handle summary plugin options if one is present.
    if (isset($form_state['values']['options']['summary']['format'])) {
        $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'] = '';
    }
}