auto_menutitle.install in Auto Menu Title 7
Same filename and directory in other branches
Install, update and uninstall functions for the auto_menutitle module.
File
auto_menutitle.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the auto_menutitle module.
*/
/**
* Implements hook_install().
*/
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();
}
/**
* Implements hook_uninstall().
*/
function auto_menutitle_uninstall() {
// Delete variables
$node_types = array_keys(node_type_get_types());
foreach ($node_types as $node_type) {
variable_del('auto_menutitle_' . $node_type);
}
}
Functions
Name![]() |
Description |
---|---|
auto_menutitle_install | Implements hook_install(). |
auto_menutitle_uninstall | Implements hook_uninstall(). |