You are here

function lightbox2_field_formatter_settings_form in Lightbox2 8

Same name and namespace in other branches
  1. 7.2 lightbox2.module \lightbox2_field_formatter_settings_form()
  2. 7 lightbox2.module \lightbox2_field_formatter_settings_form()

Implements hook_field_formatter_settings_form().

File

./lightbox2.module, line 917
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function lightbox2_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $form = array();
  $form['type'] = array(
    '#title' => t('Lightbox type'),
    '#type' => 'select',
    '#options' => lightbox2_lightbox_types(),
    '#default_value' => $settings['type'],
  );
  $form['image_style'] = array(
    '#title' => t('Image style'),
    '#description' => t('The thumbnail to display as a link for the lightbox.'),
    '#type' => 'select',
    '#options' => lightbox2_image_styles(),
    '#default_value' => $settings['image_style'],
  );
  $form['lightbox_style'] = array(
    '#title' => t('Lightbox style'),
    '#description' => t('The image style to show inside the lightbox.'),
    '#type' => 'select',
    '#options' => lightbox2_image_styles(),
    '#default_value' => $settings['lightbox_style'],
  );
  $form['caption'] = array(
    '#title' => t('Caption field'),
    '#description' => t('The field to use as a caption.'),
    '#type' => 'select',
    '#options' => lightbox2_image_fields(),
    '#default_value' => $settings['caption'],
  );
  return $form;
}