function feeds_tests_mapper_summary in Feeds 7.2
Same name and namespace in other branches
- 8.2 tests/feeds_tests.module \feeds_tests_mapper_summary()
Provides setting summary for the mapper.
See also
my_module_summary_callback()
1 string reference to 'feeds_tests_mapper_summary'
- feeds_tests_feeds_processor_targets in tests/
feeds_tests.module - Implements hook_feeds_processor_targets().
File
- tests/
feeds_tests.module, line 444 - Helper module for Feeds tests.
Code
function feeds_tests_mapper_summary(array $mapping, $target, array $form, array $form_state) {
$options = array(
'option1' => t('Option 1'),
'option2' => t('Another Option'),
'option3' => t('Option for select'),
'option4' => t('Another One'),
);
$items = array();
if (!empty($mapping['checkbox']) && $mapping['checkbox']) {
$items[] = t('Checkbox active.');
}
else {
$items[] = t('Checkbox inactive.');
}
if (!empty($mapping['textfield'])) {
$items[] = t('<strong>Textfield value</strong>: %textfield', array(
'%textfield' => $mapping['textfield'],
));
}
if (!empty($mapping['textarea'])) {
$items[] = t('<strong>Textarea value</strong>: %textarea', array(
'%textarea' => $mapping['textarea'],
));
}
if (!empty($mapping['radios'])) {
$items[] = t('<strong>Radios value</strong>: %radios', array(
'%radios' => $options[$mapping['radios']],
));
}
if (!empty($mapping['select'])) {
$items[] = t('<strong>Select value</strong>: %select', array(
'%select' => $options[$mapping['select']],
));
}
$list = array(
'#type' => 'ul',
'#theme' => 'item_list',
'#items' => $items,
);
return drupal_render($list);
}