You are here

function imagecrop_reuse_form in Image javascript crop 7

Same name and namespace in other branches
  1. 6 imagecrop_actions.inc \imagecrop_reuse_form()

Settings form for reüsing a crop selection.

1 string reference to 'imagecrop_reuse_form'
imagecrop_image_effect_info in includes/imagecrop.effects.inc
Implements hook_image_effect_info().

File

includes/imagecrop.effects.inc, line 233
Registry for the image style effects from imagecrop.

Code

function imagecrop_reuse_form($data) {
  $presets = get_imagecrop_styles();

  // Make sure people don't select current preset.
  if ($key = array_search(arg(5), $presets)) {
    unset($presets[$key]);
  }
  if (count($presets) > 0) {
    $form['imagecrop_style'] = array(
      '#title' => t('Use the crop settings from'),
      '#type' => 'select',
      '#options' => $presets,
      '#default_value' => isset($data['imagecrop_style']) ? $data['imagecrop_style'] : '',
    );
  }
  else {
    $form['imagecrop_warning'] = array(
      '#value' => t('No image style is found with the javascript_crop action so far. If you want to take advantage of this module, you will need to create at least one image style with that action.'),
    );
  }
  return $form;
}