forked from WhiteHouse/petitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
petitions.install
58 lines (51 loc) · 1.53 KB
/
petitions.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
<?php
/**
* @file
* Install, update and uninstall functions for the Petitions profile.
*/
/**
* Implements hook_install().
*
* Perform actions to set up the site for this profile.
*/
function petitions_install() {
include_once DRUPAL_ROOT . '/profiles/standard/standard.install';
standard_install();
$t = get_t();
// Enable the admin theme.
db_update('system')
->fields(array('status' => 1))
->condition('type', 'theme')
->condition('name', 'petitions44')
->execute();
variable_set('admin_theme', 'seven');
variable_set('theme_default', 'petitions44');
// Enable and configure the Petitions Signature Form module.
global $base_url;
variable_set('petitionssignatureform_api_endpoint', $base_url . '/v1');
variable_set('petitionssignatureform_petitions_website_url ', $base_url);
variable_set('petitionssignatureform_form_petition_id_argument_location', 0);
variable_set('petitionssignatureform_form_petition_id_argument_type', 2);
// Create the "Issues" taxonomy vocabulary.
$vocabulary = (object) array(
'name' => $t('Issues'),
'machine_name' => 'issues',
);
taxonomy_vocabulary_save($vocabulary);
// Save issue terms for petitions install process.
$terms = array(
'Agriculture',
'Arts and Humanities',
'Budget and Taxes',
'Civil Rights and Liberties',
'Climate Change',
);
foreach ($terms as $name) {
$term = (object) array(
'name' => $t("$name"),
'vocabulary_machine_name' => 'issues',
'vid' => 2,
);
taxonomy_term_save($term);
}
}