You are here

function flexslider_views_plugin_style_flexslider::options_form in Flex Slider 7

Same name and namespace in other branches
  1. 7.2 flexslider_views/flexslider_views_plugin_style_flexslider.inc \flexslider_views_plugin_style_flexslider::options_form()

Show a form to edit the style options.

Overrides views_plugin_style::options_form

File

flexslider_views/flexslider_views_plugin_style_flexslider.inc, line 30
flexslider style plugin for the Views module.

Class

flexslider_views_plugin_style_flexslider
Implements a style type plugin for the Views module.

Code

function options_form(&$form, &$form_state) {
  parent::options_form($form, $form_state);
  $form['flexslider'] = array(
    '#type' => 'fieldset',
    '#title' => t('Flex Slider'),
  );
  $optionsets = array();
  foreach (flexslider_optionset_load_all() as $name => $optionset) {
    $optionsets[$name] = check_plain($optionset->title);
  }
  $form['flexslider']['flexslider_optionset'] = array(
    '#title' => t('Option set'),
    '#type' => 'select',
    '#options' => $optionsets,
    '#default_value' => $this->options['flexslider_optionset'],
  );
  $link_options = array(
    '' => t('None'),
  );
  foreach ($this->view->display_handler
    ->get_handlers('field') as $field => $handler) {
    $link_options[$field] = $handler
      ->ui_name();
  }
  $form['flexslider']['caption_field'] = array(
    '#type' => 'select',
    '#title' => t('Caption Field'),
    '#multiple' => FALSE,
    '#description' => t('Select a field to be used as a caption. This is typically the name of the image and can be used to link to the source content.'),
    '#options' => $link_options,
    '#default_value' => $this->options['caption_field'],
  );
  $form['flexslider']['text_field'] = array(
    '#type' => 'select',
    '#title' => t('Description Field'),
    '#multiple' => FALSE,
    '#description' => t('Select a field to be used as a description of the image or extra information for the viewer.'),
    '#options' => $link_options,
    '#default_value' => $this->options['text_field'],
  );
}