You are here

function imagefield_focus_scale_and_crop_form in ImageField Focus 7

Same name and namespace in other branches
  1. 6 imagefield_focus_imagecache_actions.inc \imagefield_focus_scale_and_crop_form()

Focus Scale and Crop.

1 string reference to 'imagefield_focus_scale_and_crop_form'
imagefield_focus_image_effect_info in ./imagefield_focus.effects.inc
Implementation of hook_image_effect_info().

File

./imagefield_focus.effects.inc, line 58
Written by Henri MEDOT <henri.medot[AT]absyx[DOT]fr> http://www.absyx.fr

Code

function imagefield_focus_scale_and_crop_form($data = array()) {
  $form = image_resize_form($data);
  $form['strength'] = array(
    '#type' => 'radios',
    '#title' => t('Focus strength'),
    '#options' => array(
      'high' => t('High'),
      'medium' => t('Medium'),
      'low' => t('Low'),
    ),
    '#default_value' => isset($data['strength']) ? $data['strength'] : 'high',
  );
  if (module_exists('smartcrop')) {
    $form['fallback'] = array(
      '#type' => 'radios',
      '#title' => t('Fallback effect'),
      '#options' => array(
        'image' => t('!module: !effect', array(
          '!module' => 'Image',
          '!effect' => t('Scale And Crop'),
        )),
        'smartcrop' => t('!module: !effect', array(
          '!module' => 'SmartCrop',
          '!effect' => t('Scale and Smart Crop'),
        )),
      ),
      '#default_value' => isset($data['fallback']) ? $data['fallback'] : 'image',
      '#description' => t('The effect to apply when no focus data is available.'),
    );
  }
  return $form;
}