You are here

function views_foundation_plugin_style_clearing::options_form in Views Foundation 7.4

Same name and namespace in other branches
  1. 7 view/views_foundation_plugin_style_clearing.inc \views_foundation_plugin_style_clearing::options_form()

Provide a form for setting options.

Overrides views_plugin_style::options_form

File

view/views_foundation_plugin_style_clearing.inc, line 33
Views Foundation Clearing plugin.

Class

views_foundation_plugin_style_clearing
Style plugin to render rows in a Foundation Clearing plugin.

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] = $handler
        ->label() . ': ' . $handler->options['settings']['image_style'];
    }
    else {
      $fields[$field] = $handler
        ->ui_name();
    }
  }
  $form['image'] = array(
    '#type' => 'select',
    '#title' => t('Image'),
    '#required' => TRUE,
    '#options' => $fields,
    '#default_value' => $this->options['image'],
    '#description' => t('Select the field that will be used as the image.'),
  );
  $form['thumbnail'] = array(
    '#type' => 'select',
    '#title' => t('Thumbnail'),
    '#options' => $fields,
    '#default_value' => $this->options['thumbnail'],
    '#description' => t('Select the field that will be used as the thumbnail.(optional)'),
  );
  $form['caption'] = array(
    '#type' => 'select',
    '#title' => t('Caption'),
    '#options' => $fields,
    '#default_value' => $this->options['caption'],
    '#description' => t('Select the field that will be used as the image caption.(optional)'),
  );
  $form['thumb_border'] = array(
    '#type' => 'checkbox',
    '#title' => t('Thumbnail border'),
    '#description' => t('Select this checkbox if you want thumbnails border'),
    '#default_value' => $this->options['thumb_border'],
  );
}