You are here

function imagecrop_reuse_form in Image javascript crop 6

Same name and namespace in other branches
  1. 7 includes/imagecrop.effects.inc \imagecrop_reuse_form()

Settings form for reüsing a crop selection.

File

./imagecrop_actions.inc, line 294
Imagecache actions implementation.

Code

function imagecrop_reuse_form($data) {
  $presets = imagecrop_presets_list();
  if (count($presets) > 0) {
    $form['imagecrop_presetname'] = array(
      '#title' => t('Enabled imagecrop presets'),
      '#type' => 'select',
      '#options' => $presets,
      '#default_value' => (array) $data['imagecrop_presetname'],
    );
  }
  else {
    $form['imagecrop_warning'] = array(
      '#value' => t('No preset is found with the javascript_crop action so far. If you want to take advantage of this action, you will need to create at least one preset with javascript_crop action.'),
    );
  }
  return $form;
}