1 image.admin.inc image_rotate_form($data)

Form structure for the image rotate form.

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

Parameters

$data: The current configuration for this rotate effect.

File

core/modules/image/image.admin.inc, line 561
Admin page callbacks for the Image module.

Code

function image_rotate_form($data) {
  $form['degrees'] = array(
    '#type' => 'number',
    '#default_value' => (isset($data['degrees'])) ? $data['degrees'] : 0,
    '#title' => t('Rotation angle'),
    '#description' => t('The number of degrees the image should be rotated. Positive numbers are clockwise, negative are counter-clockwise.'),
    '#field_suffix' => '°',
    '#required' => TRUE,
    '#min' => -360,
    '#max' => 360,
  );
  $form['bgcolor'] = array(
    '#type' => 'textfield',
    '#default_value' => (isset($data['bgcolor'])) ? $data['bgcolor'] : '#FFFFFF',
    '#title' => t('Background color'),
    '#description' => t('The background color to use for exposed areas of the image. Use web-style hex colors (#FFFFFF for white, #000000 for black). Leave blank for transparency on image types that support it.'),
    '#size' => 7,
    '#maxlength' => 7,
    '#element_validate' => array('image_effect_color_validate'),
  );
  $form['random'] = array(
    '#type' => 'checkbox',
    '#default_value' => (isset($data['random'])) ? $data['random'] : 0,
    '#title' => t('Randomize'),
    '#description' => t('Randomize the rotation angle for each image. The angle specified above is used as a maximum.'),
  );

  return $form;
}