-
Notifications
You must be signed in to change notification settings - Fork 8
/
usc_mirc.install
56 lines (48 loc) · 1.48 KB
/
usc_mirc.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
<?php
/**
* @file
* Install file for the MIRC@SC module.
*/
/**
* Implements hook_install().
*/
function usc_mirc_install() {
module_load_include('inc', 'islandora', 'includes/solution_packs');
islandora_install_solution_pack('usc_mirc');
$types = array(
'original' => 'Original',
'edited' => 'Edited',
);
$formats = array(
'edge-to-edge' => 'Edge-to-edge/Full frame (including perfs)',
'cropped' => 'Cropped',
);
$type_vocab = array(
'name' => 'Derivative Type',
'machine_name' => 'usc_mirc_mezzanine_type_vocab',
'description' => 'Whether this mezzanine is edited, or so on.',
);
taxonomy_vocabulary_save((object) $type_vocab);
$format_vocab = array(
'name' => 'Derivative Format',
'machine_name' => 'usc_mirc_mezzanine_format_vocab',
'description' => 'Whether this mezzanine is edge-to-edge, cropped, or so on.',
);
taxonomy_vocabulary_save((object) $format_vocab);
$type_taxonomy = taxonomy_vocabulary_machine_name_load('usc_mirc_mezzanine_type_vocab');
$format_taxonomy = taxonomy_vocabulary_machine_name_load('usc_mirc_mezzanine_format_vocab');
foreach ($types as $key => $type) {
taxonomy_term_save((object) array(
'name' => $type,
'vid' => $type_taxonomy->vid,
'vocabulary_machine_name' => $key,
));
}
foreach ($formats as $key => $format) {
taxonomy_term_save((object) array(
'name' => $format,
'vid' => $format_taxonomy->vid,
'vocabulary_machine_name' => $key,
));
}
}