hs_taxonomy.install in Hierarchical Select 6.3
Same filename and directory in other branches
Install file for the Hierarchical Select Taxonomy module.
File
modules/hs_taxonomy.installView source
<?php
/**
* @file
* Install file for the Hierarchical Select Taxonomy module.
*/
/**
* Implementation of hook_install().
*/
function hs_taxonomy_install() {
$ret = array();
// Update the module weight to -1 so it runs before other taxonomy related
// modules. See http://drupal.org/node/601500.
$ret[] = update_sql("UPDATE {system} SET weight = -1 WHERE name = 'hs_taxonomy'");
return $ret;
}
/**
* Implementation of hook_uninstall().
*/
function hs_taxonomy_uninstall() {
// Remove any saved variables.
db_query("DELETE FROM {variable} WHERE name = 'taxonomy_override_selector'");
db_query("DELETE FROM {variable} WHERE name LIKE 'taxonomy_hierarchical_select_%'");
}
/**
* Implementation of hook_enable().
*/
function hs_taxonomy_enable() {
variable_set('taxonomy_override_selector', TRUE);
drupal_set_message(t("Drupal core's taxonomy selects are now overridden on the\n Taxonomy Term form. They've been replaced by\n Hierarchical Selects for better scalability.<br />\n You can <a href=\"!configure-url\">configure</a> it to\n be used on node forms too!", array(
'!configure-url' => url('admin/settings/hierarchical_select/configs'),
)), 'warning');
}
/**
* Implementation of hook_disable().
*/
function hs_taxonomy_disable() {
variable_set('taxonomy_override_selector', FALSE);
drupal_set_message(t("Drupal core's taxonomy selects are now restored.\n Please remember that they're not scalable!."), 'warning');
}
//----------------------------------------------------------------------------
// Schema updates.
// Update the module weight to 2 so hs_taxonomy runs after the forum module.
// See http://drupal.org/node/475784.
function hs_taxonomy_update_1() {
$ret = array();
$ret[] = update_sql("UPDATE {system} SET weight = 2 WHERE name = 'hs_taxonomy'");
return $ret;
}
// Update the module weight to -1 so it runs before other taxonomy related
// modules. See http://drupal.org/node/601500.
function hs_taxonomy_update_6002() {
$ret = array();
$ret[] = update_sql("UPDATE {system} SET weight = -1 WHERE name = 'hs_taxonomy'");
return $ret;
}
Functions
Name | Description |
---|---|
hs_taxonomy_disable | Implementation of hook_disable(). |
hs_taxonomy_enable | Implementation of hook_enable(). |
hs_taxonomy_install | Implementation of hook_install(). |
hs_taxonomy_uninstall | Implementation of hook_uninstall(). |
hs_taxonomy_update_1 | |
hs_taxonomy_update_6002 |