You are here

function canvasactions_imagemask_form in ImageCache Actions 8

Same name and namespace in other branches
  1. 6.2 canvasactions/canvasactions.inc \canvasactions_imagemask_form()
  2. 7 canvasactions/canvasactions.inc \canvasactions_imagemask_form()

Image effect form callback for the image mask 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_imagemask_form'
imagecache_canvasactions_image_effect_info in canvasactions/imagecache_canvasactions.module
Implements hook_image_effect_info().

File

canvasactions/canvasactions.inc, line 34

Code

function canvasactions_imagemask_form(array $data) {

  // @todo: add offset/positioning/scaling support - currently the mask is applied to the supplied image without resizing and positioned at (0,0)
  $form = array();
  $form['effect_help_text'] = array(
    '#type' => 'item',
    '#title' => t('Image mask'),
    '#description' => t('This effect will add (or replace) a transparency channel to your image. The mask file should be a grayscale image where black is fully transparent and white is fully opaque. The referenced mask will be applied to the top left of the image.'),
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Mask file name'),
    '#default_value' => isset($data['path']) ? $data['path'] : '',
    '#description' => imagecache_actions_file_field_description(),
    '#element_validate' => array(
      'imagecache_actions_validate_file',
    ),
  );
  return $form;
}