You are here

function image_resize_form in Drupal 7

Form structure for the image resize form.

Note that this is not a complete form, it only contains the portion of the form for configuring the resize options. Therefore it does not not need to include metadata about the effect, nor a submit button.

Parameters

$data: The current configuration for this resize effect.

2 calls to image_resize_form()
image_crop_form in modules/image/image.admin.inc
Form structure for the image crop form.
image_scale_form in modules/image/image.admin.inc
Form structure for the image scale form.
1 string reference to 'image_resize_form'
image_image_effect_info in modules/image/image.effects.inc
Implements hook_image_effect_info().

File

modules/image/image.admin.inc, line 525
Administration pages for image settings.

Code

function image_resize_form($data) {
  $form['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#default_value' => isset($data['width']) ? $data['width'] : '',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 10,
    '#element_validate' => array(
      'image_effect_integer_validate',
    ),
    '#allow_negative' => FALSE,
  );
  $form['height'] = array(
    '#type' => 'textfield',
    '#title' => t('Height'),
    '#default_value' => isset($data['height']) ? $data['height'] : '',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 10,
    '#element_validate' => array(
      'image_effect_integer_validate',
    ),
    '#allow_negative' => FALSE,
  );
  return $form;
}