Form structure for the image crop form.
Note that this is not a complete form, it only contains the portion of the form for configuring the crop options. Therefore it does not not need to include metadata about the effect, nor a submit button.
$data: The current configuration for this crop effect.
function image_crop_form($data) {
$data += array(
'width' => '',
'height' => '',
'anchor' => 'center-center',
);
$form = image_resize_form($data);
$form['anchor'] = array(
'#type' => 'radios',
'#title' => t('Anchor'),
'#options' => array(
'left-top' => t('Top') . ' ' . t('Left'),
'center-top' => t('Top') . ' ' . t('Center'),
'right-top' => t('Top') . ' ' . t('Right'),
'left-center' => t('Center') . ' ' . t('Left'),
'center-center' => t('Center'),
'right-center' => t('Center') . ' ' . t('Right'),
'left-bottom' => t('Bottom') . ' ' . t('Left'),
'center-bottom' => t('Bottom') . ' ' . t('Center'),
'right-bottom' => t('Bottom') . ' ' . t('Right'),
),
'#theme' => 'image_anchor',
'#default_value' => $data['anchor'],
'#description' => t('The part of the image that will be retained during the crop.'),
);
return $form;
}