You are here

function diff_set_weight in Diff 5.2

Same name and namespace in other branches
  1. 5 diff.install \diff_set_weight()

Set the {system} weight to 1 higher than node.module to make sure that diff_menu() can override the menu callback for the revisions tab.

2 calls to diff_set_weight()
diff_autoadjust in ./diff.module
Adjust the module weights for diff to load after node module.
diff_install in ./diff.install
Implementation of hook_install().

File

./diff.install, line 19

Code

function diff_set_weight() {
  $node_module_weight = db_result(db_query("SELECT weight FROM {system} WHERE name='node'"));
  $rval = db_query("UPDATE {system} SET weight=%d WHERE name='diff'", $node_module_weight + 1);
  drupal_set_message(t('Weight of %diff module set to %weight. You can now see a diff of different node revisions using the %revisions tab when viewing a node.', array(
    '%diff' => t('Diff'),
    '%weight' => $node_module_weight + 1,
    '%revisions' => t('Revisions'),
  )));
  return $rval;
}