You are here

public function SimpleSitemapDisplayExtender::getSitemapSettings in Simple XML sitemap 8.3

Same name and namespace in other branches
  1. 4.x modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php \Drupal\simple_sitemap_views\Plugin\views\display_extender\SimpleSitemapDisplayExtender::getSitemapSettings()

Gets the sitemap settings.

Parameters

string $variant: The name of the sitemap variant.

Return value

array The sitemap settings.

4 calls to SimpleSitemapDisplayExtender::getSitemapSettings()
SimpleSitemapDisplayExtender::buildOptionsForm in modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php
Provide a form to edit options for this plugin.
SimpleSitemapDisplayExtender::optionsSummary in modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php
Provide the default summary for options in the views UI.
SimpleSitemapDisplayExtender::submitOptionsForm in modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php
Handle any special handling on the validate form.
SimpleSitemapDisplayExtender::validate in modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php
Validate that the plugin is correct and can be saved.

File

modules/simple_sitemap_views/src/Plugin/views/display_extender/SimpleSitemapDisplayExtender.php, line 287

Class

SimpleSitemapDisplayExtender
Simple XML Sitemap display extender plugin.

Namespace

Drupal\simple_sitemap_views\Plugin\views\display_extender

Code

public function getSitemapSettings($variant) {
  $settings = [
    'index' => 0,
    'priority' => 0.5,
    'changefreq' => '',
    'arguments' => [],
    'max_links' => 100,
  ];
  if (isset($this->options['variants'][$variant])) {
    $settings = $this->options['variants'][$variant] + $settings;
  }
  if (empty($this->displayHandler
    ->getHandlers('argument'))) {
    $settings['arguments'] = [];
  }
  else {
    $required_arguments = $this
      ->getRequiredArguments();
    $settings['arguments'] = array_merge($settings['arguments'], $required_arguments);
  }
  return $settings;
}