-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdsgf_profile.install
73 lines (61 loc) · 2.13 KB
/
dsgf_profile.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
<?php
/**
* @file
* Install, update and uninstall functions for the `drupalsgf.org` install profile.
*/
/**
* Implements hook_install().
* @see system_install()
*/
function sgf_profile_install() {
// Set the default input format.
$full_html_format = array(
'format' => 'full_html',
'name' => 'HTML',
'weight' => 1,
'filters' => array(
// URL Filter
'filter_url' => array(
'weight' => 0,
'status' => 1,
),
),
);
$full_html_format = (object) $full_html_format;
filter_format_save($full_html_format);
// Restrict new user registrations for now.
// Later, user USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL or similar.
variable_set('user_register', USER_REGISTER_ADMINISTRATORS_ONLY);
// Create a default role for administrators with all 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')));
// Grant other roles default permissions
user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content'));
user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content'));
// Set 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();
// Basic Page settings
variable_set('node_options_page', array('status'));
variable_set('comment_page', COMMENT_NODE_HIDDEN);
variable_set('node_submitted_page', FALSE);
// Pathauto settings
variable_set('pathauto_node_pattern', '[node:title]');
variable_set('pathauto_node_blog_pattern', 'blog/[user:name]/[node:title]');
// Theme settings
theme_enable(array('shiny', 'omega'));
variable_set('theme_default', 'omega');
variable_set('admin_theme', 'shiny');
variable_set('node_admin_theme', '1');
// Various settings
variable_set('site_default_country', 'US');
variable_set('site_frontpage', 'blog');
// Update menu_router info
menu_rebuild();
}