Skip to content

Commit e0ee8dc

Browse files
committed
Create default approved rules from install
1 parent 0e54838 commit e0ee8dc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

os2web_cp_service.install

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* @file
4+
* Implements install hooks
5+
*/
6+
7+
/**
8+
* Imlpements hook_install().
9+
*/
10+
function os2web_cp_service_install() {
11+
// Quick way to have default approved rules
12+
$approved_rules = array('Byggesager', 'Emnesager', 'Postliste');
13+
14+
$rules_vocabulary = taxonomy_vocabulary_machine_name_load('os2web_cp_service_tax_approved_rules');
15+
foreach ($approved_rules as $name) {
16+
$term = new stdClass();
17+
$term->vid = $rules_vocabulary->vid;
18+
$term->name = $name;
19+
taxonomy_term_save($term);
20+
}
21+
}

0 commit comments

Comments
 (0)