-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathding_facetbrowser.install
More file actions
78 lines (75 loc) · 1.89 KB
/
ding_facetbrowser.install
File metadata and controls
78 lines (75 loc) · 1.89 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* @file
* Handles requirements hook for the module.
*/
/**
* Implements hook_requirements().
*/
function ding_facetbrowser_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'runtime') {
$requirements['ding_facetbrowser'] = array(
'title' => $t('Ding facetbrowser'),
'value' => $t('One or more facetgroups have been translated.'),
);
if (variable_get('ding_facetbrowser_facets', FALSE) == FALSE) {
$requirements['ding_facetbrowser']['value'] = $t('No facetgroups have been translated. Go to <a href="!link">Settings</a>.', array('!link' => '/admin/config/ting/facets'));
$requirements['ding_facetbrowser']['severity'] = REQUIREMENT_ERROR;
}
}
return $requirements;
}
/**
* Implements hook_install().
*
* Set default facets during installation.
*/
function ding_facetbrowser_install() {
$facets = array(
0 => array(
'name' => 'facet.type',
'title' => 'Materialetype',
'sorting' => 'default',
'weight' => '-10',
),
1 => array(
'name' => 'facet.creator',
'title' => 'Forfatter',
'sorting' => 'default',
'weight' => '-9',
),
2 => array(
'name' => 'facet.subject',
'title' => 'Emne',
'sorting' => 'default',
'weight' => '-8',
),
3 => array(
'name' => 'facet.language',
'title' => 'Sprog',
'sorting' => 'default',
'weight' => '-7',
),
4 => array(
'name' => 'facet.category',
'title' => 'Målgruppe',
'sorting' => 'default',
'weight' => '-6',
),
5 => array(
'name' => 'facet.date',
'title' => 'Årstal',
'sorting' => 'numeric_reverse',
'weight' => '-5',
),
6 => array(
'name' => 'facet.acSource',
'title' => 'Kilde',
'sorting' => 'default',
'weight' => '-4',
),
);
variable_set('ding_facetbrowser_facets', $facets);
}