function better_watchdog_ui_disable in Better Watchdog UI 7
Same name and namespace in other branches
- 8 better_watchdog_ui.install \better_watchdog_ui_disable()
- 7.3 better_watchdog_ui.install \better_watchdog_ui_disable()
- 7.2 better_watchdog_ui.install \better_watchdog_ui_disable()
Implements hook_disable().
File
- ./
better_watchdog_ui.install, line 41 - Installation and update functions.
Code
function better_watchdog_ui_disable() {
// Reset the weight to be smaller than the dblog module.
$weight = db_select('system', 's')
->fields('s', array(
'weight',
))
->condition('s.name', 'better_watchdog_ui', '=')
->condition('type', 'module')
->execute()
->fetchField();
db_update('system')
->fields(array(
'weight' => $weight - 1,
))
->condition('name', 'better_watchdog_ui')
->condition('type', 'module')
->execute();
// Disable watchdog view.
module_load_include('inc', 'better_watchdog_ui', 'better_watchdog_ui/better_watchdog_ui.views_default');
$views_status = variable_get('views_defaults', array());
if (array_key_exists('better_watchdog_ui_view', $views_status)) {
// TRUE means disable.
$views_status['better_watchdog_ui_view'] = FALSE;
variable_set('views_defaults', $views_status);
views_invalidate_cache();
}
}