You are here

function labjs_enable in LABjs 6

Implementation of hook_enable().

1 call to labjs_enable()
labjs_update_6100 in ./labjs.install
Increase the module weight, for current enabled users

File

./labjs.install, line 30
LABjs install file

Code

function labjs_enable() {

  // This module should run after all, to alter the content.
  $max_weight = db_result(db_query("SELECT MAX(weight) FROM {system} WHERE name <> 'labjs'"));
  $current_weight = db_result(db_query("SELECT weight FROM {system} WHERE name='labjs'"));
  if ($current_weight <= $max_weight) {
    db_query("UPDATE {system} SET weight=%d WHERE name='labjs'", $max_weight + 1);
    drupal_set_message(t('LABjs module weight has been adjusted.'));
  }
}