forked from callinmullaney/slave1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslave1.install
More file actions
executable file
·274 lines (243 loc) · 6.91 KB
/
slave1.install
File metadata and controls
executable file
·274 lines (243 loc) · 6.91 KB
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
<?php
/**
* Implementation of hook_install().
*/
function slave1_install(&$task, $url) {
// Create a default role for site administrators, with all available permissions assigned.
$admin_role = new stdClass();
$admin_role->name = 'admin';
$admin_role->weight = 2;
user_role_save($admin_role);
user_role_grant_permissions($admin_role->rid, array_keys(module_invoke_all('permission')));
// Set this as the administrator role.
variable_set('user_admin_role', $admin_role->rid);
// Assign user 1 the "administrator" role.
db_insert('users_roles')
->fields(array('uid' => 1, 'rid' => $admin_role->rid))
->execute();
db_update('system')
->fields(array('status' => 0))
->condition('type', 'theme')
->condition('name', 'bartik')
->execute();
// Enable Fett base theme
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'fett')
->execute();
//Enable Jango wireframe theme and make default.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'jango')
->execute();
variable_set('theme_default', 'jango');
// Enable the admin theme.
variable_set('node_admin_theme', '1');
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'boushh')
->execute();
variable_set('admin_theme', 'boushh');
// Add text formats.
$full_html_format = array(
'format' => 'full_html',
'name' => 'Full HTML',
'weight' => 1,
'filters' => array(
// URL filter.
'filter_url' => array(
'weight' => 0,
'status' => 1,
),
// Line break filter.
'filter_autop' => array(
'weight' => 1,
'status' => 1,
),
// HTML corrector filter.
'filter_htmlcorrector' => array(
'weight' => 10,
'status' => 1,
),
),
);
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);
// Enable default permissions for system roles.
$filtered_html_permission = filter_permission_name($full_html_format);
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', $filtered_html_permission));
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', $filtered_html_permission));
// Allow visitor account creation with administrative approval.
variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
// Set the jQuery version to 1.8.
variable_set('jquery_update_compression_type', 'min');
variable_set('jquery_update_jquery_cdn', 'google');
variable_set('jquery_update_jquery_version', '1.10');
// 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();
// Create an image style for the users pic
// Squares Styles
$style = image_style_save(array(
'name' => 'square_thumbnail',
'label' => 'Square - Thumbnail')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 150,
'height' => 150,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'square_medium',
'label' => 'Square - Medium')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 350,
'height' => 350,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'square_large',
'label' => 'Square - Large')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 700,
'height' => 700,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
// Landscapes Styles
$style = image_style_save(array(
'name' => 'landscape_thumbnail',
'label' => 'Landscape - Thumbnail')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 250,
'height' => 150,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'landscape_medium',
'label' => 'Landscape - Medium')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 550,
'height' => 350,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'landscape_large',
'label' => 'Landscape - Large')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 1000,
'height' => 700,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
// Portrait Styles
$style = image_style_save(array(
'name' => 'portrait_thumbnail',
'label' => 'Portrait - Thumbnail')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 100,
'height' => 250,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'portrait_medium',
'label' => 'Portrait - Medium')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 250,
'height' => 550,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
$style = image_style_save(array(
'name' => 'portrait_large',
'label' => 'Portrait - Large')
);
$effect = array(
'name' => 'image_scale_and_crop',
'data' => array(
'width' => 600,
'height' => 1000,
'upscale' => FALSE,
),
'isid' => $style['isid'],
);
image_effect_save($effect);
image_style_flush($style);
// Setup a minimal WYSIWYG editor with the basic toolbar options
// Setting some default date formats.
variable_set('date_first_day', '0');
variable_set('date_format_long', 'l, F j, Y - g:ia');
variable_set('date_format_medium', 'D, Y-m-d g:ia');
variable_set('date_format_short', 'Y-m-d g:ia');
variable_set('time_twelve_hour', 'g:ia');
variable_set('time_twentyfour_hour', 'H:i');
variable_set('day_number_with_suffix', 'jS');
variable_set('day_number', 'j');
variable_set('day_word_long', 'l');
variable_set('day_word_short', 'D');
variable_set('month_short', 'M');
variable_set('month_long', 'F');
variable_set('year_short', 'y');
variable_set('year_long', 'Y');
}