-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvih_dk.install
70 lines (61 loc) · 1.75 KB
/
vih_dk.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
<?php
/**
* @file
* Install profile for vih.dk
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*/
function vih_dk_install() {
// Setting for date api.
variable_set('date_first_day', 1);
$theme = 'sport_2014';
$admin_theme = 'seven';
// Enable standard theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', $theme)
->execute();
// Disable bartik.
db_update('system')
->fields(array('status' => 0))
->condition('type', 'theme')
->condition('name', 'bartik')
->execute();
variable_set('theme_default', $theme);
// Enable the admin theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', $admin_theme)
->execute();
variable_set('admin_theme', $admin_theme);
variable_set('node_admin_theme', '1');
// Put content and menu in regions.
$values = array(
array(
'module' => 'system',
'delta' => 'main',
'theme' => $theme,
'status' => 1,
'weight' => 0,
'region' => 'content',
'pages' => '',
'cache' => -1,
),
);
$blocks = array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache');
$query = db_insert('block')->fields($blocks);
foreach ($values as $record) {
$query->values($record);
}
$query->execute();
// 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'));
}