You are here

function feeds_tamper_str_pad_form in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 plugins/str_pad.inc \feeds_tamper_str_pad_form()
1 string reference to 'feeds_tamper_str_pad_form'
str_pad.inc in plugins/str_pad.inc

File

plugins/str_pad.inc, line 17

Code

function feeds_tamper_str_pad_form($importer, $element_key, $settings) {
  $form = array();
  $form['pad_length'] = array(
    '#type' => 'textfield',
    '#title' => t('Pad length'),
    '#default_value' => isset($settings['pad_length']) ? $settings['pad_length'] : 10,
    '#description' => t('If the input value has a length less than this, it will use the string below to increase the length.'),
  );
  $form['pad_string'] = array(
    '#type' => 'textfield',
    '#title' => t('Pad string'),
    '#default_value' => isset($settings['pad_string']) ? $settings['pad_string'] : '',
    '#description' => t('The string to use for padding. If blank, a space will be used.'),
  );
  $form['pad_type'] = array(
    '#type' => 'radios',
    '#title' => t('Pad type'),
    '#options' => array(
      STR_PAD_RIGHT => t('Right'),
      STR_PAD_LEFT => t('Left'),
      STR_PAD_BOTH => t('Both'),
    ),
    '#default_value' => isset($settings['pad_type']) ? $settings['pad_type'] : STR_PAD_RIGHT,
  );
  return $form;
}