You are here

function epsacrop_crop_image_reuse_form in EPSA Crop - Image Cropping 7.2

Function that provide the effect form settings for reusing epsa crop.

@access public

Parameters

mixed $data:

Return value

void

1 string reference to 'epsacrop_crop_image_reuse_form'
epsacrop_image_effect_info in ./epsacrop.module
Implements hook_image_effect_info.

File

./epsacrop.module, line 458
The main file of module

Code

function epsacrop_crop_image_reuse_form($data) {
  $styles = array_keys(_epsacrop_load_styles());
  $styles = array_combine($styles, $styles);

  //exclude the current style
  if ($key = array_search(arg(5), $styles)) {
    unset($styles[$key]);
  }
  if (count($styles) > 0) {
    $form['jcrop_reuse'] = array(
      '#title' => t('Reuse the crop selection from'),
      '#type' => 'select',
      '#options' => $styles,
      '#default_value' => isset($data['jcrop_reuse']) ? $data['jcrop_reuse'] : '',
    );
  }
  else {
    $form['jcrop_reuse_message'] = array(
      '#value' => t('No styles were found currently using EPSA crop. Please create a style with EPSA crop first.'),
    );
  }
  return $form;
}