function menu_item_container_disable in Menu item container 6
Same name and namespace in other branches
- 7 menu_item_container.install \menu_item_container_disable()
Implements hook_disable().
File
- ./
menu_item_container.install, line 25 - Provides enable/disable functions for menu item containers.
Code
function menu_item_container_disable() {
$result = db_query('SELECT mlid, link_path, options FROM {menu_links} WHERE module = "menu_item_container"');
while ($row = db_fetch_array($result)) {
// Save the container ID.
$options = unserialize($row['options']);
$options['menu_item_container_id'] = str_replace('menu-item-container/', '', $row['link_path']);
// Update the module, link_path, router_path, and external attributes.
db_query('UPDATE {menu_links} SET module = "menu", link_path = "<front>", router_path = "", external = 1, options = "%s" WHERE mlid = %d', serialize($options), $row['mlid']);
}
}