You are here

function spaces_taxonomy_enable in Spaces 7

Same name and namespace in other branches
  1. 6.3 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_enable()
  2. 7.3 spaces_taxonomy/spaces_taxonomy.module \spaces_taxonomy_enable()

Implements hook_enable().

File

spaces_taxonomy/spaces_taxonomy.module, line 9
spaces_taxonomy.module

Code

function spaces_taxonomy_enable() {

  // Weight spaces_taxonomy to be after taxonomy.
  $weight = db_query("SELECT weight FROM {system} WHERE type = :type AND name = :name", array(
    ':type' => 'module',
    ':name' => 'taxonomy',
  ))
    ->fetchField();
  db_update('system')
    ->fields(array(
    'weight' => $weight + 1,
  ))
    ->condition('name', 'spaces_taxonomy')
    ->execute();
}