You are here

function wikitools_autoadjust in Wikitools 5

Adjust the module weights for wikitools to load after freelinking module.

1 call to wikitools_autoadjust()
wikitools_requirements in ./wikitools.module
Implementation of hook_requirements().

File

./wikitools.module, line 275
A non-intrusive module to have some wiki-like behaviour.

Code

function wikitools_autoadjust() {
  $modules = array_keys(module_list());
  if (array_search('wikitools', $modules) <= array_search('freelinking', $modules)) {
    $freelinking_module_weight = db_result(db_query("SELECT weight FROM {system} WHERE name='freelinking'"));
    db_query("UPDATE {system} SET weight=%d WHERE name='wikitools'", $freelinking_module_weight + 1);
    drupal_set_message(t('Weight of %wikitools module set to %weight.', array(
      '%wikitools' => t('wikitools'),
      '%weight' => $wikitools_module_weight + 1,
    )));
  }
}