You are here

function canvasactions_canvas2file_form in ImageCache Actions 8

Same name and namespace in other branches
  1. 5.3 canvasactions.inc \canvasactions_canvas2file_form()
  2. 5.2 canvasactions.inc \canvasactions_canvas2file_form()
  3. 6.2 canvasactions/canvasactions.inc \canvasactions_canvas2file_form()
  4. 6 canvasactions.inc \canvasactions_canvas2file_form()
  5. 7 canvasactions/canvasactions.inc \canvasactions_canvas2file_form()

Image effect form callback for the underlay (background) effect.

Parameters

array $data: The current configuration for this image effect.

Return value

array The form definition for this effect.

1 string reference to 'canvasactions_canvas2file_form'
imagecache_canvasactions_image_effect_info in canvasactions/imagecache_canvasactions.module
Implements hook_image_effect_info().

File

canvasactions/canvasactions.inc, line 478

Code

function canvasactions_canvas2file_form(array $data) {
  $defaults = array(
    'xpos' => '0',
    'ypos' => '0',
    'alpha' => '100',
    'path' => '',
    'dimensions' => 'original',
  );
  $data = array_merge($defaults, (array) $data);
  $form = imagecache_actions_pos_form($data);
  $form['alpha'] = array(
    '#type' => 'textfield',
    '#title' => t('opacity'),
    '#default_value' => $data['alpha'],
    '#size' => 6,
    '#description' => t('Opacity: 0-100. Be aware that values other than 100% may be slow to process.'),
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('file name'),
    '#default_value' => $data['path'],
    '#description' => imagecache_actions_file_field_description(),
    '#element_validate' => array(
      'imagecache_actions_validate_file',
    ),
  );
  $form['dimensions'] = array(
    '#type' => 'radios',
    '#title' => t('final dimensions'),
    '#default_value' => $data['dimensions'],
    '#options' => array(
      'original' => 'original (dimensions are retained)',
      'background' => 'background (image will be forced to match the size of the background)',
      'minimum' => 'minimum (image may be cropped)',
      'maximum' => 'maximum (image may end up with gaps)',
    ),
    '#description' => t('What to do when the background image is a different size from the source image. Backgrounds are not tiled, but may be arbitrarily large.'),
  );
  return $form;
}