Project

General

Profile

« Previous | Next » 

Revision 330c9553

Added by Andreas Kohlbecker about 13 years ago

fixing status rendering

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.name.theme
440 440
		if(array_setr('status', true, $renderTemplate)){
441 441
			if(isset($taxonName->status[0])){
442 442
				foreach($taxonName->status as $status){
443
					$statusHtml .= ', '.$status->type->representation_L10n;
443
					$statusHtml .= ', '.$status->type->representation_L10n_abbreviated;
444 444
				}
445 445
			}
446 446
			array_setr('status', ' <span class="nomenclatural_status">'.$statusHtml.'</span>', $renderTemplate);
modules/cdm_dataportal/theme/cdm_dataportal.page.theme
156 156
  	}
157 157

  
158 158
  	// get the image gallery as configured by the admin
159
  	$taxon_image_gallery = call_user_func_array(
160
	    'taxon_image_gallery_' . variable_get('image_gallery_viewer', 'default'),
159
  	$taxon_image_gallery = call_user_func_array( 'taxon_image_gallery_' . variable_get('image_gallery_viewer', 'default'),
161 160
  	array($taxon, $media));
162 161
  	$out .= $taxon_image_gallery;
163 162

  
modules/cdm_dataportal/theme/cdm_dataportal.taxon.theme
193 193
	// $table_of_accepted = cdm_ws_property(CDM_WS_PORTAL_TAXON_ACCEPTED, join(',', $synonym_uuids));
194 194
	// thus ...
195 195
	$table_of_accepted = array();
196
	
196

  
197 197
	foreach($synonym_uuids as $synUuid){
198 198
		$table_of_accepted[$synUuid] = cdm_ws_get(CDM_WS_PORTAL_TAXON_ACCEPTED, array($synUuid, $classification_uuid));
199 199
	}
......
203 203
	foreach($records as $taxon){
204 204
		// its a Taxon
205 205
		if($taxon->class == "Taxon"){
206
			$taxonUri = url(path_to_taxon($taxon->uuid)); 
206
			$taxonUri = url(path_to_taxon($taxon->uuid));
207 207
			if(isset($taxon->name->nomenclaturalReference)){
208 208
				$referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
209 209
			}
......
278 278
		default :
279 279
			$relsign = $relsign_invalid;
280 280
	}
281

  
282
	$status = $taxon->name->status[0]->type->representation_L10n;
283
	//if ($status == 'Invalid' || $status == 'Nudum'){
284
	if (sizeof($status) > 0){
285
		if ($status == 'Invalid' || $status == 'Nudum'){
286
			$relsign = $relsign_invalid;
281
	/*
282
	 * names with status invalid or nudum are to be displayed with the $relsign_invalid,
283
	 * these names appear at the end of all names in their homotypic group
284
	 * (ordered correctly by the java cdm_lib)
285
	 */
286
	if ( is_array($taxon->name->status)) {
287
		foreach($taxon->name->status as $status){
288
			if ($status->type->uuid == UUID_NOMENCLATURALSTATUS_TYPE_INVALID || $status->type->uuid == UUID_NOMENCLATURALSTATUS_TYPE_NUDUM){
289
				$relsign = $relsign_invalid;
290
			}
287 291
		}
288
		$status = ', ' . $taxon->name->status[0]->type->representation_L10n_abbreviated;
289
		//var_dump('&mdash' . $taxon->name->status[0]->type->representation_L10n_abbreviated);
290 292
	}
291 293

  
294
	// now rendering starts ..
295

  
292 296
	RenderHints::pushToRenderStack('related_taxon');
293 297

  
294 298
	//$taxonUri = url(path_to_taxon($taxon->uuid));
......
303 307
	$nameHtml .= theme('cdm_annotations_as_footnotekeys', $special_annotations_array);
304 308

  
305 309
	//later homonym or trated as later homonym AND bloking names
306
	$from_name_rels = cdm_ws_get(CDM_WS_PORTAL_TAXON_FROM_NAMERELATIONS, $taxon->uuid);
307
	$to_name_rels = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
310
	$from_name_relations = cdm_ws_get(CDM_WS_PORTAL_TAXON_FROM_NAMERELATIONS, $taxon->uuid);
311
	$to_name_relations = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
308 312
	//first the FROM RELS
309
	if ($from_name_rels){
310
		foreach($from_name_rels as $element){
313
	if ($from_name_relations){
314
		foreach($from_name_relations as $element){
311 315
			switch ($element->type->representation_L10n){
312 316
				case 'later homonym for':
313
					if(isset($rels_out)){
314
						$rels_out .= ' nec ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
317
					if(isset($name_relations_html)){
318
						$name_relations_html .= ' nec ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
315 319
						    'cdm_dataportal/name/' . $element->toName->uuid . '/' . $taxon->uuid . '/' . $element->toName->taxonBases[0]->uuid);
316 320
					}else{
317
						$rels_out = ' non ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
321
						$name_relations_html = ' non ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
318 322
                        'cdm_dataportal/name/' . $element->toName->uuid . '/' . $taxon->uuid . '/' . $element->toName->taxonBases[0]->uuid)
319 323
						. ' ' . $element->toName->datePublished->start;
320 324
					}
321 325
					break;
322 326
				case 'treated as later homonym for':
323
					if(isset($rels_out)){
324
						$rels_out = ' nec ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
327
					if(isset($name_relations_html)){
328
						$name_relations_html = ' nec ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
325 329
                              'cdm_dataportal/name/' . $element->toName->uuid);
326 330
					}else{
327
						$rels_out = ' non ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
331
						$name_relations_html = ' non ' . l($element->toName->titleCache . ' ' .  substr($element->toName->nomenclaturalReference->datePublished->start, 0, 4),
328 332
					                   'cdm_dataportal/name/' . $element->toName->uuid);
329 333
					}
330 334
					break;
331 335
			}
332 336
		}
333 337
		//second the TO RELS
334
		if ($to_name_rels){
335
			foreach($to_name_rels as $element){
338
		if ($to_name_relations){
339
			foreach($to_name_relations as $element){
336 340
				switch ($element->type->representation_L10n){
337 341
					case 'blocking name for':
338
						if(isset($rels_out) ){
339
							$rels_out .= ' nec ' . l($element->fromName->titleCache . ' ' .  substr($element->fromName->nomenclaturalReference->datePublished->start, 0, 4),
342
						if(isset($name_relations_html) ){
343
							$name_relations_html .= ' nec ' . l($element->fromName->titleCache . ' ' .  substr($element->fromName->nomenclaturalReference->datePublished->start, 0, 4),
340 344
                'cdm_dataportal/name/' . $element->fromName->uuid . '/' . $taxon->uuid . '/' . $element->fromName->taxonBases[0]->uuid);
341 345
						}else{
342
							$rels_out = ' non ' . l($element->fromName->titleCache . ' ' .  substr($element->fromName->nomenclaturalReference->datePublished->start, 0, 4),
346
							$name_relations_html = ' non ' . l($element->fromName->titleCache . ' ' .  substr($element->fromName->nomenclaturalReference->datePublished->start, 0, 4),
343 347
                        'cdm_dataportal/name/' . $element->fromName->uuid . '/' . $taxon->uuid . '/' . $element->fromName->taxonBases[0]->uuid)
344 348
							. ' ' . $element->fromName->datePublished->start;
345 349
						}
......
348 352
			}
349 353
		}
350 354
    //rels output
351
		if(isset($rels_out)){
352
			$rels_out = '['. $rels_out .']';
355
		if(isset($name_relations_html)){
356
			$name_relations_html = '['. $name_relations_html .']';
353 357
		}
354 358
	}
355 359
  //geneal output
356
	$out = '<span class="relation_sign">'.$relsign.'</span>'.$name_prefix . $nameHtml . $name_postfix . $rels_out . $status;
360
	$out = '<span class="relation_sign">'.$relsign.'</span>'.$name_prefix . $nameHtml . $name_postfix . $name_relations_html;
357 361
	$out = uuid_anchor($taxon->uuid, $out);
358 362

  
359 363
	RenderHints::popFromRenderStack();

Also available in: Unified diff