You are here

function iek_image_overlay_form in Image effect kit 7

Effect configuration form for iek_image_overlay.

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

File

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

Code

function iek_image_overlay_form($data, &$form_state = NULL) {
  $iek_overlays = iek_get_overlays();
  foreach ($iek_overlays as $item1) {
    foreach ($item1['children'] as $item2) {
      $overlay_names[$item1['name']][$item2['name']] = $item2['title'];
    }
  }
  $form['overlay_name'] = array(
    '#type' => 'select',
    '#options' => $overlay_names,
    '#title' => t('Overlay name'),
    '#default_value' => isset($data['overlay_name']) ? $data['overlay_name'] : '',
    '#required' => TRUE,
  );
  $form['overlay_offset'] = array(
    '#type' => 'textfield',
    '#title' => t('Overlay offset'),
    '#default_value' => isset($data['overlay_offset']) ? $data['overlay_offset'] : '0',
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'negative',
      'zero',
      'positive',
    ),
  );
  $form['bg_offset'] = array(
    '#type' => 'textfield',
    '#title' => t('Background offset'),
    '#default_value' => isset($data['bg_offset']) ? $data['bg_offset'] : '0',
    '#required' => TRUE,
    '#size' => 5,
    '#element_validate' => array(
      'iek_effect_natural_number_validate',
    ),
    '#allow_natural_number' => array(
      'negative',
      'zero',
      'positive',
    ),
  );
  return $form;
}