image_crop_form

7 image.admin.inc image_crop_form($data)
8 image.admin.inc image_crop_form($data)

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.

Parameters

$data: The current configuration for this crop effect.

1 string reference to 'image_crop_form'

File

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

Code

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;
}
Login or register to post comments