You are here

function imagecache_deprecated_scale_form in ImageCache 6.2

Same name and namespace in other branches
  1. 5.2 imagecache_actions.inc \imagecache_deprecated_scale_form()

ImageCache Deprecated Scale. This will be removed in imagecache 2.1

File

./imagecache_actions.inc, line 91

Code

function imagecache_deprecated_scale_form($data = array()) {
  $helptext = array();
  $helptext['inside'] = t('<strong>Inside dimensions</strong>: Final dimensions will be less than or equal to the entered width and height. Useful for ensuring a maximum height and/or width.');
  $helptext['outside'] = t('<strong>Outside dimensions</strong>: Final dimensions will be greater than or equal to the entered width and height. Ideal for cropping the result to a square.');
  $description = '<ul><li>' . implode('</li><li>', $helptext) . '</li><ul>';
  $form['fit'] = array(
    '#type' => 'select',
    '#title' => t('Scale to fit'),
    '#options' => array(
      'inside' => t('Inside dimensions'),
      'outside' => t('Outside dimensions'),
    ),
    '#default_value' => isset($data['fit']) ? $data['fit'] : NULL,
    '#weight' => 1,
    '#description' => $description,
  );
  $form['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#default_value' => isset($data['width']) ? $data['width'] : '',
    '#description' => t('Enter a width in pixels or as a percentage. i.e. 500 or 80%.'),
  );
  $form['height'] = array(
    '#type' => 'textfield',
    '#title' => t('Height'),
    '#default_value' => isset($data['height']) ? $data['height'] : '',
    '#description' => t('Enter a height in pixels or as a percentage. i.e. 500 or 80%.'),
  );
  return $form;
}