1
+ <?php
2
+
3
+ /**
4
+ * Implements hook_install().
5
+ *
6
+ * Perform actions to set up the site for this profile.
7
+ */
8
+ function ***MACHINE_NAME***_install() {
9
+ // Enable some standard blocks.
10
+ $default_theme = variable_get('theme_default', 'bartik');
11
+
12
+ $values = array(
13
+ array(
14
+ 'module' => 'system',
15
+ 'delta' => 'main',
16
+ 'theme' => $default_theme,
17
+ 'status' => 1,
18
+ 'weight' => 0,
19
+ 'region' => 'content',
20
+ 'pages' => '',
21
+ 'cache' => -1,
22
+ ),
23
+ array(
24
+ 'module' => 'user',
25
+ 'delta' => 'login',
26
+ 'theme' => $default_theme,
27
+ 'status' => 1,
28
+ 'weight' => 0,
29
+ 'region' => 'sidebar_first',
30
+ 'pages' => '',
31
+ 'cache' => -1,
32
+ ),
33
+ array(
34
+ 'module' => 'system',
35
+ 'delta' => 'navigation',
36
+ 'theme' => $default_theme,
37
+ 'status' => 1,
38
+ 'weight' => 0,
39
+ 'region' => 'sidebar_first',
40
+ 'pages' => '',
41
+ 'cache' => -1,
42
+ ),
43
+ array(
44
+ 'module' => 'system',
45
+ 'delta' => 'management',
46
+ 'theme' => $default_theme,
47
+ 'status' => 1,
48
+ 'weight' => 1,
49
+ 'region' => 'sidebar_first',
50
+ 'pages' => '',
51
+ 'cache' => -1,
52
+ ),
53
+ array(
54
+ 'module' => 'system',
55
+ 'delta' => 'help',
56
+ 'theme' => $default_theme,
57
+ 'status' => 1,
58
+ 'weight' => 0,
59
+ 'region' => 'help',
60
+ 'pages' => '',
61
+ 'cache' => -1,
62
+ ),
63
+ );
64
+ $query = db_insert('block')->fields(array('module', 'delta', 'theme', 'status', 'weight', 'region', 'pages', 'cache'));
65
+ foreach ($values as $record) {
66
+ $query->values($record);
67
+ }
68
+ $query->execute();
69
+
70
+ // Allow visitor account creation, but with administrative approval.
71
+ variable_set('user_register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL);
72
+
73
+ // Enable default permissions for system roles.
74
+ user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
75
+ user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
76
+ }
0 commit comments