You are here

function iek_image_padding_form in Image effect kit 7

Effect configuration form for iek_image_padding.

1 string reference to 'iek_image_padding_form'
iek_image_effect_info in ./iek.module
Implements hook_image_effect_info().

File

./iek.module, line 486
Primarily Drupal hooks and global API functions to manipulate image styles.

Code

function iek_image_padding_form($data) {
  $form['padding_top'] = array(
    '#type' => 'textfield',
    '#title' => t('Padding top'),
    '#default_value' => isset($data['padding_top']) ? $data['padding_top'] : '10',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'zero',
      'positive',
    ),
  );
  $form['padding_right'] = array(
    '#type' => 'textfield',
    '#title' => t('Padding right'),
    '#default_value' => isset($data['padding_right']) ? $data['padding_right'] : '10',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'zero',
      'positive',
    ),
  );
  $form['padding_bottom'] = array(
    '#type' => 'textfield',
    '#title' => t('Padding bottom'),
    '#default_value' => isset($data['padding_bottom']) ? $data['padding_bottom'] : '10',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'zero',
      'positive',
    ),
  );
  $form['padding_left'] = array(
    '#type' => 'textfield',
    '#title' => t('Padding left'),
    '#default_value' => isset($data['padding_left']) ? $data['padding_left'] : '10',
    '#field_suffix' => ' ' . t('pixels'),
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'zero',
      'positive',
    ),
  );
  $form['bg_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Background color'),
    '#default_value' => isset($data['bg_color']) ? $data['bg_color'] : '#ffffff',
    '#required' => TRUE,
    '#size' => 10,
    '#maxlength' => 7,
    '#element_validate' => array(
      'iek_image_effect_color_validate',
    ),
    '#allow_natural_number' => array(
      'zero',
      'positive',
    ),
  );
  return $form;
}