You are here

function _taxonomy_csv_values in Taxonomy CSV import/export 7.5

Same name and namespace in other branches
  1. 6.5 taxonomy_csv.api.inc \_taxonomy_csv_values()
  2. 6.2 taxonomy_csv.api.inc \_taxonomy_csv_values()
  3. 6.3 taxonomy_csv.api.inc \_taxonomy_csv_values()
  4. 6.4 taxonomy_csv.api.inc \_taxonomy_csv_values()
  5. 7.4 taxonomy_csv.api.inc \_taxonomy_csv_values()

Helper to remember some items and to describe features.

Parameters

$list: A string matching list to be returned:

  • 'import_format' : available formats for import.
  • 'export_format' : available formats for export.
  • 'import_default_ui' : default options to import by user interface.
  • 'import_default_api': default options to import by api.
  • 'export_default_ui' : default options to export by user interface.
  • 'export_default_api': default options to export by api.

Return value

Array of wanted content.

9 calls to _taxonomy_csv_values()
drush_taxonomy_csv_export in ./taxonomy_csv.drush.inc
Process the export of a vocabulary.
drush_taxonomy_csv_import in ./taxonomy_csv.drush.inc
Process the import of an input.
taxonomy_csv_export in export/taxonomy_csv.export.api.inc
Process the export of a vocabulary.
taxonomy_csv_export_form in export/taxonomy_csv.export.admin.inc
Generates the taxonomy CSV export form.
taxonomy_csv_export_form_default_values_submit in export/taxonomy_csv.export.admin.inc
Restore recommended default values in the export form.

... See full list

File

./taxonomy_csv.api.inc, line 75
Manage variables and features of module.

Code

function _taxonomy_csv_values($list) {
  switch ($list) {
    case 'import_format':
      return array(
        TAXONOMY_CSV_FORMAT_STRUCTURE => t('Structure'),
        TAXONOMY_CSV_FORMAT_FIELDS => t('Fields'),
        TAXONOMY_CSV_FORMAT_TRANSLATE => t('Translation'),
        TAXONOMY_CSV_FORMAT_TID => t('Term ids (tid)'),
      );
    case 'export_format':
      return array(
        TAXONOMY_CSV_FORMAT_FLAT => t('Term names'),
        TAXONOMY_CSV_FORMAT_FLAT_TID => t('Term ids'),
        TAXONOMY_CSV_FORMAT_TID_FLAT => t('Term ids and names'),
        TAXONOMY_CSV_FORMAT_TREE => t('Hierarchical tree structure'),
        TAXONOMY_CSV_FORMAT_TID_TREE => t('Hierarchical tree structure with term ids and names'),
        TAXONOMY_CSV_FORMAT_FIELDS => t('Fields'),
        TAXONOMY_CSV_FORMAT_TREE_FIELDS => t('Hierarchical tree structure and Fields'),
        TAXONOMY_CSV_FORMAT_TRANSLATE => t('Translations'),
      );
    case 'import_default_ui':
      return array(
        'import_format' => TAXONOMY_CSV_FORMAT_STRUCTURE,
        'structure_type' => TAXONOMY_CSV_FORMAT_FLAT,
        'tid_structure_type' => TAXONOMY_CSV_FORMAT_TID_FLAT,
        'import_fields_format' => 'name',
        'translate_by' => 'name',
        'translate_languages' => '',
        'keep_order' => FALSE,
        'source_choice' => 'text',
        'import_delimiter' => 'comma',
        'import_delimiter_soft_tab_width' => '2',
        'import_delimiter_custom' => '',
        'import_enclosure' => 'none',
        'import_enclosure_custom' => '',
        'filter_format' => 'plain_text',
        'filter_format_custom' => 'none',
        'import_language' => 'und',
        // Undefined.
        'check_line' => TRUE,
        'check_utf8' => TRUE,
        'locale_custom' => '',
        'vocabulary_target' => 'autocreate',
        'vocabulary_id' => 'choose_vocabulary',
        'i18n_mode' => 0,
        // I18N_MODE_NONE.
        'language' => 'und',
        // Undefined.
        'import_fields_custom' => '',
        'delete_terms' => FALSE,
        'check_hierarchy' => TRUE,
        'set_hierarchy' => 2,
        // Polyhierarchy.
        'update_or_ignore' => TAXONOMY_CSV_EXISTING_UPDATE,
        // General options.
        'result_stats' => 'result_stats',
        'result_terms' => 'result_terms',
        'result_level' => 'notices',
        'result_type' => 'by_message',
      );
    case 'import_default_api':
      return array(
        'import_format' => TAXONOMY_CSV_FORMAT_FLAT,
        'fields_format' => array(
          0 => 'name',
        ),
        'translate_by' => 'name',
        'translate_languages' => '',
        'keep_order' => FALSE,
        'delimiter' => ',',
        'enclosure' => '',
        'filter_format' => 'plain_text',
        'filter_format_custom' => 'none',
        // Warning: in API, language is option for terms.
        'language' => 'und',
        // Undefined.
        'check_line' => FALSE,
        'check_utf8' => FALSE,
        'locale_custom' => '',
        'vocabulary_target' => 'autocreate',
        'vocabulary_id' => 'choose_vocabulary',
        'i18n_mode' => 0,
        // I18N_MODE_NONE.
        'vocabulary_language' => 'und',
        // Undefined.
        'fields_custom' => array(),
        'delete_terms' => FALSE,
        'check_hierarchy' => TRUE,
        'set_hierarchy' => 2,
        // Polyhierarchy.
        'update_or_ignore' => TAXONOMY_CSV_EXISTING_UPDATE,
        // General options.
        'check_options' => FALSE,
        'result_display' => FALSE,
        'result_stats' => FALSE,
        'result_terms' => FALSE,
        'result_level' => 'first',
        'result_type' => 'by_message',
      );
    case 'export_default_ui':
      return array(
        'export_format' => TAXONOMY_CSV_FORMAT_FLAT,
        'export_fields_format' => 'name',
        'export_vocabulary_id' => 0,
        'export_delimiter' => 'comma',
        'export_delimiter_custom' => '',
        'export_enclosure' => 'quotation',
        'export_enclosure_custom' => '',
        'export_line_ending' => 'Unix',
        // Default options of specific imports.
        'def_links_terms_ids' => 'name_if_needed',
        'def_links_vocabularies_ids' => 'none',
        // General options.
        'export_order' => 'name',
        'result_duplicates' => TRUE,
      );
    case 'export_default_api':
      return array(
        'export_format' => TAXONOMY_CSV_FORMAT_FLAT,
        'fields_format' => array(
          0 => 'name',
        ),
        'vocabulary_id' => 0,
        'delimiter' => ',',
        'enclosure' => '"',
        'line_ending' => 'Unix',
        'order' => 'name',
        // Default options of specific imports.
        'def_links_terms_ids' => 'name_if_needed',
        'def_links_vocabularies_ids' => 'none',
        // General options.
        'result_duplicates' => FALSE,
        'check_options' => FALSE,
        'result_display' => FALSE,
      );
  }
}