-
Notifications
You must be signed in to change notification settings - Fork 0
/
devengine.install
executable file
·188 lines (169 loc) · 4.84 KB
/
devengine.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
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
<?php
/**
* @file
* Install, update and uninstall functions for the installation profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*
* @see system_install()
*/
function devengine_install() {
$t = get_t();
// Add text formats.
$filtered_html_format = array(
'format' => 'filtered_html',
'name' => 'Filtered HTML',
'weight' => 0,
'filters' => array(
// URL filter.
'filter_url' => array(
'weight' => 0,
'status' => 1,
),
// HTML filter.
'filter_html' => array(
'weight' => 1,
'status' => 1,
),
// Line break filter.
'filter_autop' => array(
'weight' => 2,
'status' => 1,
),
// HTML corrector filter.
'filter_htmlcorrector' => array(
'weight' => 3,
'status' => 1,
),
'media_filter' => array(
'weight' => 4,
'status' => 1,
),
'pathologic' => array(
'weight' => 5,
'status' => 1,
),
),
);
$filtered_html_format = (object) $filtered_html_format;
filter_format_save($filtered_html_format);
$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' => 2,
'status' => 1,
),
'media_filter' => array(
'weight' => 3,
'status' => 1,
),
'pathologic' => array(
'weight' => 4,
'status' => 1,
),
),
);
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);
// Added page content type.
$types = array(
array(
'type' => 'page',
'name' => $t('Basic page'),
'base' => 'node_content',
'description' => $t("Use <em>basic pages</em> for your static content, such as an 'About us' page."),
'custom' => 1,
'modified' => 1,
'locked' => 0,
),
);
foreach ($types as $type) {
$type = node_type_set_defaults($type);
node_type_save($type);
node_add_body_field($type);
}
// Default "Basic page" to not be promoted and have comments disabled.
variable_set('node_options_page', array('status'));
variable_set('comment_page', COMMENT_NODE_HIDDEN);
// Don't display date and author information for "Basic page" nodes.
variable_set('node_submitted_page', FALSE);
// Enable user picture support and set the default to a square thumbnail.
variable_set('user_pictures', '1');
variable_set('user_picture_dimensions', '1024x1024');
variable_set('user_picture_file_size', '800');
variable_set('user_picture_style', 'thumbnail');
// Allow visitor account creation only for administrators.
variable_set('user_register', USER_REGISTER_ADMINISTRATORS_ONLY);
// Enable default permissions for system roles.
$filtered_html_permission = filter_permission_name($filtered_html_format);
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(
'access content',
'access comments',
$filtered_html_permission,
));
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array(
'access content',
'access comments',
'post comments',
'skip comment approval',
$filtered_html_permission,
));
// Create a default role for site administrators, with all available
// permissions assigned.
$admin_role = new stdClass();
$admin_role->name = 'administrator';
$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);
// Settings for admin theme.
variable_set('node_admin_theme', 1);
variable_set('admin_theme', 'seven');
// Set default theme.
theme_enable(array('thedevengine'));
variable_set('theme_default', 'thedevengine');
// Assign user 1 the "administrator" role.
db_insert('users_roles')
->fields(array('uid' => 1, 'rid' => $admin_role->rid))
->execute();
// Insert issue type terms.
$t = get_t();
$vocabulary = taxonomy_vocabulary_machine_name_load('issue_type');
$terms = array(
$t('Feature'),
$t('Bug'),
$t('Support'),
$t('Design'),
$t('Core Configuration'),
);
foreach ($terms as $term_raw) {
$term = new stdClass();
$term->vid = $vocabulary->vid;
$term->name = $term_raw;
taxonomy_term_save($term);
}
// Rebuild node access.
node_access_rebuild(TRUE);
// On the wiki page show only book pages.
variable_set('book_block_mode', 'book pages');
// Error level by default.
variable_set('error_level', 0);
}