You are here

function ViewsBootstrapCarouselPluginRows::options_form in Views Bootstrap 7

Same name and namespace in other branches
  1. 7.3 plugins/carousel/views_bootstrap_carousel_plugin_rows.inc \ViewsBootstrapCarouselPluginRows::options_form()
  2. 7.2 plugins/carousel/views_bootstrap_carousel_plugin_rows.inc \ViewsBootstrapCarouselPluginRows::options_form()

Form.

Overrides views_plugin_row::options_form

File

plugins/carousel/views_bootstrap_carousel_plugin_rows.inc, line 25
Definition of views_bootstrap_plugin_rows.

Class

ViewsBootstrapCarouselPluginRows
Class to define a row plugin handler.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);

  // Pre-build all of our option lists for the dials and switches that follow.
  $fields = array(
    '' => t('<None>'),
  );
  foreach ($this->display->handler
    ->get_handlers('field') as $field => $handler) {
    if ($label = $handler
      ->label()) {
      $fields[$field] = $label;
    }
    else {
      $fields[$field] = $handler
        ->ui_name();
    }
  }
  $form['image'] = array(
    '#type' => 'select',
    '#required' => TRUE,
    '#title' => t('Image'),
    '#options' => $fields,
    '#default_value' => $this->options['image'],
  );
  $form['title'] = array(
    '#type' => 'select',
    '#title' => t('Title'),
    '#options' => $fields,
    '#default_value' => $this->options['title'],
  );
  $form['description'] = array(
    '#type' => 'select',
    '#title' => t('Description'),
    '#options' => $fields,
    '#default_value' => $this->options['description'],
  );
}