You are here

termcase.install in Termcase 6

Same filename and directory in other branches
  1. 7 termcase.install

Install and uninstall functions for the Termcase module.

File

termcase.install
View source
<?php

/**
 * @file
 * Install and uninstall functions for the Termcase module.
 */

/**
 * Implementation of hook_install()
 */
function termcase_install() {
  drupal_set_message(t('You can now define Termcase settings per vocabulary on the <a href="@vocabularies">taxonomy settings</a> page.', array(
    '@vocabularies' => url('admin/content/taxonomy'),
  )));
}

/**
 * Implementation of hook_uninstall()
 */
function termcase_uninstall() {
  $vocabularies = taxonomy_get_vocabularies();
  foreach ($vocabularies as $vid => $vocabulary) {
    variable_del('taxonomy_vocabulary' . $vid . '_termcase');
    variable_del('taxonomy_vocabulary' . $vid . '_termcase_synonyms');
  }
}

/**
 * Changed from using an extra column in the vocabulary table to drupal_set_variable()
 * So we can now safely remove the extra field in the database
 */
function hook_update_6100() {
  $ret = array();
  db_drop_field($ret, 'vocabulary', 'termcase');
  return $ret;
}

Functions

Namesort descending Description
hook_update_6100 Changed from using an extra column in the vocabulary table to drupal_set_variable() So we can now safely remove the extra field in the database
termcase_install Implementation of hook_install()
termcase_uninstall Implementation of hook_uninstall()