Revision 8b3aa5d4
Added by Andreas Kohlbecker about 3 years ago
modules/cdm_dataportal/includes/common.inc | ||
---|---|---|
89 | 89 |
* @ingroup compose |
90 | 90 |
*/ |
91 | 91 |
function compose_cdm_marker($marker) { |
92 |
|
|
93 |
$render_array = array( |
|
94 |
// ---- generic |
|
95 |
// these entries should be common to all cdm enitiy render arrays |
|
96 |
'#theme' => 'cdm_marker', // TODO add alternative theme funcitons: 'cdm_marker_' . marker.type.label |
|
97 |
'#attributes' => array('class' => html_class_attribute_ref($marker)), |
|
98 |
|
|
99 |
// ---- individual |
|
100 |
'#label' => $marker->markerType->representation_L10n . ': ' . (($marker->flag !== TRUE ? t('yes') : t('no'))), |
|
101 |
); |
|
102 |
|
|
103 |
return $render_array; |
|
92 |
$label = $marker->markerType->representation_L10n . ': ' . (($marker->flag !== TRUE ? t('yes') : t('no'))); |
|
93 |
return markup_to_render_array('<span class="' . html_class_attribute_ref($marker) . '">' . $label . '</span>'); |
|
104 | 94 |
} |
105 | 95 |
|
106 | 96 |
/** |
modules/cdm_dataportal/theme/cdm_dataportal.common.theme | ||
---|---|---|
141 | 141 |
return $out; |
142 | 142 |
} |
143 | 143 |
|
144 |
|
|
145 |
|
|
146 |
/** |
|
147 |
* Theme function for CDM marker instances |
|
148 |
* |
|
149 |
* @see compose_cdm_marker(); |
|
150 |
* @param array $variables |
|
151 |
* - markerType_representation_l10n: the localized representation of the marker.markerType field |
|
152 |
*/ |
|
153 |
function theme_cdm_marker($variables) { |
|
154 |
$class_attribute = null; |
|
155 |
//TODO class attribute hacked?, use generic drupal way? |
|
156 |
if(isset($variables['attributes']['class'])){ |
|
157 |
$class_attribute = $variables['attributes']['class']; |
|
158 |
} |
|
159 |
return '<span class="' . $class_attribute . '">' . $variables['label'] . '</span>'; |
|
160 |
} |
|
161 |
|
|
162 | 144 |
/* ============================ pager ============================= */ |
163 | 145 |
|
164 | 146 |
/** |
modules/cdm_dataportal/theme/theme_registry.inc | ||
---|---|---|
37 | 37 |
'radio_options_suffix' => array('render element' => 'element'), |
38 | 38 |
|
39 | 39 |
// Themes in cdm_dataportal.common.theme. |
40 |
'cdm_marker' => array('variables' => array('label' => NULL, 'attributes' => NULL)), |
|
41 | 40 |
'cdm_pager' => array('variables' => array('pager' => NULL, 'path' => NULL, 'parameters' => NULL)), |
42 | 41 |
'cdm_pager_link' => array('variables' => array( |
43 | 42 |
'text' => NULL, |
Also available in: Unified diff
removing theme function for markers