You are here

function taxonomy_defaults_install in Taxonomy Defaults 6

Same name and namespace in other branches
  1. 5 taxonomy_defaults.install \taxonomy_defaults_install()
  2. 6.2 taxonomy_defaults.install \taxonomy_defaults_install()
  3. 7 taxonomy_defaults.install \taxonomy_defaults_install()

Hook sets taxonomy_defaults 'weight' to 1. This ensures that its hook_form_alter runs after taxonomy

File

./taxonomy_defaults.install, line 13
Install, update and uninstall functions for the taxonomy_defaults module.

Code

function taxonomy_defaults_install() {
  $ret = array();
  $weight = 0;
  $query = "SELECT weight FROM {system} WHERE type = 'module' AND status = 1 and name = 'taxonomy'";
  $result = db_query($query);
  if ($row = db_fetch_object($result)) {
    $weight = $row->weight;
  }
  $weight = $weight + 1;
  $ret[] = db_query("UPDATE {system} SET weight = " . $weight . " WHERE name = 'taxonomy_defaults'");
  return $ret;
}