You are here

function imagecache_actions_pos_form in ImageCache Actions 6.2

Same name and namespace in other branches
  1. 8 utility-form.inc \imagecache_actions_pos_form()
  2. 7 utility-form.inc \imagecache_actions_pos_form()

Prepare a subform for displaying positioning fields

Helper function to render a common element.

4 calls to imagecache_actions_pos_form()
canvasactions_canvas2file_form in canvasactions/canvasactions.inc
Place a given image under the current canvas
canvasactions_definecanvas_form in canvasactions/canvasactions.inc
Implementation of imagecache_hook_form()
canvasactions_file2canvas_form in canvasactions/canvasactions.inc
Place a given image on top of the current canvas
canvasactions_source2canvas_form in canvasactions/canvasactions.inc
Place the source image on top of the current canvas
1 string reference to 'imagecache_actions_pos_form'
canvasactions.inc in canvasactions/canvasactions.inc

File

./utility-form.inc, line 11
Utility form, conversion and rendering functions for image processes

Code

function imagecache_actions_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;
}