-
Notifications
You must be signed in to change notification settings - Fork 0
/
bloggio.install
146 lines (140 loc) · 3.29 KB
/
bloggio.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**
* @file
* Install, update and uninstall functions for the bloggio install profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function bloggio_install() {
// Enable some standard blocks.
$default_theme = 'comet';
$admin_theme = 'rubik';
$blocks = array(
array(
'module' => 'system',
'delta' => 'main',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'search',
'delta' => 'form',
'theme' => $default_theme,
'status' => 1,
'weight' => -1,
'region' => 'search',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'login',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'navigation',
'theme' => $default_theme,
'status' => 1,
'weight' => 0,
'region' => 'sidebar_first',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'system',
'delta' => 'main',
'theme' => $admin_theme,
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'login',
'theme' => $admin_theme,
'status' => 1,
'weight' => 10,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'user',
'delta' => 'new',
'theme' => $admin_theme,
'status' => 1,
'weight' => 0,
'region' => 'dashboard_sidebar',
'pages' => '',
'cache' => -1,
),
array(
'module' => 'search',
'delta' => 'form',
'theme' => $admin_theme,
'status' => 1,
'weight' => -10,
'region' => 'dashboard_sidebar',
'pages' => '',
'cache' => -1,
),
);
$query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
foreach ($blocks as $block) {
$query->values($block);
}
$query->execute();
// Create a Home link in the main menu.
$item = array(
'link_title' => st('Home'),
'link_path' => '<front>',
'menu_name' => 'main-menu',
);
menu_link_save($item);
// Update the menu router information.
menu_rebuild();
// Enable the admin theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'rubik')
->execute();
variable_set('admin_theme', 'rubik');
// Enable alpha theme
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'alpha')
->execute();
// Enable omega theme
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'omega')
->execute();
// Enable oho8.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'comet')
->execute();
variable_set('theme_default', 'comet');
variable_set('node_admin_theme', '1');
}