You are here

function manualcrop_reuse_form in Manual Crop 7

Form builder; Configuration settings for the reuse effect.

Parameters

$data: The current configuration for this reuse effect.

Return value

The form structure array.

1 string reference to 'manualcrop_reuse_form'
manualcrop_image_effect_info in ./manualcrop.module
Implements hook_image_effect_info().

File

./manualcrop.admin.inc, line 229
Admin functionality for the Manual Crop module.

Code

function manualcrop_reuse_form($data) {

  // Load the crop image styles and exclude the style that's being edited.
  $styles = manualcrop_styles_with_crop(FALSE, 5, TRUE);
  if (empty($styles)) {
    drupal_set_message(t('No Manual Crop enabled image style could be found. To reuse a crop selection, you need to create at least one image style that uses Manual Crop.'), 'warning');
    drupal_goto('admin/config/media/image-styles/edit/' . arg(5));
  }
  $form['reuse_crop_style'] = array(
    '#type' => 'select',
    '#title' => t('Base image style'),
    '#description' => t('Base this image style upon the crop selection of the selected style.'),
    '#options' => $styles,
    '#default_value' => isset($data['reuse_crop_style']) ? $data['reuse_crop_style'] : '',
    '#required' => TRUE,
  );
  $form['apply_all_effects'] = array(
    '#type' => 'checkbox',
    '#title' => t('Apply all effects'),
    '#description' => t('Apply all effects of the base image style.'),
    '#default_value' => !empty($data['apply_all_effects']),
  );
  return $form;
}