Same name and namespace in other branches
  1. 8.x-4.x src/Plugin/ViewsSlideshowWidgetType/Pager.php \Drupal\views_slideshow\Plugin\ViewsSlideshowWidgetType\Pager::defaultConfiguration()

Overrides ViewsSlideshowWidgetTypeBase::defaultConfiguration

File

src/Plugin/ViewsSlideshowWidgetType/Pager.php, line 28

Class

Pager
Provides a pager widget type.

Namespace

Drupal\views_slideshow\Plugin\ViewsSlideshowWidgetType

Code

public function defaultConfiguration() {
    $options = parent::defaultConfiguration() + [
        'type' => [
            'default' => 0,
        ],
        'views_slideshow_pager_numbered_hover' => [
            'default' => 0,
        ],
        'views_slideshow_pager_numbered_click_to_page' => [
            'default' => 0,
        ],
        'views_slideshow_pager_thumbnails_hover' => [
            'default' => 0,
        ],
        'views_slideshow_pager_thumbnails_click_to_page' => [
            'default' => 0,
        ],
    ];
    
    /**
     * @var \Drupal\Component\Plugin\PluginManagerInterface
     */
    $widgetManager = \Drupal::service('plugin.manager.views_slideshow.widget');
    // Get default configuration of all Pager plugins.
    foreach ($widgetManager->getDefinitions($this->getPluginId()) as $widget_id => $widget_info) {
        $options += $widgetManager->createInstance($widget_id, [])
            ->defaultConfiguration();
    }
    return $options;
}