Fix the description of the settings menu item.
[project/devel.git] / devel.install
CommitLineData
48a80c07
GH
1<?php
2// $Id$
83013f8f 3
5b73e5e4 4/**
48a80c07
GH
5 * Implementation of hook_install()
6 */
7function devel_install() {
9d450e49 8 // New module weights in core: put devel as the very last in the chain.
e5c39c18 9 db_update('system')
10 ->fields(array(
11 'weight' => 88,
12 ))
13 ->condition('name', 'devel')
14 ->execute();
83013f8f 15
fe9fe9e8 16 // Create our menu. See menu.install for an example.
e5c39c18 17 db_insert('menu_custom')
18 ->fields(array(
19 'menu_name' => 'devel',
20 'title' => 'Development',
21 'description' => 'Development links',
22 ))
23 ->execute();
d422058c 24}
47fd09f8 25
d422058c 26 /**
50d31be7 27 * Implementation of hook_uninstall().
d422058c 28 */
29function devel_uninstall() {
d422058c 30 variable_del('dev_query');
d422058c 31 variable_del('devel_form_weights');
d422058c 32 variable_del('devel_execution');
33 variable_del('dev_timer');
34 variable_del('devel_query_display');
35 variable_del('devel_redirect_page');
36 variable_del('devel_api_url');
37 variable_del('dev_mem');
38 variable_del('devel_error_handler');
83013f8f 39
1705c3ee
DR
40 // TODO: Not necessary if core cleans up after self or had proper menu APIs.
41 db_delete('menu_links')
42 ->condition('menu_name', 'devel')
43 ->execute();
44 db_delete('menu_custom')
45 ->condition('menu_name', 'devel')
46 ->execute();
47 if (module_exists('block')) {
48 db_delete('block')
49 ->condition('module', 'menu')
50 ->condition('delta', 'devel')
51 ->execute();
52 db_delete('block_role')
53 ->condition('module', 'menu')
54 ->condition('delta', 'devel')
55 ->execute();
56 }
48a80c07
GH
57}
58
ca029ab6 59/**
60 * Implementation of hook_disable().
61 */
62function devel_disable() {
63 // Query logging should probably not be set if devel.module is disabled.
64 if (variable_get('dev_query', 0)) {
7a2bcf56 65 variable_set('dev_query', 0);
ca029ab6 66 drupal_set_message(t('Disabled query logging since devel module is disabled.'));
67 }
68}
69
5b73e5e4 70// Remove feature for storing queries. Cleanup deprecated tables and variables.
71function devel_update_7000() {
de383e66 72 db_drop_table('devel_queries');
73 db_drop_table('devel_times');
74 return t('Removed support for logging queries to database.');
5de9665a 75}
1705c3ee
DR
76
77/**
78 * Rebuild the menus since everything is defined by devel_menu().
79 */
80function devel_update_7001() {
de383e66 81 db_delete('menu_links')
82 ->condition('module', 'devel');
1705c3ee 83 variable_set('menu_rebuild_needed', TRUE);
de383e66 84 return t('Devel module menu links will be rebuilt.');
1705c3ee 85}