| 1 dashboard.install | dashboard_disable() |
Implements hook_disable().
File
- core/
modules/ dashboard/ dashboard.install, line 36 - Install, update and uninstall functions for the Dashboard module.
Code
function dashboard_disable() {
// Disable the Dashboard menu item (if it exists and is enabled).
$mlid = db_query("SELECT mlid FROM {menu_links} WHERE router_path = 'admin/dashboard' AND module = 'system' AND hidden = 0")->fetchField();
if ($mlid) {
$link = menu_link_load($mlid);
$link['hidden'] = 1;
// This is required, otherwise hiding the menu item won't work.
$link['customized'] = 1;
menu_link_save($link);
menu_cache_clear($link['menu_name']);
}
// Disable the Dashboard layout.
config_set('layout.layout.dashboard', 'disabled', TRUE);
layout_reset_caches();
}