-
Notifications
You must be signed in to change notification settings - Fork 0
/
motionsplan_deploy.install
91 lines (83 loc) · 2.25 KB
/
motionsplan_deploy.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
<?php
/**
* @file
*/
/**
* Implements hook_install().
*
* See http://dcycleproject.org/node/43
*/
function motionsplan_deploy_install() {
for ($i = 7000; $i < 8000; $i++) {
$candidate = 'motionsplan_deploy_update_' . $i;
if (function_exists($candidate)) {
$candidate();
}
}
}
/**
* Setting up timezones.
*/
function motionsplan_deploy_update_7000() {
variable_set('configurable_timezones', 0);
variable_set('date_first_day', 1);
variable_set('date_default_timezone', 'Europe/Copenhagen');
}
/**
* Setting upload to 5MB and skip scheme on upload.
*/
function motionsplan_deploy_update_7001() {
variable_set('file_entity_max_filesize', '5 MB');
variable_set('file_entity_file_upload_wizard_skip_scheme', 1);
}
/**
* Settings for transliteration.
*/
function motionsplan_deploy_update_7002() {
module_enable(array('transliteration'));
if (module_exists('pathauto')) {
if (module_exists('transliteration')) {
variable_set('pathauto_transliterate', 1);
}
variable_set('pathauto_reduce_ascii', 1);
}
}
/**
* Theme settings.
*/
function motionsplan_deploy_update_7003() {
$theme = 'sparta';
$admin_theme = 'seven';
// Enable standard theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', $theme)
->execute();
// Enable the admin theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', $admin_theme)
->execute();
// Disable bartik.
db_update('system')
->fields(array('status' => 0))
->condition('type', 'theme')
->condition('name', 'bartik')
->execute();
variable_set('theme_default', $theme);
variable_set('admin_theme', $admin_theme);
variable_set('node_admin_theme', '1');
variable_set('media_dialog_theme', $admin_theme);
}
/**
* Permissions.
*/
function motionsplan_deploy_update_7004() {
// Allow visitor account creation, but with administrative approval.
variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
// Enable default permissions for system roles.
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
}