public function ConfigItemExtra::submitForm

Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().

Overrides ViewsFormBase::submitForm

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/ConfigItemExtra.php, line 104
Contains \Drupal\views_ui\Form\Ajax\ConfigItemExtra.

Class

ConfigItemExtra
Provides a form for configuring extra information for a Views UI item.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function submitForm(array &$form, array &$form_state) {

  // Run it through the handler's submit function.
  $form_state['handler']
    ->submitExtraOptionsForm($form['options'], $form_state);
  $item = $form_state['handler']->options;

  // Store the data we're given.
  foreach ($form_state['values']['options'] as $key => $value) {
    $item[$key] = $value;
  }

  // Store the item back on the view
  $form_state['view']
    ->get('executable')
    ->setItem($form_state['display_id'], $form_state['type'], $form_state['id'], $item);

  // Write to cache
  $form_state['view']
    ->cacheSet();
}