You are here

function iss_field_instance_settings_form in Image Style Selector 7

Implements hook_field_instance_settings_form().

File

./iss.module, line 64
Image Style Selector field.

Code

function iss_field_instance_settings_form($field, $instance) {
  $form = array();
  if ($field['type'] == 'iss') {
    $form['image_field_name'] = array(
      '#type' => 'select',
      '#title' => t('Image field'),
      '#description' => t('Select the image field where the image style has to be applied to.'),
      '#options' => iss_image_field_name_options($instance['entity_type'], $instance['bundle']),
      '#default_value' => $instance['settings']['image_field_name'],
    );
    $form['image_styles'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Image styles'),
      '#description' => t('Select the image styles that should be available for the user to select.'),
      '#options' => image_style_options(FALSE, PASS_THROUGH),
      '#default_value' => $instance['settings']['image_styles'],
      '#required' => TRUE,
      '#element_validate' => array(
        'iss_image_styles_options_validate',
      ),
    );
  }
  return $form;
}