forked from WhiteHouse/petitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
petitions.install
45 lines (41 loc) · 1.05 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
<?php
/**
* 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', 'rubik')
->condition('name', 'petitions44')
->execute();
variable_set('admin_theme', 'rubik');
variable_set('theme_default', 'petitions44');
$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);
}
}