You are here

function auto_menutitle_install in Auto Menu Title 7

Same name and namespace in other branches
  1. 8 auto_menutitle.install \auto_menutitle_install()
  2. 6.2 auto_menutitle.install \auto_menutitle_install()

Implements hook_install().

File

./auto_menutitle.install, line 10
Install, update and uninstall functions for the auto_menutitle module.

Code

function auto_menutitle_install() {

  // Set this module's weight to one higher than that of the menu module
  $weight = db_query('SELECT weight FROM {system} WHERE type = :type AND name = :name', array(
    ':type' => 'module',
    ':name' => 'menu',
  ))
    ->fetchField();
  $weight += 1;
  db_update('system')
    ->fields(array(
    'weight' => $weight,
  ))
    ->condition('type', 'module')
    ->condition('name', 'auto_menutitle')
    ->execute();
}