You are here

taxonomy_csv.install in Taxonomy CSV import/export 6.4

Taxonomy_csv install and uninstall hook.

File

taxonomy_csv.install
View source
<?php

/**
 * @file
 * Taxonomy_csv install and uninstall hook.
 */

/**
 * Implements hook_install().
 */
function taxonomy_csv_install() {

  // Make uploads easy for csv files.
  variable_set('upload_extensions_default', variable_get('upload_extensions_default', '') . ' csv');
  drupal_set_message(st('Taxonomy CSV import/export has been installed. You can now import and export taxonomies, structures or lists of terms under <a href="!link_import">Administer > Content management > Taxonomy > CSV import</a> and <a href="!link_export">CSV export</a>. More information is available under <a href="!link_help">Administer > Help > Taxonomy CSV import/export</a>.', array(
    '!link_import' => url('admin/content/taxonomy/csv_import'),
    '!link_export' => url('admin/content/taxonomy/csv_export'),
    '!link_help' => url('admin/help/taxonomy_csv'),
  )));
}

/**
 * Implements hook_uninstall().
 */
function taxonomy_csv_uninstall() {

  // Remove user preferences.
  foreach (array(
    // Import variables.
    'import_format',
    'source_choice',
    'import_delimiter',
    'import_delimiter_custom',
    'import_enclosure',
    'import_enclosure_custom',
    'check_line',
    'check_utf8',
    'locale_custom',
    'vocabulary_target',
    'vocabulary_id',
    'check_hierarchy',
    'set_hierarchy',
    'existing_items',
    'relations_create_subrelations',
    'relations_all_vocabularies',
    'result_stats',
    'result_terms',
    'result_level',
    'result_type',
    // Export variables.
    'export_format',
    'export_delimiter',
    'export_delimiter_custom',
    'export_enclosure',
    'export_enclosure_custom',
    'export_line_ending',
    'export_order',
    'result_duplicates',
    'def_links_terms_ids',
    'def_links_vocabularies_ids',
    // Remove variables from previous releases.
    // < 6.x.4.0.
    'import_create_subrelations',
    'import_all_vocabularies',
    'source_delimiter_custom_field',
    // < 6.x.4.1.
    // < 7.x.4.1.
    'source_disable_convert_to_utf8',
    // < 6.x.4.2.
    // < 7.x.4.2.
    'source_convert_to_utf8',
    'autodivide_import',
    'autodivide_lines',
    'result_display_level',
    'result_display_type',
    // < 6.x.4.7.
    // < 7.x.4.7.
    'source_content',
    'source_delimiter',
    'source_delimiter_custom',
    'source_enclosure',
    'source_enclosure_custom',
    'destination_target',
    'destination_vocabulary_id',
    'import_existing_items',
    // < 6.x.5.0.
    // < 7.x.5.0.
    'disable_internal_cache',
    'disable_hierarchy_check',
    'disable_line_checks',
    'disable_utf8_check',
    'fields_links_terms_ids',
    'fields_links_vocabularies_ids',
  ) as $option) {
    variable_del("taxonomy_csv_{$option}");
  }
  drupal_set_message(st('Taxonomy csv import/export: All user preferences have been removed. Thanks for using this module!<br />
    Your comments are welcomed on <a href="!link">Taxonomy csv import/export</a>.', array(
    '!link' => url('http://drupal.org/project/taxonomy_csv'),
  )));
}

Functions