Revision afc363df
Added by Andreas Kohlbecker over 11 years ago
modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
93 | 93 |
RenderHints::pushToRenderStack('feature_nodes'); |
94 | 94 |
$gallery_settings = getGallerySettings(CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME); |
95 | 95 |
|
96 |
foreach($mergedFeatureNodes as $node){
|
|
96 |
$media_list = array();
|
|
97 | 97 |
|
98 |
var_dump($node->feature->representation_L10n);
|
|
98 |
foreach($mergedFeatureNodes as $node){
|
|
99 | 99 |
|
100 | 100 |
// process $descriptionElements with content only |
101 | 101 |
if(is_array($node->descriptionElements) && count($node->descriptionElements) > 0 || count($node->children) > 0){ |
... | ... | |
103 | 103 |
$block->module = 'cdm_dataportal'; |
104 | 104 |
|
105 | 105 |
if($node->feature->uuid != UUID_IMAGE){ |
106 |
|
|
106 | 107 |
$block->delta = generalizeString($featureRepresentation); |
107 | 108 |
$block->subject = theme('cdm_feature_name', $featureRepresentation); |
108 | 109 |
$block->module = "cdm_dataportal-feature"; |
109 | 110 |
$block->content = ''; |
110 | 111 |
|
112 |
/* |
|
113 |
* Content/DISTRIBUTION |
|
114 |
*/ |
|
111 | 115 |
if($node->feature->uuid == UUID_DISTRIBUTION){ |
112 | 116 |
|
113 | 117 |
if(variable_get(DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP, 0)){ |
... | ... | |
130 | 134 |
$block->content .= theme('cdm_distribution_map', $taxon); |
131 | 135 |
} |
132 | 136 |
|
133 |
//get the text for the feature block |
|
134 |
if ($node->feature->uuid == UUID_COMMON_NAME){ |
|
137 |
/* |
|
138 |
* Content/COMMON_NAME |
|
139 |
*/ |
|
140 |
else if ($node->feature->uuid == UUID_COMMON_NAME){ |
|
135 | 141 |
$block->content .= theme('cdm_common_names', $node->descriptionElements); |
136 | 142 |
/* |
137 | 143 |
}else if($node->feature->uuid == UUID_IMAGE_SOURCES) { |
138 | 144 |
$block->content .= theme('cdm_image_sources', $node->descriptionElements); |
139 | 145 |
*/ |
140 |
} else { |
|
146 |
} |
|
147 |
|
|
148 |
/* |
|
149 |
* Content/ALL OTHER FEATURES |
|
150 |
*/ |
|
151 |
else { |
|
141 | 152 |
$block->content .= theme('cdm_descriptionElements', $node->descriptionElements, $node->feature->uuid, $taxon->uuid); |
153 |
|
|
154 |
/* |
|
155 |
* Content/ALL OTHER FEATURES/Subordinate Features |
|
156 |
* |
|
157 |
* subordinate features are printed inline in one floating text, |
|
158 |
* it is expected that supordinate features only "contain" TextData elements |
|
159 |
*/ |
|
160 |
// TODO move into own theme |
|
161 |
if(count($node->children) > 0){ |
|
162 |
|
|
163 |
//TODO support more than one level of childen http://dev.e-taxonomy.eu/trac/ticket/2393 |
|
164 |
$text = ''; |
|
165 |
foreach ($node->children as $child){ |
|
166 |
|
|
167 |
if (is_array($child->descriptionElements)){ |
|
168 |
foreach ($child->descriptionElements as $element) { |
|
169 |
|
|
170 |
if(is_array($element->media)){ |
|
171 |
// append media of supordinate emelents to list of main feature |
|
172 |
$media_list = array_merge($media_list, $element->media); |
|
173 |
} |
|
174 |
|
|
175 |
$description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text); |
|
176 |
//TODO use localized version of feature name, the locale must match the locale of the multilanguage text (http://dev.e-taxonomy.eu/trac/ticket/2394) |
|
177 |
$description = str_replace($element->feature->titleCache, '<em>' . $element->feature->titleCache . '</em>', $description); |
|
178 |
} |
|
179 |
$text .= " " . $description; |
|
180 |
$description = ''; |
|
181 |
} |
|
182 |
|
|
183 |
} |
|
184 |
$block->content .= $text; |
|
185 |
} |
|
186 |
|
|
142 | 187 |
} |
143 | 188 |
|
144 |
// get media for the feature block |
|
145 |
$media_list = cdm_dataportal_media_from_descriptionElements($node->descriptionElements); |
|
189 |
/* |
|
190 |
* Media/ALL FEATURES |
|
191 |
*/ |
|
192 |
$media_list = array_merge($media_list, cdm_dataportal_media_from_descriptionElements($node->descriptionElements)); |
|
146 | 193 |
$captionElements = array('title', 'rights'); |
147 | 194 |
|
148 | 195 |
$gallery = theme('cdm_media_gallerie', $media_list, CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME.'_'.$node->feature->uuid, |
... | ... | |
162 | 209 |
|
163 | 210 |
} |
164 | 211 |
} |
165 |
// theme |
|
166 |
if(count($node->children) > 0){ |
|
167 |
//TODO support more than one level of childen http://dev.e-taxonomy.eu/trac/ticket/2393 |
|
168 |
$text = ''; |
|
169 |
foreach ($node->children as $child){ |
|
170 |
//$out .= theme('cdm_descriptionElementTextData', $child->descriptionElements[0], false); |
|
171 |
if (is_array($child->descriptionElements)){//if condition added to avoid warnings |
|
172 |
foreach ($child->descriptionElements as $element) { |
|
173 |
$description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text); |
|
174 |
//TODO use localized version of feature name, the locale must match the locale of the multilanguage text (http://dev.e-taxonomy.eu/trac/ticket/2394) |
|
175 |
$description = str_replace($element->feature->titleCache, '<em>' . $element->feature->titleCache . '</em>', $description); |
|
176 |
} |
|
177 |
$text .= " " . $description; |
|
178 |
$description = ''; |
|
179 |
} |
|
180 |
} |
|
181 |
$out .= $text; |
|
182 |
} |
|
183 | 212 |
|
184 | 213 |
} |
185 | 214 |
RenderHints::popFromRenderStack(); |
Also available in: Unified diff
fixing #2519 (Make DescriptionElement Media visible in Data Portal)