This repository has been archived by the owner on Feb 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docbookwiki.install
75 lines (63 loc) · 2.02 KB
/
docbookwiki.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
<?php
/**
* @file
* Install functions for the profile DocBookWiki.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*/
function docbookwiki_install() {
include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
standard_install();
// enable themes and set the default theme
theme_enable(array('bootstrap1'));
variable_set('theme_default', 'bootstrap1');
variable_set('jquery_update_compression_type', 'min');
variable_set('jquery_update_jquery_cdn', 'google');
variable_set('jquery_update_jquery_version', '1.8');
// user settings
variable_set('user_register', USER_REGISTER_VISITORS);
variable_set('user_email_verification', TRUE);
_docbookwiki_install_mailsystem();
_docbookwiki_install_actions();
}
function _docbookwiki_install_mailsystem()
{
variable_set('mailsystem_theme', 'current');
$mail_system = variable_get('mail_system');
$mail_system['default-system'] = 'MimeMailSystem';
variable_set('mail_system', $mail_system);
}
function _docbookwiki_install_actions()
{
$site_mail = variable_get('site_mail');
// create actions
$action_id_1 = actions_save(
'system_send_email_action',
'system',
array(
'recipient' => $site_mail,
'subject' => '[docbookwiki] New user: [user:name]',
'message' => 'New user: [user:name]',
),
t('Send e-mail to admin when a new user is registered')
);
$action_id_2 = actions_save(
'system_send_email_action',
'system',
array(
'recipient' => $site_mail,
'subject' => '[docbookwiki] [user:name] has modified his account',
'message' => 'The user [user:name] has modified his account.',
),
t('Send e-mail to admin when user modifies his account')
);
// assign actions to triggers
db_insert('trigger_assignments')
->fields(array('hook', 'aid', 'weight'))
->values(array('hook' => 'user_insert', 'aid' => $action_id_1, 'weight' => 0))
->values(array('hook' => 'user_update', 'aid' => $action_id_2, 'weight' => 0))
->execute();
}