You are here

function imagecache_deprecated_scale_form in ImageCache 5.2

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

Imagecache Deprecated Scale. This will be removed in imagecache 2.1

File

./imagecache_actions.inc, line 96

Code

function imagecache_deprecated_scale_form($data) {
  $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' => $data['fit'],
    '#weight' => 1,
    '#description' => $description,
  );
  $form['width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#default_value' => $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' => $data['height'],
    '#description' => t('Enter a height in pixels or as a percentage. i.e. 500 or 80%.'),
  );
  return $form;
}