1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Installation functionality for Administration menu toolbar module.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Implements hook_install().
|
10
|
*/
|
11
|
function admin_menu_toolbar_install() {
|
12
|
// Required to load JS/CSS in hook_init() after admin_menu.
|
13
|
db_update('system')
|
14
|
->fields(array('weight' => 101))
|
15
|
->condition('type', 'module')
|
16
|
->condition('name', 'admin_menu_toolbar')
|
17
|
->execute();
|
18
|
}
|
19
|
|
20
|
/**
|
21
|
* Set module weight to a value higher than admin_menu.
|
22
|
*
|
23
|
* At this point, admin_menu should have a weight of 100. To account for
|
24
|
* customized weights, we increase the weight relatively.
|
25
|
*
|
26
|
* @see admin_menu_toolbar_install()
|
27
|
*/
|
28
|
function admin_menu_toolbar_update_6300() {
|
29
|
$weight = db_query("SELECT weight FROM {system} WHERE type = 'module' AND name = 'admin_menu'")->fetchField();
|
30
|
$weight++;
|
31
|
db_update('system')
|
32
|
->fields(array('weight' => $weight))
|
33
|
->condition('type', 'module')
|
34
|
->condition('name', 'admin_menu_toolbar')
|
35
|
->execute();
|
36
|
}
|
37
|
|