-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathting_relation.module
More file actions
74 lines (70 loc) · 1.89 KB
/
ting_relation.module
File metadata and controls
74 lines (70 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
<?php
/**
* @file
* Handles relations for Ting entities.
*/
require_once 'includes/ting_relation.field.inc';
/**
* Implements hook_theme().
*/
function ting_relation_theme() {
return array(
'ting_relation_groups' => array(
'template' => 'templates/ting-relation-groups',
'render element' => 'elements',
'file' => 'includes/ting_relation.theme.inc',
),
'ting_relations' => array(
'template' => 'templates/ting-relations',
'variables' => array(
'title' => NULL,
'source' => NULL,
'relations' => NULL,
'attributes' => array(),
),
'file' => 'includes/ting_relation.theme.inc',
),
'ting_relation' => array(
'template' => 'templates/ting-relation',
'variables' => array(
'title' => NULL,
'abstract' => NULL,
'online' => NULL,
'target' => '_blank',
'fulltext_link' => FALSE,
'relation' => NULL,
'attributes' => array(),
),
'file' => 'includes/ting_relation.theme.inc',
),
);
}
/**
* Implements hook_ding_anchor_info().
*
* Builds the lists of relations to use as anchors when display a ting entity.
*/
function ting_relation_ding_anchor_info() {
$relations = ting_relation_inline();
return $relations;
}
/**
* Inline relation types and their titles.
*
* @return array
* Indexed by the relation types with a translatable string as data.
*/
function ting_relation_inline() {
static $types;
if (!$types) {
$types = array(
'dbcaddi:hasCreatorDescription' => t('Author portrait'),
'dbcaddi:hasReview' => t('Review'),
'dbcaddi:hasSubjectDescription' => t('Subject description'),
'dbcaddi:hasDescriptionFromPublisher' => t('Description from publisher'),
'dbcaddi:hasCreatorHomePage' => t('Creator homepage'),
'isPartOfManifestation' => t('Is part of manifestation'),
);
}
return $types;
}