function imagecacheactions_pos_form in ImageCache Actions 6
Prepare a subform for displaying positioning fields
Helper function to render a common element.
4 calls to imagecacheactions_pos_form()
- canvasactions_canvas2file_form in ./
canvasactions.inc - Place a given image under the current canvas
- canvasactions_definecanvas_form in ./
canvasactions.inc - Implementation of imagecache_hook_form()
- canvasactions_file2canvas_form in ./
canvasactions.inc - Place a given image on top of the current canvas
- canvasactions_source2canvas_form in ./
canvasactions.inc - Place the source image on top of the current canvas
File
- ./
utility.inc, line 35 - Utility form, conversion and rendering functions for image processes
Code
function imagecacheactions_pos_form($action) {
$defaults = array(
'xpos' => 'center',
'ypos' => 'center',
);
$action = array_merge($defaults, (array) $action);
$form = array(
#'#theme' => 'canvasactions_pos_form',
'xpos' => array(
'#type' => 'textfield',
'#title' => t('X offset'),
'#default_value' => $action['xpos'],
'#size' => 6,
'#description' => t('Enter an offset in pixels or use a keyword: <em>left</em>, <em>center</em>, or <em>right</em>.'),
'#element_validate' => array(
'imagecache_actions_validate_number',
),
),
'ypos' => array(
'#type' => 'textfield',
'#title' => t('Y offset'),
'#default_value' => $action['ypos'],
'#size' => 6,
'#description' => t('Enter an offset in pixels or use a keyword: <em>top</em>, <em>center</em>, or <em>bottom</em>.'),
'#element_validate' => array(
'imagecache_actions_validate_number',
),
),
);
return $form;
}