Project

General

Profile

« Previous | Next » 

Revision 80e0aa8e

Added by Andreas Kohlbecker almost 14 years ago

improved general render mechanism + footnotes

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.taxon.theme
109 109
	return $out;
110 110
}
111 111

  
112
function theme_cdm_acceptedFor($renderPath = false){
112
function theme_cdm_acceptedFor(){
113
	RenderHints::pushToRenderStack('acceptedFor');
114
		
113 115
	$out = '';
114
	if(!$renderPath){
115
		$renderPath = 'acceptedFor';
116
	}
117 116
	if(isset($_REQUEST['acceptedFor'])){
118 117
			
119
		$synonym = cdm_ws_get(CDM_WS_TAXON, $_REQUEST['acceptedFor']);
118
		$synonym = cdm_ws_get(CDM_WS_PORTAL_TAXON, $_REQUEST['acceptedFor']);
120 119
			
121 120
		if($synonym){
122 121
			$out .= '<span class="acceptedFor">';
......
124 123
			if(isset($synonym->name->nomenclaturalReference)){
125 124
				$referenceUri = url(path_to_reference($synonym->name->nomenclaturalReference->uuid));
126 125
			}
127
			$out .= theme('cdm_taxonName', $synonym->name, null, $referenceUri, $renderPath);
126
			$out .= theme('cdm_taxonName', $synonym->name, null, $referenceUri);
128 127
			$out .= '</span>';
129 128
		}
130 129
	}
131

  
130
    RenderHints::popFromRenderStack();
132 131
	return $out;
133 132
}
134 133

  
135 134
function theme_cdm_list_of_taxa($records, $showMedia = false){
136 135

  
137
	$renderPath = 'list_of_taxa';
136
	RenderHints::pushToRenderStack('list_of_taxa');
138 137

  
139 138
	$showMedia_taxa = variable_get('cdm_dataportal_findtaxa_show_taxon_thumbnails', 1);
140 139
	$showMedia_synonyms = variable_get('cdm_dataportal_findtaxa_show_synonym_thumbnails', 0);
......
149 148
		}
150 149
	}
151 150
	// batch service not jet implemented:
152
	// $table_of_accepted = cdm_ws_property(CDM_WS_TAXON_ACCEPTED, join(',', $synonym_uuids));
151
	// $table_of_accepted = cdm_ws_property(CDM_WS_PORTAL_TAXON_ACCEPTED, join(',', $synonym_uuids));
153 152
	// thus ...
154 153
	$table_of_accepted = array();
155 154
	foreach($synonym_uuids as $synUuid){
156
		$table_of_accepted[$synUuid] = cdm_ws_get(CDM_WS_TAXON_ACCEPTED, $synUuid);
155
		$table_of_accepted[$synUuid] = cdm_ws_get(CDM_WS_PORTAL_TAXON_ACCEPTED, $synUuid);
157 156
	}
158 157

  
159 158
	$out = '<ul class="cdm_names" style="background-image: none;">';
......
165 164
			if(isset($taxon->name->nomenclaturalReference)){
166 165
				$referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
167 166
			}
168
			$out .= '<li class="Taxon">'.theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, $renderPath);
167
			$out .= '<li class="Taxon">'.theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri);
169 168
			if($showMedia_taxa){
170 169
				$out .= theme('cdm_taxon_list_thumbnails', $taxon);
171 170
			}
......
180 179
				if(isset($acceptedTaxon->name->nomenclaturalReference)){
181 180
					$referenceUri = url(path_to_reference($acceptedTaxon->name->nomenclaturalReference->uuid));
182 181
				}
183
				$out .= '<li class="Synonym">'.theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, $renderPath);
182
				$out .= '<li class="Synonym">'.theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri);
184 183
				if($showMedia_synonyms){
185 184
					$out .= theme('cdm_taxon_list_thumbnails', $acceptedTaxon);
186 185
				}
......
188 187
			} else {
189 188
				//TODO avoid using Ajax in the cdm_dynabox
190 189
				//TODO add media
191
				$out .= theme('cdm_dynabox', theme('cdm_taxonName', $taxon->name, null, null, $renderPath), cdm_compose_url(CDM_WS_TAXON_ACCEPTED, array($taxon->uuid)), 'cdm_list_of_taxa');
190
				$out .= theme('cdm_dynabox', theme('cdm_taxonName', $taxon->name, null, null), cdm_compose_url(CDM_WS_PORTAL_TAXON_ACCEPTED, array($taxon->uuid)), 'cdm_list_of_taxa');
192 191
			}
193 192
		}
194 193
	}
195 194
	$out .= '</ul>';
195
	RenderHints::popFromRenderStack();
196 196
	return $out;
197 197
}
198 198

  
199 199

  
200
function theme_cdm_related_taxon($taxon, $reltype_uuid = '', $displayNomRef = true){
200
function theme_cdm_related_taxon($taxon, $reltype_uuid = false){
201 201

  
202 202
	$relsign = '';
203 203
	$name_prefix = '';
......
220 220
			$relsign = '&ndash;';
221 221
	}
222 222

  
223
	$renderPath = 'related_taxon';
223
	 RenderHints::pushToRenderStack('related_taxon');
224 224

  
225 225
	//$taxonUri = url(path_to_taxon($taxon->uuid));
226 226
	if($taxon->name->nomenclaturalReference){
227 227
		$referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
228 228
	}
229
	$nameHtml = theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri, $renderPath);
229
	$nameHtml = theme('cdm_taxonName', $taxon->name, $taxonUri, $referenceUri);
230 230

  
231 231
	$out = '<span class="relation_sign">'.$relsign.'</span>'.$name_prefix . $nameHtml . $name_postfix;
232 232
	
......
257 257
	$galleryLinkUri = path_to_taxon($taxon->uuid).'/images';
258 258
	$selectShowMedia = variable_get('cdm_dataportal_show_media', 0);
259 259
	if ($selectShowMedia == 0){
260
		$mediaList = cdm_ws_get(CDM_WS_TAXON_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
260
		$mediaList = cdm_ws_get(CDM_WS_PORTAL_TAXON_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
261 261
	}else{
262
		$mediaList = cdm_ws_get(CDM_WS_TAXON_SUBTREE_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
262
		$mediaList = cdm_ws_get(CDM_WS_PORTAL_TAXON_SUBTREE_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
263 263
	}
264
	//$mediaList = cdm_ws_get(CDM_WS_TAXONOMY_MEDIA, array(variable_get('cdm_taxonomictree_uuid', false), $taxon ->rank, $taxon->uuid ));
264
	//$mediaList = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_MEDIA, array(variable_get('cdm_taxonomictree_uuid', false), $taxon ->rank, $taxon->uuid ));
265 265
	$out .= theme('cdm_media_gallerie', $mediaList, $gallery_name ,
266 266
					$gallery_settings['cdm_dataportal_media_maxextend'], 
267 267
	             	$gallery_settings['cdm_dataportal_media_cols'], 

Also available in: Unified diff