forked from ding2/ding_library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathding_library.install
62 lines (56 loc) · 1.71 KB
/
ding_library.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
// Install and update hooks for ding_library.
function ding_library_install() {
// Disable default OG member rules
db_update('rules_config')
->fields(array('active' => 0))
->condition(db_or()
->condition('name', 'rules_og_member_active')
->condition('name', 'rules_og_member_pending')
->condition('name', 'rules_og_group_content_notification'))
->execute();
}
/**
* Update blocks.
*/
function ding_library_update_7001() {
$default_theme = variable_get('theme_default', 'bartik');
// Delete menu_block menu, not needed anymore.
db_delete('block')
->condition('module', 'menu_block')
->condition('delta','ding_content-main-lvl1')
->condition('theme',$default_theme)
->execute();
// Delete any left over library_menus.
db_delete('block')
->condition('module', 'ding_library')
->condition('delta', 'library_menu')
->condition('theme', $default_theme)
->execute();
// Add the new ding_menu.
db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache', 'title'))->values(array(
'module' => 'ding_library',
'delta' => 'ding_menu',
'theme' => $default_theme,
'status' => 1,
'weight' => 1,
'region' => 'header',
'pages' => '',
'cache' => -1,
'title' => '<none>',
)
)->execute();
return t('Updated menu block.');
}
/**
* Disable default OG member rules.
*/
function ding_library_update_7002() {
db_update('rules_config')
->fields(array('active' => 0))
->condition(db_or()
->condition('name', 'rules_og_member_active')
->condition('name', 'rules_og_member_pending')
->condition('name', 'rules_og_group_content_notification'))
->execute();
}