You are here

public function SimpleSitemapDisplayExtender::submitOptionsForm in Simple XML sitemap (Views integration) 8

Handle any special handling on the validate form.

Overrides DisplayExtenderPluginBase::submitOptionsForm

File

src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php, line 194
Contains Simple XML Sitemap display extender.

Class

SimpleSitemapDisplayExtender
Simple XML Sitemap display extender plugin.

Namespace

Drupal\simple_sitemap_views\Plugin\views\display_extender

Code

public function submitOptionsForm(&$form, FormStateInterface $form_state) {
  if ($this
    ->hasSitemapSettings() && $form_state
    ->get('section') == 'simple_sitemap') {
    $values = $form_state
      ->cleanValues()
      ->getValues();
    $values['arguments'] = isset($values['arguments']) ? array_filter($values['arguments']) : [];

    // Save sitemap settings.
    foreach ($values as $key => $value) {
      if (isset($this->options[$key])) {
        $this->options[$key] = $value;
      }
    }
  }
}