taxonomy_xml.install in Taxonomy import/export via XML 7
Same filename and directory in other branches
Install, update and uninstall functions for the taxonomy_xml module.
File
taxonomy_xml.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the taxonomy_xml module.
*/
/**
* Implementation of hook_install().
*/
function taxonomy_xml_install() {
// Make uploads easy. These are safe extensions
variable_set('upload_extensions_default', variable_get('upload_extensions_default', '') . ' xml rdf csv');
drupal_set_message(t("\n Taxonomy Import and Export functions are now available as TABS\n at !taxonomy_link.\n Lots of documentation about supported import/export syntaxed\n is available in the 'help' folder of this module.\n ", array(
'!taxonomy_link' => l('admin/structure/taxonomy', 'admin/structure/taxonomy'),
)));
}
/**
* Implementation of hook_uninstall().
*/
function taxonomy_xml_uninstall() {
variable_del('taxonomy_xml_service_id');
variable_del('taxonomy_xml_format');
variable_del('taxonomy_xml_vid');
variable_del('taxonomy_xml_duplicate');
variable_del('taxonomy_xml_reuseids');
variable_del('taxonomy_xml_protocol');
variable_del('taxonomy_xml_identifier');
variable_del('taxonomy_xml_url');
variable_del('taxonomy_xml_recurse_down');
variable_del('taxonomy_xml_watchdog_level');
}
/**
* Implementation of hook_requirements().
*
* Advice on missing functionality
*
*/
function taxonomy_xml_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
// Advise that taxonomy_enhancer is useful
if (module_exists('rdf')) {
$requirements['tx_rdf'] = array(
'value' => t('RDF module is available.'),
'severity' => REQUIREMENT_OK,
'description' => t('
!rdf will assist taxonomy imports
by enabling a unique Identifier for each imported term.
', array(
'!rdf' => l('rdf.module', 'http://drupal.org/project/rdf'),
)),
);
}
else {
$requirements['tx_rdf'] = array(
'value' => t('RDF module is not available.'),
'severity' => REQUIREMENT_WARNING,
'description' => t('
!rdf is very useful to taxonomy_xml
if you are planning to import external taxonomies from web services.
<em>It is not required</em>, but will enable us to add a GUID (unique identifier)
field to your terms so that imports can be structured correctly.
Without it we cannot import vocabulary heirarchies via spidering,
although small all-in-one vocabulary imports (from a single file)
should still work.
', array(
'!rdf' => l('rdf.module', 'http://drupal.org/project/rdf'),
)),
);
}
$requirements['tx_rdf']['title'] = t('RDF (for taxonomy_xml)');
}
$requirements['taxonomy_xml'] = array(
'title' => 'Taxonomy XML is enabled',
'value' => "Taxonomy XML is intended as a run-once setup or migration module, you may be able to disable it once it's done its job",
'severity' => REQUIREMENT_INFO,
);
return $requirements;
}
Functions
Name![]() |
Description |
---|---|
taxonomy_xml_install | Implementation of hook_install(). |
taxonomy_xml_requirements | Implementation of hook_requirements(). |
taxonomy_xml_uninstall | Implementation of hook_uninstall(). |