You are here

function image_gallery_handler_field_gallery_cover_thumbnail::options_form in Image 6

Same name and namespace in other branches
  1. 7 contrib/image_gallery/views/image_gallery_handler_field_gallery_cover_thumbnail.inc \image_gallery_handler_field_gallery_cover_thumbnail::options_form()

Extends the field's basic options with more image specific options.

Overrides image_gallery_handler_field_gallery_cover::options_form

File

contrib/image_gallery/views/image_gallery_handler_field_gallery_cover_thumbnail.inc, line 26

Class

image_gallery_handler_field_gallery_cover_thumbnail
Field handler for gallery cover node image.

Code

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

  // Overwrite the descendants option so the text is relevant.
  $form['descendants']['#description'] = theme('advanced_help_topic', 'image_gallery', 'descendants') . t('Whether to go into subgalleries when getting a cover image. Either: consider only this gallery itself, consider subgalleries all together, or recurse into subgalleries one by one if the gallery itself is empty.');
  $form['descendants']['#options'] = array(
    'single' => t('Only get cover image from this gallery'),
    'flat' => t('Consider subgalleries, flattened.'),
    'recurse' => t('Consider subgalleries, recursively. (Warning: this can produce many queries per row if your parent galleries are empty!).'),
  );
  foreach (image_get_sizes() as $key => $size) {
    $sizes[$key] = $size['label'];
  }
  $form['image_derivative'] = array(
    '#type' => 'select',
    '#title' => t('Image size to show'),
    '#options' => $sizes,
    '#default_value' => $this->options['image_derivative'],
    '#description' => t('Pick an image derivative to display.'),
  );
}