You are here

public function ViewsIsotopeViewsPluginStyleIsotopeGrid::optionsForm in Brainstorm profile 7

Render the given style.

File

modules/custom/views_isotope/views/ViewsIsotopeViewsPluginStyleIsotopeGrid.inc, line 28
Define the "grid" views plugin.

Class

ViewsIsotopeViewsPluginStyleIsotopeGrid
Style plugin.

Code

public function optionsForm(&$form, &$form_state) {
  $handlers = $this->display->handler
    ->get_handlers('field');
  if (empty($handlers)) {
    $form['error_markup'] = [
      '#markup' => t('<div class="error messages">You need at least one field before you can configure your isotope settings</div>'),
    ];
    return;
  }
  $form['config'] = [
    '#type' => 'select',
    '#options' => views_isotope_available_configs(),
    '#title' => t('Choose Isotope Configuration'),
    '#default_value' => !empty($this->options['config']) ? $this->options['config'] : 'isotope_default_config',
    '#required' => TRUE,
    '#description' => l(t('Manage Configurations'), 'admin/config/user-interface/isotope'),
  ];
  $field_names = $this->display->handler
    ->get_field_labels();
  $form['data_fields'] = [
    '#type' => 'checkboxes',
    '#options' => $field_names,
    '#title' => t('Data Fields'),
    '#default_value' => $this->options['data_fields'],
    '#description' => t('Select which fields contain data to be used for filtering / sorting.'),
  ];
  $form['instance_id'] = [
    '#type' => 'textfield',
    '#title' => t('Enter an Instance ID'),
    '#default_value' => $this->options['instance_id'],
    '#description' => t('(Optional) If you have multiple grids on a page and you want filters that target specific ones.'),
  ];
}