forked from moreonion/campaignion_starterkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
campaignion_starterkit.install
60 lines (51 loc) · 2.1 KB
/
campaignion_starterkit.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
<?php
function campaignion_starterkit_install() {
_campaignion_starterkit_themes();
_campaignion_starterkit_set_variables();
_campaignion_starterkit_add_european_languages();
$devel = isset($GLOBALS['install_state']['forms']['mo_devel_flag']);
if ($devel) {
$devel_modules = array(
"coffee",
"context_ui",
"devel",
"devel_generate",
"field_ui",
"views_ui",
);
module_enable($devel_modules);
variable_set('devel_debug_mail_directory', '/tmp/devel-mails/');
}
_campaignion_starterkit_frontpage();
}
function _campaignion_starterkit_add_european_languages() {
foreach (array('ba', 'be', 'bg', 'br', 'bs', 'ca', 'ce', 'co', 'cs', 'cv', 'cy', 'da', 'de', 'dv', 'el', 'es', 'et', 'eu', 'fi', 'fo', 'fr', 'fy', 'ga', 'gd', 'gl', 'gsw-berne', 'hr', 'hu', 'hy', 'is', 'it', 'ka', 'kl', 'kv', 'lb', 'lt', 'lv', 'mk', 'mo', 'mt', 'nl', 'nb', 'nn', 'oc', 'os', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'tt', 'uk', 'yi') as $lc) {
locale_add_language($lc, NULL, NULL, LANGUAGE_LTR, '', '', 0);
}
}
function _campaignion_starterkit_set_variables() {
variable_set('clientside_validation_path_list', 'admin/structure/views/*');
variable_set('clientside_validation_override_jquery_form', '1');
variable_set('pathauto_node_pattern', '[node:title]');
// user registration is admin only per default.
variable_set('user_register', '0');
variable_set('campaignion_bar_file', drupal_get_path('module', 'campaignion_starterkit') . '/campaignion_bar.txt');
variable_set('jquery_update_jquery_version', '1.7');
}
function _campaignion_starterkit_themes() {
theme_enable(array('ae_admin', 'ae_base', 'simplicity'));
variable_set('theme_default', 'simplicity');
variable_set('admin_theme', 'ae_admin');
variable_set('node_admin_theme', 1);
}
function _campaignion_starterkit_frontpage() {
module_load_include('module', 'node');
$node = (object) array(
'title' => 'Let\'s change the world!',
'type' => 'static_page',
'comment' => '1',
);
node_object_prepare($node);
node_save($node);
variable_set('site_frontpage', 'node/' . $node->nid);
}