You are here

public function BlazyViews::options_form in Blazy 7

Provide a form to edit options for this plugin.

Overrides views_plugin_style::options_form

File

src/Plugin/views/style/BlazyViews.php, line 36

Class

BlazyViews
Blazy style plugin.

Namespace

Drupal\blazy\Plugin\views\style

Code

public function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $definition = [
    'namespace' => 'blazy',
    'forms' => [
      'grid' => TRUE,
    ],
    'settings' => $this->options,
    'style' => TRUE,
    'grid_required' => TRUE,
    'opening_class' => 'form--views',
  ];

  // Build the form.
  $this
    ->admin()
    ->openingForm($form, $definition);
  $this
    ->admin()
    ->gridForm($form, $definition);
  if (isset($form['grid'])) {
    $form['grid']['#description'] = t('The amount of block grid columns for large monitors 64.063em.');
  }
  $this
    ->admin()
    ->finalizeForm($form, $definition);

  // Blazy doesn't need complex grid with multiple groups.
  unset($form['layout'], $form['preserve_keys'], $form['visible_items']);
}