You are here

function photoswipe_field_formatter_settings_form in PhotoSwipe 7

Same name and namespace in other branches
  1. 7.2 photoswipe.module \photoswipe_field_formatter_settings_form()

Implements hook_field_formatter_settings_form().

File

./photoswipe.module, line 114
Photswipe integration with Drupal module.

Code

function photoswipe_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $image_styles = image_style_options(FALSE);
  $image_styles_hide = $image_styles;
  $image_styles_hide['hide'] = t('Hide (do not display image)');
  $element['photoswipe_node_style'] = array(
    '#title' => t('Node image style'),
    '#type' => 'select',
    '#default_value' => $settings['photoswipe_node_style'],
    '#empty_option' => t('None (original image)'),
    '#options' => $image_styles_hide,
    '#description' => t('Image style to use in the node.'),
  );
  $element['photoswipe_image_style'] = array(
    '#title' => t('Photoswipe image style'),
    '#type' => 'select',
    '#default_value' => $settings['photoswipe_image_style'],
    '#empty_option' => t('None (original image)'),
    '#options' => $image_styles,
    '#description' => t('Image style to use in the Photoswipe.'),
  );
  return $element;
}