You are here

protected function SlickViewsBase::getDefinedFormScopes in Slick Views 8.2

Same name and namespace in other branches
  1. 7.3 src/Plugin/views/style/SlickViewsBase.php \Drupal\slick_views\Plugin\views\style\SlickViewsBase::getDefinedFormScopes()

Returns the defined scopes for the current form.

2 calls to SlickViewsBase::getDefinedFormScopes()
SlickGrouping::buildOptionsForm in src/Plugin/views/style/SlickGrouping.php
Overrides parent::buildOptionsForm().
SlickViews::buildOptionsForm in src/Plugin/views/style/SlickViews.php
Overrides parent::buildOptionsForm().

File

src/Plugin/views/style/SlickViewsBase.php, line 60

Class

SlickViewsBase
The base class common for Slick style plugins.

Namespace

Drupal\slick_views\Plugin\views\style

Code

protected function getDefinedFormScopes(array $extra_fields = []) {

  // Pass the common field options relevant to this style.
  $fields = [
    'captions',
    'classes',
    'images',
    'layouts',
    'links',
    'overlays',
    'thumbnails',
    'thumb_captions',
    'titles',
  ];

  // Fetches the returned field definitions to be used to define form scopes.
  $fields = array_merge($fields, $extra_fields);
  $definition = $this
    ->getDefinedFieldOptions($fields);

  // @todo remove _form for forms when Blazy 2.x has it.
  $options = [
    'fieldable_form',
    'grid_form',
    'id',
    'nav',
    'thumb_positions',
    'vanilla',
  ];
  foreach ($options as $key) {
    $definition[$key] = TRUE;
  }
  $definition['forms'] = [
    'fieldable' => TRUE,
    'grid' => TRUE,
  ];
  $definition['opening_class'] = 'form--views';
  $definition['_views'] = TRUE;
  return $definition;
}