You are here

function taxonomy_feeds_form_callback in Feeds 7.2

Same name and namespace in other branches
  1. 8.2 mappers/taxonomy.inc \taxonomy_feeds_form_callback()

Settings form callback.

1 string reference to 'taxonomy_feeds_form_callback'
taxonomy_feeds_processor_targets in mappers/taxonomy.inc
Implements hook_feeds_processor_targets().

File

mappers/taxonomy.inc, line 293
On behalf implementation of Feeds mapping API for taxonomy.module.

Code

function taxonomy_feeds_form_callback(array $mapping, $target, array $form, array $form_state) {
  return array(
    'term_search' => array(
      '#type' => 'select',
      '#title' => t('Search taxonomy terms by'),
      '#options' => _taxonomy_feeds_form_callback_options(),
      '#default_value' => !empty($mapping['term_search']) ? $mapping['term_search'] : FEEDS_TAXONOMY_SEARCH_TERM_NAME,
    ),
    'autocreate' => array(
      '#type' => 'checkbox',
      '#title' => t('Auto create'),
      '#description' => t("Create the term if it doesn't exist."),
      '#default_value' => !empty($mapping['autocreate']) ? $mapping['autocreate'] : 0,
      '#states' => array(
        'visible' => array(
          ':input[name$="[settings][term_search]"]' => array(
            'value' => FEEDS_TAXONOMY_SEARCH_TERM_NAME,
          ),
        ),
      ),
    ),
  );
}