special_menu_items.install in Special menu items 7.2
Same filename and directory in other branches
Install, update and uninstall functions for the Special menu items module.
File
special_menu_items.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Special menu items module.
*/
/**
* Implements hook_uninstall().
*/
function special_menu_items_uninstall() {
variable_del('special_menu_items_nolink_tag');
variable_del('special_menu_items_seperator_tag');
variable_del('special_menu_items_seperator_value');
variable_del('special_menu_items_menu_item_link');
}
/**
* Implements hook_update_N().
*
* "nolink" to <nolink> and "separator" to <separator>.
*/
function special_menu_items_update_7000(&$sandbox) {
// Change "nolink" to <nolink>.
db_update('menu_links')
->fields(array(
'link_path' => '<nolink>',
'router_path' => '<nolink>',
))
->condition('router_path', 'nolink', '=')
->execute();
// Change "separator" to <separator>.
db_update('menu_links')
->fields(array(
'link_path' => '<separator>',
'router_path' => '<separator>',
))
->condition('router_path', 'separator', '=')
->execute();
// We don't need this variable anymore.
variable_del('special_menu_items_menu_item_link');
}
Functions
Name | Description |
---|---|
special_menu_items_uninstall | Implements hook_uninstall(). |
special_menu_items_update_7000 | Implements hook_update_N(). |