updating dependencies
[project/dkan.git] / dkan.install
1 <?php
2
3 /**
4 * Implements hook_install().
5 */
6 function dkan_install() {
7 theme_enable(array('dkan'));
8 theme_enable(array('seven'));
9 variable_set('theme_default', 'dkan');
10 variable_set('admin_theme', 'seven');
11 variable_set('jquery_update_jquery_version', '1.7');
12
13 // Change block titles for selected blocks.
14 db_query("UPDATE {block} SET title ='<none>' WHERE delta = 'main-menu' OR delta = 'login'");
15 }
16
17 /**
18 * Implements hook_install_tasks()
19 */
20 function dkan_install_tasks() {
21 // Kick off the tasks.
22 $tasks = array();
23 $tasks['dkan_additional_setup'] = array(
24 'display_name' => 'Cleanup',
25 );
26 $tasks['dkan_additional_terms'] = array(
27 'display_name' => 'Taxonomy Terms',
28 );
29 return $tasks;
30 }
31
32 /**
33 * Implements hook_install_tasks()
34 */
35 function dkan_additional_setup() {
36 // Change block titles for selected blocks.
37 db_query("UPDATE {block} SET title ='<none>' WHERE delta = 'main-menu' OR delta = 'login'");
38 }
39
40 /**
41 * Adds default taxonomy terms.
42 */
43 function dkan_additional_terms() {
44 $tags = array(
45 'country-afghanistan',
46 'election',
47 'politics',
48 'transparency',
49 );
50 foreach ($tags as $tag) {
51 $term = new stdClass();
52 // 'Tags' vid.
53 $term->vid = 2;
54 $term->name = $tag;
55 taxonomy_term_save($term);
56 }
57 $formats = array(
58 'csv',
59 'html',
60 );
61 foreach ($formats as $format) {
62 $term = new stdClass();
63 // 'Formats' vid.
64 $term->vid = 1;
65 $term->name = $tag;
66 taxonomy_term_save($term);
67 }
68 }
69