You are here

function feeds_tests_mapper_form in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 tests/feeds_tests.module \feeds_tests_mapper_form()

Provides the form with mapper settings.

1 string reference to 'feeds_tests_mapper_form'
feeds_tests_feeds_processor_targets in tests/feeds_tests.module
Implements hook_feeds_processor_targets().

File

tests/feeds_tests.module, line 492
Helper module for Feeds tests.

Code

function feeds_tests_mapper_form(array $mapping, $target, array $form, array $form_state) {
  $mapping += array(
    'checkbox' => FALSE,
    'textfield' => '',
    'textarea' => '',
    'radios' => NULL,
    'select' => NULL,
  );
  return array(
    'checkbox' => array(
      '#type' => 'checkbox',
      '#title' => t('A checkbox'),
      '#default_value' => !empty($mapping['checkbox']),
    ),
    'textfield' => array(
      '#type' => 'textfield',
      '#title' => t('A text field'),
      '#default_value' => $mapping['textfield'],
      '#required' => TRUE,
    ),
    'textarea' => array(
      '#type' => 'textarea',
      '#title' => t('A textarea'),
      '#default_value' => $mapping['textarea'],
    ),
    'radios' => array(
      '#type' => 'radios',
      '#title' => t('Some radios'),
      '#options' => array(
        'option1' => t('Option 1'),
        'option2' => t('Another Option'),
      ),
      '#default_value' => $mapping['radios'],
    ),
    'select' => array(
      '#type' => 'select',
      '#title' => t('A select list'),
      '#options' => array(
        'option3' => t('Option for select'),
        'option4' => t('Another One'),
      ),
      '#default_value' => $mapping['select'],
    ),
  );
}