You are here

function spaces_customtext_enable in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 spaces_customtext/spaces_customtext.module \spaces_customtext_enable()
  2. 7 spaces_customtext/spaces_customtext.module \spaces_customtext_enable()

Implementation of hook_enable(). Weight spaces_customtext as the lowest possible module.

File

spaces_customtext/spaces_customtext.module, line 61
Spaces Custom Text.

Code

function spaces_customtext_enable() {
  $min = db_result(db_query("SELECT weight FROM {system} WHERE type = 'module' ORDER BY weight ASC LIMIT 1"));
  $weight = $min < -10000 ? $min - 1 : -10000;
  db_query("UPDATE {system} SET weight = %d WHERE name = 'spaces_customtext' AND type = 'module'", $weight);
}