annotate openmindattribute/openmindattribute.module~ @ 31:48bbba800c03

remove unused method.
author casties
date Thu, 21 Jan 2016 18:24:51 +0100
parents 124ef8f3b22d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1 <?php
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
2
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
3
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
4
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
5 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
6 * Implements hook_field_info().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
7 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
8 function openmindattribute_field_info() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
9 return array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
10 'openmindattribute_field' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
11 'label' => t('Attribute'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
12 'description' => t('The attribute'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
13 'default_widget' => 'openmindattribute_field',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
14 'default_formatter' => 'openmindattribute_default',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
15 // Support hook_entity_property_info() from contrib "Entity API".
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
16 'property_type' => 'field_item_openmindattribute',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
17 'property_callbacks' => array('openmindattribute_field_property_info_callback')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
18 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
19 'openmindattribute_fields' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
20 'label' => t('All Attributes'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
21 'description' => t('The attributes'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
22 'default_widget' => 'openmindattribute_fields',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
23 'default_formatter' => 'openmindattribute_default',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
24 // Support hook_entity_property_info() from contrib "Entity API".
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
25 #'property_type' => 'field_item_openmindattribute',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
26 #'property_callbacks' => array('openmindattribute_field_property_info_callback')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
27 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
28 'openmindattribute_field' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
29 'label' => t('Attribute'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
30 'description' => t('The attribute'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
31 'default_widget' => 'openmindattribute_field',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
32 'default_formatter' => 'openmindattribute_default',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
33 // Support hook_entity_property_info() from contrib "Entity API".
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
34 'property_type' => 'field_item_openmindattribute',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
35 'property_callbacks' => array('openmindattribute_field_property_info_callback')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
36 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
37
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
38 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
39 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
40
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
41 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
42 * Implements hook_field_instance_settings_form().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
43 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
44 function openmindattribute_field_instance_settings_form($field, $instance) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
45
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
46 if ($field['type'] == 'openmindattribute_fields'){ // nur ausgabe feld!
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
47 $form['name'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
48 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
49 '#title' => t('Name'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
50 '#default_value' => isset($instance['settings']['name']) ? $instance['settings']['name'] : '',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
51 '#description' => t('This title will always be used if &ldquo;Static Title&rdquo; is selected above.'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
52 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
53 return $form;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
54 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
55 $form = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
56 '#element_validate' => array('openmindattribute_field_settings_form_validate'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
57 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
58
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
59
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
60
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
61 $form['name'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
62 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
63 '#title' => t('Name'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
64 '#default_value' => isset($instance['settings']['name']) ? $instance['settings']['name'] : '',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
65 '#description' => t('This title will always be used if &ldquo;Static Title&rdquo; is selected above.'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
66 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
67
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
68
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
69
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
70
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
71
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
72 $form['ov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
73 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
74 '#title' => t('Ov'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
75 '#description' => t('Value'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
76 #'#default_value' => empty($instance['settings']['attributes']['rel']) ? '' : $instance['settings']['attributes']['rel'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
77 #'#field_prefix' => 'rel = "',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
78 #'#field_suffix' => '"',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
79 '#size' => 100,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
80 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
81
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
82 $form['nov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
83 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
84 '#title' => t('Nov'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
85 '#description' => t('Normalised Value'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
86 #'#default_value' => empty($instance['settings']['attributes']['rel']) ? '' : $instance['settings']['attributes']['rel'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
87 #'#field_prefix' => 'rel = "',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
88 #'#field_suffix' => '"',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
89 '#size' => 100,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
90 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
91
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
92 $form['romanization'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
93 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
94 '#title' => t('Romanization'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
95 '#description' => t('Normalised Value (LOC)'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
96 #'#default_value' => empty($instance['settings']['attributes']['rel']) ? '' : $instance['settings']['attributes']['rel'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
97 #'#field_prefix' => 'rel = "',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
98 #'#field_suffix' => '"',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
99 '#size' => 100,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
100 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
101
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
102
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
103 return $form;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
104 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
105
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
106 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
107 * #element_validate handler for openmindattribute_field_instance_settings_form().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
108 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
109 function openmindattribute_field_settings_form_validate($element, &$form_state, $complete_form) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
110 return true;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
111 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
112
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
113 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
114 * Implements hook_field_is_empty().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
115 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
116 function openmindattribute_field_is_empty($item, $field) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
117 return false;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
118 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
119
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
120 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
121 # * Implements hook_field_load().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
122 # */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
123 #function link_field_load($entity_type, $entities, $field, $instances, $langcode, &$items, $age) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
124 # foreach ($entities as $id => $entity) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
125 # foreach ($items[$id] as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
126 # $items[$id][$delta]['attributes'] = _link_load($field, $item, $instances[$id]);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
127 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
128 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
129 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
130
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
131 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
132 * Implements hook_field_validate().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
133 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
134 function openmindattribute_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
135 return true;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
136 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
137
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
138
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
139
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
140 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
141 * Implements hook_field_insert().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
142 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
143 function openmindattribute_field_insert($entity_type, $entity, $field, $instance, $langcode, &$items) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
144 foreach ($items as $delta => $value) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
145 _openmindattribute_process($items[$delta], $delta, $field, $entity);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
146 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
147 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
148
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
149 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
150 * Implements hook_field_update().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
151 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
152 function openmindattribute_field_update($entity_type, $entity, $field, $instance, $langcode, &$items) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
153 foreach ($items as $delta => $value) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
154 _openmindattribute_process($items[$delta], $delta, $field, $entity);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
155 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
156 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
157
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
158 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
159 # * Implements hook_field_prepare_view().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
160 #*/
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
161 #function openmindattribute_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
162 # foreach ($items as $entity_id => $entity_items) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
163 # foreach ($entity_items as $delta => $value) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
164 # _link_sanitize($items[$entity_id][$delta], $delta, $field, $instances[$entity_id], $entities[$entity_id]);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
165 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
166 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
167 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
168
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
169 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
170 * Implements hook_field_widget_info().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
171 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
172 function openmindattribute_field_widget_info() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
173 return array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
174 'openmindattribute_field' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
175 'label' => 'Attribute',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
176 'field types' => array('openmindattribute_field'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
177 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
178 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
179 'openmindattribute_fields' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
180 'label' => 'NOTHING',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
181 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
182 'multiple values' => FIELD_BEHAVIOR_NONE
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
183 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
184 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
185 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
186
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
187 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
188 * Implements hook_field_widget_form().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
189 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
190 function openmindattribute_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
191
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
192
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
193 if ($field['type'] == 'openmindattribute_fields'){ // nur ausgabe feld!
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
194 return $element;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
195 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
196 $element += array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
197 '#type' => $instance['widget']['type'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
198 '#default_value' => isset($items[$delta]) ? $items[$delta] : '',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
199 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
200 return $element;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
201 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
202
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
203 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
204 # * Implements hook_field_widget_error().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
205 # */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
206 #function link_field_widget_error($element, $error, $form, &$form_state) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
207 # if ($error['error_element']['title']) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
208 # form_error($element['title'], $error['message']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
209 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
210 # elseif ($error['error_element']['url']) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
211 # form_error($element['url'], $error['message']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
212 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
213 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
214
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
215
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
216 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
217 * Prepares the item attributes and url for storage.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
218 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
219 function _openmindattribute_process(&$item, $delta = 0, $field, $entity) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
220 // Trim whitespace from URL.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
221 $item['name'] = trim($item['name']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
222 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
223
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
224
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
225
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
226
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
227 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
228 * Implements hook_theme().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
229 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
230 function openmindattribute_theme() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
231 return array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
232 'openmindattribute_formatter_default' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
233 'variables' => array('element' => NULL, 'field' => NULL, 'entity' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
234 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
235 'openmindattribute_formatter_fields_default' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
236 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
237 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
238 'openmindattribute_formatter_fields_specialized' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
239 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
240 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
241 'openmindattribute_formatter_field_identifier' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
242 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
243 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
244
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
245 'openmindattribute_formatter_field_full_title' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
246 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
247 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
248
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
249
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
250 'openmindattribute_formatter_field_full_title_translit_romanization' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
251 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
252 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
253
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
254
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
255 'openmindattribute_formatter_field_name_translit_romanization' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
256 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
257 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
258
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
259 'openmindattribute_formatter_field_name' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
260 'variables' => array('type' => NULL, 'attributes' => NULL, 'nid' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
261 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
262
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
263 'openmindattribute_formatter_field_ahlwardt' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
264 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
265 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
266
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
267 'openmindattribute_formatter_fields_diva_link' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
268 'variables' => array('type' => NULL,'entid' => NULL)
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
269 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
270
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
271 'openmindattribute_formatter_field_MPIWG_viewer' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
272 'variables' => array('type' => NULL, 'attributes' => NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
273 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
274 'openmindattribute_item_thumbnail' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
275 'variables' => array('objid' => NULL,'entid' => NULL,'objdata'=>NULL,'type'=>NULL),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
276
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
277 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
278
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
279
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
280 'openmindattribute_reference_format' => array (
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
281 'variables' => array('type' => NULL,'entid' => NULL, 'attributes' => NULL, 'ov' => NULL, 'nid' => NULL ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
282
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
283 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
284
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
285
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
286
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
287
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
288
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
289 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
290 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
291
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
292 function theme_openmindattribute_item_thumbnail($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
293
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
294 $vars['objdata'] = digitalobjects_readMetadata($vars['objid']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
295
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
296 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute-item-thumbnail.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
297
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
298 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
299
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
300
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
301 function theme_openmindattribute_reference_format($vars){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
302
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
303 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_reference_format.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
304
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
305 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
306
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
307 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
308 * Formats a link field widget.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
309 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
310 function theme_openmindattribute_field($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
311 drupal_add_css(drupal_get_path('module', 'openmindattribute') . '/openmindattribute.css');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
312 $element = $vars['element'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
313 // Prefix single value link fields with the name of the field.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
314
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
315
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
316 $output = '';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
317 $output .= '<div class="openmindattribute-field-subrow clearfix">';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
318 $output = $output . $element['name'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
319 $output = $output . $element['ov'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
320 $output = $output . $element['nov'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
321 $output = $output . $element['romanization'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
322
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
323 return $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
324 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
325
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
326 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
327 * Implements hook_element_info().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
328 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
329 function openmindattribute_element_info() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
330 $elements = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
331 $elements['openmindattribute_field'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
332 '#input' => TRUE,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
333 '#process' => array('openmindattribute_field_process'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
334 '#theme' => 'openmindattribute_field',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
335 '#theme_wrappers' => array('form_element'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
336 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
337 return $elements;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
338 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
339
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
340
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
341
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
342 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
343 * Processes the link type element before displaying the field.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
344 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
345 * Build the form element. When creating a form using FAPI #process,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
346 * note that $element['#value'] is already set.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
347 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
348 * The $fields array is in $complete_form['#field_info'][$element['#field_name']].
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
349 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
350 function openmindattribute_field_process($element, $form_state, $complete_form) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
351
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
352 $instance = field_widget_instance($element, $form_state);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
353
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
354 $settings = $instance['settings'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
355 $element['name'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
356 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
357 '#maxlength' => 1000,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
358 '#title' => t('name'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
359 '#required' => FALSE,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
360 '#default_value' => isset($element['#value']['name']) ? $element['#value']['name'] : NULL,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
361 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
362
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
363 $element['ov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
364 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
365 '#maxlength' => 1000,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
366 '#title' => t('ov'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
367 '#required' => FALSE,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
368 '#default_value' => isset($element['#value']['ov']) ? $element['#value']['ov'] : NULL,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
369 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
370
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
371 $element['nov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
372 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
373 '#maxlength' => 1000,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
374 '#title' => t('nov'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
375 '#required' => FALSE,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
376 '#default_value' => isset($element['#value']['nov']) ? $element['#value']['nov'] : NULL,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
377 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
378
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
379 $element['romanization'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
380 '#type' => 'textfield',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
381 '#maxlength' => 1000,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
382 '#title' => t('romanization'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
383 '#required' => FALSE,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
384 '#default_value' => isset($element['#value']['romanization']) ? $element['#value']['romanization'] : NULL,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
385 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
386
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
387
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
388
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
389 return $element;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
390 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
391
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
392 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
393 * Implements hook_field_formatter_info().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
394 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
395 function openmindattribute_field_formatter_info() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
396 return array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
397
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
398
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
399 'openmindattribute_reference_format' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
400 'label' => t('Formats a title field with the field selected, depending on the value of oc'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
401 'field types' => array('text'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
402 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
403 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
404
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
405 'openmindattribute_default' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
406 'label' => t('Attribute as default'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
407 'field types' => array('openmindattribute_field'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
408 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
409 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
410 'openmindattribute_fields_default' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
411 'label' => t('All Attribute as default'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
412 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
413 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
414 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
415 'openmindattribute_fields_specialized' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
416 'label' => t('All Attribute as specialized'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
417 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
418 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
419 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
420 'openmindattribute_fields_diva_link' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
421 'label' => t('DIVA-openmind-view'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
422 'field types' => array('text'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
423 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
424 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
425 'openmindattribute_field_identifier' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
426 'label' => t('Only the attribute identifer'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
427 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
428 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
429 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
430
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
431 'openmindattribute_field_full_title' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
432 'label' => t('Only the attribute full_title'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
433 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
434 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
435 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
436
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
437 'openmindattribute_field_full_title_translit_romanization' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
438 'label' => t('Only the attribute full_title_translit_romanization'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
439 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
440 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
441 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
442
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
443 'openmindattribute_field_name_translit_romanization' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
444 'label' => t('Only the attribute name_translit_romanization'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
445 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
446 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
447 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
448
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
449 'openmindattribute_field_ahlwardt' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
450 'label' => t('Only the attribute ahlwardt'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
451 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
452 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
453 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
454
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
455 'openmindattribute_field_name' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
456 'label' => t('Only the attribute name'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
457 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
458 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
459 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
460
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
461
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
462
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
463 'openmindattribute_field_MPIWG_viewer' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
464 'label' => t('MPIWG Image viewer'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
465 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
466 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
467 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
468 'openmindattribute_field_MPIWG_viewer_for_view' => array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
469 'label' => t('MPIWG Image viewer (for use in views)'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
470 'field types' => array('openmindattribute_fields'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
471 'multiple values' => FIELD_BEHAVIOR_DEFAULT,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
472 ),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
473
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
474
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
475 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
476 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
477
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
478 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
479 # * Implements hook_field_formatter_settings_form().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
480 # */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
481 #function openmindattribute_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
482 # $display = $instance['display'][$view_mode];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
483 # $settings = $display['settings'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
484 # $element = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
485 # if ($display['type'] == 'link_domain') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
486 # $element['strip_www'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
487 # '#title' => t('Strip www. from domain'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
488 # '#type' => 'checkbox',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
489 # '#default_value' => $settings['strip_www'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
490 # );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
491 ## }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
492 # return $element;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
493 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
494
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
495 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
496 # * Implements hook_field_formatter_settings_summary().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
497 # */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
498 #function link_field_formatter_settings_summary($field, $instance, $view_mode) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
499 # $display = $instance['display'][$view_mode];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
500 # $settings = $display['settings'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
501 # if ($display['type'] == 'link_domain') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
502 # if ($display['settings']['strip_www']) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
503 # return t('Strip www. from domain');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
504 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
505 ## else {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
506 # return t('Leave www. in domain');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
507 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
508 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
509 # return '';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
510 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
511
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
512
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
513 function _openmindattribute_field_remap($atts){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
514 //erzeuge eine array mit name -> (ov, nov,name)
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
515 $retmap = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
516 foreach ($atts as $a){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
517 $retmap[$a['name']]=$a;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
518 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
519 return $retmap;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
520 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
521
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
522
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
523
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
524
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
525
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
526 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
527 * Implements hook_field_formatter_view().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
528 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
529 function openmindattribute_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
530
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
531
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
532 #openmindattribute_fields ist nur experimentell, TODO: insbesondere field_oc, field_attribute sollte nicht hardcoded vorliegen.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
533
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
534 $elements= array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
535
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
536 if ($field['type'] == 'text'){ // nur ausgabe feld!
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
537
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
538
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
539
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
540 switch($display['type']){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
541
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
542
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
543 case ("openmindattribute_fields_diva_link"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
544
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
545 foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
546 $entid = $entity->field_id['und'][0]['value'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
547
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
548 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
549
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
550 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
551
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
552
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
553 $elements[$delta] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
554 '#theme' => 'openmindattribute_formatter_fields_diva_link',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
555 '#entid' => $entid,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
556 '#type' => $term->name
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
557
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
558 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
559 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
560
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
561 return $elements;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
562
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
563
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
564 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
565
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
566 case ("openmindattribute_reference_format"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
567
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
568 foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
569 $entid = $entity->field_id['und'][0]['value'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
570
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
571 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
572
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
573 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
574
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
575
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
576 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
577
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
578 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
579
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
580
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
581
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
582
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
583
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
584 $elements[$delta] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
585 '#theme' => 'openmindattribute_reference_format',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
586 '#entid' => $entid,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
587 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
588 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
589 '#ov' =>$entity->field_ov['und'][0]['value'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
590 '#nid' => $entity->nid
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
591
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
592
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
593 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
594 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
595
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
596 return $elements;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
597 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
598
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
599
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
600
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
601
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
602
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
603
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
604 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
605
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
606
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
607 if ($field['type'] == 'openmindattribute_fields'){ // nur ausgabe feld!
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
608
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
609 switch($display['type']){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
610
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
611
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
612 case ("openmindattribute_fields_specialized"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
613
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
614
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
615 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
616
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
617 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
618
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
619
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
620 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
621
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
622 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
623
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
624
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
625 $elements = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
626 '#theme' => 'openmindattribute_formatter_fields_specialized',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
627 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
628 '#type' => $term->name
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
629 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
630
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
631 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
632
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
633 case ("openmindattribute_fields_default"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
634
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
635
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
636 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
637
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
638 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
639
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
640
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
641
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
642 $elements = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
643 '#theme' => 'openmindattribute_formatter_fields_default',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
644 '#attributes' => $entity->field_attribute['und'],
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
645 '#type' => $term->name
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
646 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
647
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
648 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
649
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
650 // show only the identifier TODO only preliminary should define a formatter where you can configure the field
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
651
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
652
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
653 case ("openmindattribute_field_identifier"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
654
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
655 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
656 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
657
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
658 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
659
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
660
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
661 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
662
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
663 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
664
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
665
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
666 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
667 '#theme' => 'openmindattribute_formatter_field_identifier',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
668 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
669 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
670 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
671
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
672 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
673
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
674 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
675
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
676
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
677 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
678 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
679 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
680
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
681 case ("openmindattribute_field_full_title"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
682
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
683 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
684 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
685
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
686 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
687
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
688
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
689 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
690
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
691 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
692
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
693
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
694 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
695 '#theme' => 'openmindattribute_formatter_field_full_title',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
696 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
697 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
698 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
699
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
700 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
701
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
702 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
703
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
704
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
705 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
706 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
707 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
708
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
709
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
710 case ("openmindattribute_field_full_title_translit_romanization"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
711
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
712 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
713 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
714
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
715 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
716
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
717
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
718 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
719
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
720 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
721
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
722
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
723 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
724 '#theme' => 'openmindattribute_formatter_field_full_title_translit_romanization',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
725 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
726 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
727 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
728
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
729 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
730
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
731 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
732
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
733
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
734 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
735 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
736 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
737
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
738
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
739 case ("openmindattribute_field_name_translit_romanization"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
740
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
741 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
742 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
743
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
744 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
745
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
746
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
747 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
748
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
749 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
750
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
751
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
752 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
753 '#theme' => 'openmindattribute_formatter_field_name_translit_romanization',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
754 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
755 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
756 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
757
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
758 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
759
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
760 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
761
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
762
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
763 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
764 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
765 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
766 case ("openmindattribute_field_name"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
767
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
768 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
769 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
770
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
771 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
772
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
773
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
774 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
775
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
776 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
777
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
778
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
779 $nid = $entity->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
780
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
781 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
782 '#theme' => 'openmindattribute_formatter_field_name',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
783 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
784 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
785 '#nid' => $nid
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
786 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
787
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
788 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
789
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
790 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
791
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
792
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
793 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
794 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
795 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
796
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
797
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
798 case ("openmindattribute_field_ahlwardt"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
799
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
800 //foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
801 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
802
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
803 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
804
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
805
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
806 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
807
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
808 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
809
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
810
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
811 $output = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
812 '#theme' => 'openmindattribute_formatter_field_ahlwardt',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
813 '#attributes' => $atts_mapped,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
814 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
815 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
816
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
817 $elements[] = $output;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
818
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
819 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
820
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
821
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
822 //$elements[$delta] = array ('#markup' => render($element_tmp));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
823 //}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
824 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
825
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
826 case ("openmindattribute_field_MPIWG_viewer"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
827
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
828
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
829 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
830
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
831 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
832
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
833
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
834 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
835
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
836 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
837
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
838
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
839 if (isset($atts_mapped['mpiwg_id']['ov'])){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
840
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
841 $elements = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
842 '#theme' => 'digitalobjects_item_thumbnail',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
843 '#objid' => strtoupper($atts_mapped['mpiwg_id']['ov']),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
844
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
845
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
846
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
847 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
848
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
849
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
850 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
851
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
852 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
853
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
854 case ("openmindattribute_field_MPIWG_viewer_for_view"):
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
855
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
856
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
857
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
858
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
859
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
860
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
861 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
862
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
863 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
864
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
865
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
866 $atts = $entity->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
867
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
868 $atts_mapped = _openmindattribute_field_remap($atts);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
869
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
870 $entid = $entity->field_id['und'][0]['value'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
871
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
872 if (isset($atts_mapped['mpiwg_id']['ov'])){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
873
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
874 $elements[] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
875 '#theme' => 'openmindattribute_item_thumbnail',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
876 '#objid' => strtoupper($atts_mapped['mpiwg_id']['ov']),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
877 '#entid' => $entid,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
878 '#type' => $term->name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
879
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
880
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
881
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
882 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
883
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
884
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
885 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
886
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
887 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
888
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
889
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
890 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
891
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
892
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
893 return $elements;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
894 } else {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
895
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
896
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
897 $elements = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
898
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
899
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
900 foreach ($items as $delta => $item) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
901 $elements[$delta] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
902 '#theme' => 'openmindattribute_formatter_default',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
903 '#element' => $item,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
904 '#field' => $instance,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
905 '#display' => $display,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
906 '#entity' => $entity
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
907 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
908 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
909 return $elements;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
910 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
911 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
912
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
913 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
914 * Formats a link.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
915 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
916 function theme_openmindattribute_formatter_default($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
917
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
918
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
919 $entity = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
920
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
921
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
922 $ocid = $entity->field_oc['und'][0]['tid'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
923
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
924
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
925 $term = taxonomy_term_load($ocid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
926
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
927
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
928
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
929 return $vars['element']['name'] . $vars['element']['ov'] . $vars['element']['nov'] . $vars['element']['romanization'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
930
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
931 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
932
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
933 function theme_openmindattribute_formatter_fields_specialized($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
934
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
935 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
936
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
937
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
938 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_" . $type . ".tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
939
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
940
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
941
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
942
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
943
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
944
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
945 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
946
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
947
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
948
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
949 function theme_openmindattribute_formatter_field_identifier($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
950
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
951 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
952
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
953
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
954 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_identifier.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
955
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
956
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
957
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
958
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
959 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
960
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
961
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
962 function theme_openmindattribute_formatter_field_full_title($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
963
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
964 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
965
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
966
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
967 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_full_title.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
968
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
969
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
970
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
971
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
972 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
973
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
974
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
975
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
976 function theme_openmindattribute_formatter_field_full_title_translit_romanization($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
977
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
978 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
979
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
980
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
981 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_full_title_translit_romanization.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
982
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
983
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
984
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
985
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
986 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
987
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
988 function theme_openmindattribute_formatter_field_name_translit_romanization($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
989
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
990 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
991
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
992
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
993 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_name_translit_romanization.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
994
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
995
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
996
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
997
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
998 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
999
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1000
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1001
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1002 function theme_openmindattribute_formatter_field_name($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1003
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1004 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1005
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1006
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1007 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_name.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1008
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1009
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1010
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1011
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1012 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1013
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1014
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1015
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1016 function theme_openmindattribute_formatter_field_ahlwardt($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1017
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1018 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1019
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1020
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1021 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_ahlwardt.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1022
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1023
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1024
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1025
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1026 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1027
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1028 function theme_openmindattribute_formatter_field_MPIWG_viewer($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1029
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1030 $type = $vars['type'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1031
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1032
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1033 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_MPIWG_viewer.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1034
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1035
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1036 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1037
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1038
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1039 function theme_openmindattribute_formatter_fields_default($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1040
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1041
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1042
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1043 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_default.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1044
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1045
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1046
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1047
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1048
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1049 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1050
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1051 function theme_openmindattribute_formatter_fields_diva_link($vars) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1052
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1053
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1054 return theme_render_template(drupal_get_path('module', 'openmindattribute') . "/templates/openmindattribute_diva_link.tpl.php", $vars);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1055
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1056 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1057
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1058
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1059 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1060 * Implements hook_views_api().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1061 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1062 function openmindattribute_views_api() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1063 return array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1064 'api' => 2,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1065 'path' => drupal_get_path('module', 'openmindattribute') . '/views',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1066 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1067 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1068
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1069 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1070 * Implements hook_field_settings_form().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1071 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1072 function openmindattribute_field_settings_form() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1073 return array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1074 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1075
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1076 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1077 * Additional callback to adapt the property info of link fields.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1078 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1079 * @see entity_metadata_field_entity_property_info().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1080 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1081 function openmindattribute_field_property_info_callback(&$info, $entity_type, $field, $instance, $field_type) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1082 $property = &$info[$entity_type]['bundles'][$instance['bundle']]['properties'][$field['field_name']];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1083 // Define a data structure so it's possible to deal with both the link title
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1084 // and URL.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1085 $property['getter callback'] = 'entity_metadata_field_verbatim_get';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1086 $property['setter callback'] = 'entity_metadata_field_verbatim_set';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1087
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1088 // Auto-create the field item as soon as a property is set.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1089 $property['auto creation'] = 'openmindattribute_field_item_create';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1090
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1091 $property['property info'] = openmindattribute_field_item_property_info();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1092 $property['property info']['name']['required'] = !$instance['settings']['name'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1093 $property['property info']['ov']['required'] = ($instance['settings']['ov'] == 'required');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1094 if ($instance['settings']['ov'] == 'none') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1095 unset($property['property info']['ov']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1096 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1097
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1098 $property['property info']['nov']['required'] = ($instance['settings']['nov'] == 'required');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1099 if ($instance['settings']['nov'] == 'none') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1100 unset($property['property info']['nov']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1101 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1102 unset($property['query callback']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1103 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1104
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1105 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1106 * Callback for creating a new, empty link field item.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1107 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1108 * @see link_field_property_info_callback()
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1109 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1110 function openmindattribute_field_item_create() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1111 return array('title' => NULL, 'url' => NULL);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1112 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1113
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1114 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1115 * Defines info for the properties of the link-field item data structure.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1116 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1117 function openmindattribute_field_item_property_info() {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1118 $properties['ov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1119 'type' => 'text',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1120 'label' => t('The OV.'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1121 'setter callback' => 'entity_property_verbatim_set',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1122 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1123 $properties['name'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1124 'type' => 'text',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1125 'label' => t('The name of the attribute'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1126 'setter callback' => 'entity_property_verbatim_set',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1127 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1128
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1129 $properties['nov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1130 'type' => 'text',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1131 'label' => t('The NOV'),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1132 'setter callback' => 'entity_property_verbatim_set',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1133 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1134 return $properties;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1135 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1136
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1137 #/**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1138 # * Implements hook_field_update_instance().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1139 # */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1140 #function openmindattribute_field_update_instance($instance, $prior_instance) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1141 # if (function_exists('i18n_string_update') && $instance['widget']['type'] == 'openmindattribute_field' ) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1142 # $i18n_string_name = "field:{$instance['field_name']}:{$instance['bundle']}:title_value";
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1143 # i18n_string_update($i18n_string_name, $instance['settings']['title_value']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1144 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1145 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1146
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1147 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1148 * Implements hook_i18n_string_list_TEXTGROUP_alter().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1149 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1150 #function link_i18n_string_list_field_alter(&$strings, $type = NULL, $object = NULL) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1151 # if ($type != 'field_instance' || !is_array($object) || !isset($object['widget']['type'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1152 # return;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1153 # }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1154 # if ($object['widget']['type'] == 'link_field' && isset($object['settings']['title_value'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1155 ## $strings['field'][$object['field_name']][$object['bundle']]['title_value']['string'] = $object['settings']['title_value'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1156 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1157 #}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1158
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1159
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1160 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1161 * @file
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1162 * implementation of Feeds mapping API for link.module.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1163 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1164
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1165 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1166 * Implements hook_feeds_processor_targets_alter().
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1167 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1168 * @see FeedsProcessor::getMappingTargets()
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1169 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1170 /*
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1171 function openmindattribute_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1172
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1173 foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1174 $info = field_info_field($name);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1175
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1176 if ($info['type'] == 'openmindattribute_field') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1177 if (array_key_exists('name', $info['columns'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1178 $targets[$name . ':name'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1179 'name' => t('@name: name', array('@name' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1180 'callback' => 'openmindattribute_feeds_set_target',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1181 'description' => t('The @label field of the entity.', array('@label' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1182 'real_target' => $name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1183 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1184 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1185 if (array_key_exists('ov', $info['columns'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1186 $targets[$name . ':ov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1187 'name' => t('@name: OV', array('@name' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1188 'callback' => 'openmindattribute_feeds_set_target',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1189 'description' => t('The @label field of the entity.', array('@label' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1190 'real_target' => $name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1191 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1192 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1193 if (array_key_exists('ov', $info['columns'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1194 $targets[$name . ':nov'] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1195 'name' => t('@name: NOV', array('@name' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1196 'callback' => 'openmindattribute_feeds_set_target',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1197 'description' => t('The @label field of the entity.', array('@label' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1198 'real_target' => $name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1199 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1200 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1201 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1202 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1203 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1204 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1205
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1206 function openmindattribute_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1207
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1208 foreach (field_info_instances($entity_type, $bundle_name) as $name => $instance) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1209 $info = field_info_field($name);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1210 #map the whole attr
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1211
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1212 if ($info['type'] == 'openmindattribute_field') {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1213 $targets[$name] = array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1214 'name' => t('@name', array('@name' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1215 'callback' => 'openmindattribute_feeds_set_target',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1216 'description' => t('The @label field of the entity.', array('@label' => $instance['label'])),
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1217 'real_target' => $name,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1218 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1219 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1220
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1221
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1222 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1223 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1224
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1225
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1226
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1227 /**
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1228 * Callback for mapping. Here is where the actual mapping happens.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1229 *
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1230 * When the callback is invoked, $target contains the name of the field the
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1231 * user has decided to map to and $value contains the value of the feed item
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1232 * element the user has picked as a source.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1233 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1234 /*
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1235 function openmindattribute_feeds_set_target($source, $entity, $target, $value) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1236 if (empty($value)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1237 return;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1238 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1239
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1240 // Handle non-multiple value fields.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1241 if (!is_array($value)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1242 $value = array($value);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1243 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1244
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1245 // Iterate over all values.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1246 list($field_name, $column) = explode(':', $target);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1247 $info = field_info_field($field_name);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1248
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1249 $field = isset($entity->$field_name) ? $entity->$field_name : array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1250 $delta = 0;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1251
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1252 foreach ($value as $v) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1253 if ($info['cardinality'] == $delta) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1254 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1255 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1256
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1257 if (is_object($v) && ($v instanceof FeedsElement)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1258 $v = $v->getValue();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1259 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1260
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1261 if (is_scalar($v)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1262 $field['und'][$delta][$column] = $v;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1263 $delta++;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1264 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1265 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1266 $entity->$field_name = $field;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1267 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1268 */
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1269
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1270 function openmindattribute_feeds_set_target($source, $entity, $target, $value) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1271
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1272 if (empty($value)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1273 return;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1274 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1275
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1276 // Handle non-multiple value fields.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1277 if (!is_array($value)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1278 $value = array($value);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1279 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1280
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1281 // Iterate over all values.
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1282 #list($field_name, $column) = explode(':', $target);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1283
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1284 $field_name=$target;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1285 $info = field_info_field($field_name);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1286
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1287 $field = isset($entity->$field_name) ? $entity->$field_name : array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1288 $delta = 0;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1289
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1290
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1291 foreach ($value as $v) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1292
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1293
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1294 if ($info['cardinality'] == $delta) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1295 break;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1296 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1297
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1298 if (is_object($v) && ($v instanceof FeedsElement)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1299 $v = $v->getValue();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1300 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1301
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1302 if (is_scalar($v)) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1303 $field['und'][$delta] = $v;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1304 $delta++;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1305 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1306
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1307 if (is_array($v)){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1308 $newVal = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1309 $newVal['ov'] = $v['ov'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1310 $newVal['nov'] = $v['nov'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1311 $newVal['name'] = $v['name'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1312 $newVal['romanization'] = $v['romanization'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1313 $field['und'][$delta]= $newVal;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1314 $delta++;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1315
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1316 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1317 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1318 $entity->$field_name = $field;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1319 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1320
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1321
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1322 function openmindattribute_addIDs(){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1323 #adds the author id from openmind to the biographies and umgekehrt
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1324 $query = new EntityFieldQuery();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1325
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1326 $query->entityCondition('entity_type', 'node')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1327 ->entityCondition('bundle', 'openmind_entity')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1328 ->propertyCondition('status', 1)
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1329 ->fieldCondition('field_oc', 'tid', '1', '='); #1 is PERSON #TODO should search for PERSON and not the id
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1330
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1331 $result = $query->execute();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1332
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1333
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1334 if (isset($result['node'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1335 $persons_nids = array_keys($result['node']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1336 $persons = entity_load('node', $persons_nids);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1337
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1338
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1339 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1340
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1341 #hole mapping bea url -> id
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1342
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1343 $beamapping=array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1344 $beamappingNodeId=array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1345 foreach ($persons as $person){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1346
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1347 $attrs = $person->field_attribute['und'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1348
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1349
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1350 $mappedattrs = _openmindattribute_field_remap($attrs);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1351
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1352 if (isset($mappedattrs['url'])){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1353
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1354 $url = $mappedattrs['url']['ov'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1355
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1356 $exploded = explode("/", $url);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1357
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1358 #urls haben die Form http://islamsci.mcgill.ca/rasi/bea/tusi_bea.htm
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1359 #mich interessiert nur das ende ohne htm
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1360
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1361 dpm($exploded);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1362 $ident = $exploded[count($exploded)-1];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1363 dpm($ident);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1364 $ident = strtolower(str_replace(".htm", "", $ident));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1365
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1366 dpm($ident);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1367 $beamapping[$ident]=$person->field_id['und'][0]['value'];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1368 //$beamappingNodeId[$ident]=$person->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1369 $beamappingNodeId[$ident][]=$person->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1370 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1371
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1372 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1373
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1374 #hole jetzt alle biographien
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1375
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1376 $query = new EntityFieldQuery();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1377
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1378 $query->entityCondition('entity_type', 'node')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1379 ->entityCondition('bundle', 'biography');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1380
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1381
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1382 $result = $query->execute();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1383
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1384
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1385 if (isset($result['node'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1386 $bios_nids = array_keys($result['node']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1387 $bios = entity_load('node', $bios_nids);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1388
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1389 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1390
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1391 foreach ($bios as $bio){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1392 $url = strtolower(drupal_get_path_alias("node/" . $bio->nid));
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1393
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1394 dpm($url);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1395
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1396 if (isset ($beamapping[$url])){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1397 $authorid = $beamapping[$url];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1398
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1399 $bio->field_id['und'][0]['value']=$authorid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1400
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1401
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1402
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1403
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1404 node_save($bio);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1405
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1406 dpm($url . " -->" . $authorid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1407
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1408 dpm($bio);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1409
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1410
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1411 foreach ($beamappingNodeId[$url] as $entNid){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1412 //$entNid = $beamappingNodeId[$url];
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1413
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1414 $ent = entity_load_single("node", $entNid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1415
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1416 $ent->field_bio_id['und'][0]['value']=$bio->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1417 $ent->field_bio_id_reference['und'][0]['nid']=$bio->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1418 dpm($ent);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1419 dpm($ent->nid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1420 node_save($ent);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1421 }}
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1422
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1423 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1424
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1425
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1426 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1427
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1428 function openmindattribute_addIDbibliographieID(){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1429 #adds the add bibliographie
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1430 $query = new EntityFieldQuery();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1431
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1432 $query->entityCondition('entity_type', 'node')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1433 ->entityCondition('bundle', 'openmind_entity')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1434 ->propertyCondition('status', 1)
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1435 ->fieldCondition('field_oc', 'tid', '10', '='); #10 is reference #TODO should search for REFERENCE nd not the id
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1436
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1437 $result = $query->execute();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1438
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1439
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1440 if (isset($result['node'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1441 $reference_nids = array_keys($result['node']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1442 $references = entity_load('node', $reference_nids);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1443
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1444 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1445
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1446 foreach ($references as $reference){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1447 #{King, 1983 #1290} References haben diese Titel
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1448 # Hole die Nummer
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1449
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1450 $exploded = explode("#", $reference->title);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1451 $number = str_replace("}", "", $exploded[1]);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1452
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1453
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1454 #suche jetzt in biblios nach der Nummer "=feld Custom 3"
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1455
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1456 $query = db_select('node', 'n');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1457 $query->addField('n', 'nid');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1458 $query->leftJoin('biblio', 'b', 'n.vid=b.vid');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1459
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1460 $query->addField('b', 'biblio_custom3');
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1461 $query->condition("b.biblio_custom3", $number);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1462
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1463 $results=$query->execute();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1464
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1465 foreach ($results as $node){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1466 $nid= $node->nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1467 $ent = entity_load_single("node", $nid);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1468 dpm($reference);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1469 $reference->field_biblio_reference['und'][0]['nid']=$nid;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1470 node_submit($reference);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1471 node_save($reference);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1472 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1473
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1474
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1475 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1476 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1477
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1478
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1479 function _openmindattribute_collection_list($name,&$form){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1480 $query = new EntityFieldQuery();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1481
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1482 $query->entityCondition('entity_type', 'node')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1483 ->entityCondition('bundle', 'openmind_entity')
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1484 ->propertyCondition('status', 1)
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1485 ->fieldCondition('field_oc', 'tid', '8', '='); #8 is COLLECTION #TODO should search for COLLECTION and not the id
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1486
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1487 $result = $query->execute();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1488
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1489 $options = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1490
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1491 if (isset($result['node'])) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1492 $cols_nids = array_keys($result['node']);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1493 $cols = entity_load('node', $cols_nids);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1494
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1495
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1496 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1497
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1498
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1499 $options['']='All';
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1500
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1501 $titel = array();
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1502
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1503 foreach ($cols as $col){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1504 $titel[]=$col->title;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1505 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1506
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1507 sort($title);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1508
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1509 foreach($title as $t){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1510 $options[$t]=$t;
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1511 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1512
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1513
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1514 $form[$name]=array(
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1515 '#type' => 'radios',
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1516 '#options' => $options,
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1517 '#default_value' => ''
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1518 );
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1519 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1520
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1521 function openmindattribute_form_views_exposed_form_alter(&$form, $form_state, $form_id) {
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1522
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1523
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1524 if($form["#id"]=="views-exposed-form-codices-page-codices"){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1525 _openmindattribute_collection_list("title",$form);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1526
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1527
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1528 } elseif ($form["#id"]=="views-exposed-form-codices-page-2"){
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1529
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1530 _openmindattribute_collection_list("title_1",$form);
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1531 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1532
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1533 }
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1534
124ef8f3b22d initial
Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de>
parents:
diff changeset
1535