You are here

public function Page::submitOptionsForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/display/Page.php \Drupal\views\Plugin\views\display\Page::submitOptionsForm()

Handle any special handling on the validate form.

Overrides PathPluginBase::submitOptionsForm

File

core/modules/views/src/Plugin/views/display/Page.php, line 485

Class

Page
The plugin that handles a full page.

Namespace

Drupal\views\Plugin\views\display

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
  parent::submitOptionsForm($form, $form_state);
  switch ($form_state
    ->get('section')) {
    case 'menu':
      $menu = $form_state
        ->getValue('menu');
      list($menu['menu_name'], $menu['parent']) = explode(':', $menu['parent'], 2);
      $this
        ->setOption('menu', $menu);

      // send ajax form to options page if we use it.
      if ($form_state
        ->getValue([
        'menu',
        'type',
      ]) == 'default tab') {
        $form_state
          ->get('view')
          ->addFormToStack('display', $this->display['id'], 'tab_options');
      }
      break;
    case 'tab_options':
      $this
        ->setOption('tab_options', $form_state
        ->getValue('tab_options'));
      break;
  }
}