You are here

function views_slideshow_views_slideshow_option_definition in Views Slideshow 8.3

Same name and namespace in other branches
  1. 6.3 views_slideshow.module \views_slideshow_views_slideshow_option_definition()
  2. 6 views_slideshow.views_slideshow.inc \views_slideshow_views_slideshow_option_definition()
  3. 7.3 views_slideshow.module \views_slideshow_views_slideshow_option_definition()

Implements hook_views_slideshow_option_definition().

File

./views_slideshow.module, line 433
Provides Slideshow style options for Views.

Code

function views_slideshow_views_slideshow_option_definition() {

  // Default slideshow type and skins.
  $options['slideshow_type'] = array(
    'default' => '',
  );
  $options['slideshow_skin'] = array(
    'default' => '',
  );
  $options['skin_info'] = array(
    'default' => array(
      'class' => 'default',
      'name' => t('Untitled skin'),
      'module' => 'views_slideshow',
      'libraries' => array(),
    ),
  );

  // Set default widgets and weight values.
  $widgets = \Drupal::moduleHandler()
    ->invokeAll('views_slideshow_widget_info');
  if ($widgets) {
    $locations = array(
      'top',
      'bottom',
    );
    foreach ($locations as $location) {
      foreach ($widgets as $widget_id => $widget_name) {
        $options['widgets']['contains'][$location]['contains'][$widget_id]['contains']['enable'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains'][$widget_id]['contains']['weight'] = array(
          'default' => 1,
        );

        // Defaults for the pager widget.
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['hide_on_single_slide'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['type'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_numbered_hover'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_numbered_click_to_page'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_thumbnails_hover'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_thumbnails_click_to_page'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_fields_fields'] = array(
          'default' => array(),
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_pager']['contains']['views_slideshow_pager_fields_hover'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_controls']['contains']['hide_on_single_slide'] = array(
          'default' => 0,
        );
        $options['widgets']['contains'][$location]['contains']['views_slideshow_controls']['contains']['type'] = array(
          'default' => 0,
        );
      }
    }
  }
  return $options;
}