You are here

function image_resize_filter_form in Image Resize Filter 6

Same name and namespace in other branches
  1. 7 image_resize_filter.module \image_resize_filter_form()

The form for configuring the Image Resize Filter.

1 call to image_resize_filter_form()
image_resize_filter_filter in ./image_resize_filter.module
Implementation of hook_filter().

File

./image_resize_filter.module, line 144
image_resize_filter.module

Code

function image_resize_filter_form($format) {
  $form = array();
  $form['image_resize'] = array(
    '#type' => 'fieldset',
    '#title' => t('Image resize settings'),
    '#collapsible' => TRUE,
    '#description' => t('The image resize filter will analyze <img> tags and compare the given height and width attributes to the actual file. If the file dimensions are different than those given in the <img> tag, the image will be copied and the src attribute will be updated to point to the resized image.'),
    '#theme' => 'image_resize_filter_form',
    '#format' => $format,
  );
  $form['image_resize']['image_resize_filter_image_locations_' . $format] = array(
    '#type' => 'checkboxes',
    '#title' => t('Resize images stored'),
    '#options' => array(
      'local' => t('Locally'),
      'remote' => t('On remote servers (note: this copies <em>all</em> remote images locally)'),
    ),
    '#default_value' => variable_get('image_resize_filter_image_locations_' . $format, array(
      'local',
    )),
    '#description' => t('This option will determine which images will be analyzed for &lt;img&gt; tag differences. Enabling resizing of remote images can have performance impacts, as all images in the filtered text needs to be transfered via HTTP each time the filter cache is cleared.'),
  );
  $form['image_resize']['image_resize_filter_link_' . $format] = array(
    '#type' => 'checkbox',
    '#title' => t('If resized, add a link to the original image.'),
    '#default_value' => variable_get('image_resize_filter_link_' . $format, 0),
  );
  $form['image_resize']['image_resize_filter_link_class_' . $format] = array(
    '#type' => 'textfield',
    '#title' => t('Optionally, give it the class'),
    '#size' => '10',
    '#default_value' => variable_get('image_resize_filter_link_class_' . $format, ''),
  );
  $form['image_resize']['image_resize_filter_link_rel_' . $format] = array(
    '#type' => 'textfield',
    '#title' => t('and/or a rel attribute'),
    '#size' => '10',
    '#default_value' => variable_get('image_resize_filter_link_rel_' . $format, ''),
  );
  return $form;
}