function image_rotate_form
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.
1 string reference to 'image_rotate_form'
- image_image_effect_info in modules/
image/ image.effects.inc - Implements hook_image_effect_info().
File
-
modules/
image/ image.admin.inc, line 636
Code
function image_rotate_form($data) {
$form['degrees'] = array(
'#type' => 'textfield',
'#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,
'#size' => 6,
'#maxlength' => 4,
'#element_validate' => array(
'image_effect_integer_validate',
),
'#allow_negative' => TRUE,
);
$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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.