taxonomy_csv.install in Taxonomy CSV import/export 6.5
Same filename and directory in other branches
Install, update and uninstall functions for the taxonomy_csv module.
File
taxonomy_csv.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the taxonomy_csv module.
*/
/**
* 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(filter_xss(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>.<br /> Your comments are welcomed on the <a href=\\"!link_module\\">Taxonomy CSV import/export</a> module page.', array(
'!link_import' => url('admin/content/taxonomy/csv_import'),
'!link_export' => url('admin/content/taxonomy/csv_export'),
'!link_help' => url('admin/help/taxonomy_csv'),
'!link_module' => url('http://drupal.org/project/taxonomy_csv'),
))));
}
/**
* Implements hook_uninstall().
*/
function taxonomy_csv_uninstall() {
// Remove user preferences.
foreach (array(
// Import variables.
'import_format',
'keep_order',
'source_choice',
'import_delimiter',
'import_delimiter_soft_tab_width',
'import_delimiter_custom',
'import_enclosure',
'import_enclosure_custom',
'check_line',
'check_utf8',
'locale_custom',
'vocabulary_target',
'vocabulary_id',
'delete_terms',
'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_vocabulary_id',
'export_delimiter',
'export_delimiter_custom',
'export_enclosure',
'export_enclosure_custom',
'export_line_ending',
'export_order',
'def_links_terms_ids',
'def_links_vocabularies_ids',
'result_duplicates',
// 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> module page.', array(
'!link' => url('http://drupal.org/project/taxonomy_csv'),
)));
}
/**
* Implements hook_requirements().
*/
function taxonomy_csv_requirements($phase) {
$requirements = array();
$requirements['taxonomy_csv'] = array(
'title' => 'Taxonomy CSV import/export is enabled',
'value' => 'Taxonomy CSV is designed as a run-once setup or migration module. You may disable it once your imports and exports are processed.',
'severity' => REQUIREMENT_INFO,
);
return $requirements;
}
Functions
Name![]() |
Description |
---|---|
taxonomy_csv_install | Implements hook_install(). |
taxonomy_csv_requirements | Implements hook_requirements(). |
taxonomy_csv_uninstall | Implements hook_uninstall(). |