Project

General

Profile

Revision b5e773ef

IDb5e773ef2f11d24f655945abc62e52c8cda26744
Parent 15f11e83
Child e48b96fe

Added by Andreas Kohlbecker over 10 years ago

#392 CICHORIEAE display notes & #1483 references for distributions as footnotes

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
42 42
	if(!$mergedTrees){
43 43
		return;
44 44
	}
45

  
46 45
	foreach($mergedTrees as &$mTree){
47 46
		//TODO diplay title and reference in case of multiple $mergedTrees -> theme
48 47
		$out .= theme('cdm_feature_nodes', $mTree->root->children, $taxon);
......
75 74

  
76 75
function theme_cdm_feature_nodes($featureNodes, $taxon){
77 76

  
77
	RenderHints::pushToRenderStack('feature_nodes');
78 78
	$gallery_settings = getGallerySettings(CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME);
79 79
	
80 80
	foreach($featureNodes as $node){
......
111 111
				if($node->feature->uuid == UUID_DISTRIBUTION){
112 112
					$out .= theme('cdm_descriptionElements_distribution', $taxon);
113 113
				}
114
				
115
			    $out .= theme('cdm_footnotes', $node->feature->uuid);
116
			    $out .= theme('cdm_annotation_footnotes', $node->feature->uuid);
114 117
			}
115 118
		}
116 119
		// theme
......
120 123
			$out .= '</div>';
121 124
		}
122 125
	}
126
	RenderHints::popFromRenderStack();
123 127
	return $out;
124 128
}
125 129

  
......
165 169
  if(strlen($sourceRefs) > 0){
166 170
    $sourceRefs = '<span class="sources">' . $sourceRefs . '</span>';
167 171
  }
168
/*  
169
          $out = l('<span class="reference">'.$reference.'</span>'
170
          , path_to_reference($descriptionElementSource->citation->uuid)
171
          , array("class"=>"reference")
172
          , NULL, NULL, FALSE ,TRUE);
173
*/  
172
 
174 173
  if ($source->nameUsedInSource->uuid){ //do a link to name page
175 174
    $name_used_in_source_link_to_show = l($source->nameUsedInSource->titleCache,
176 175
                                           path_to_name($source->nameUsedInSource->uuid), 
......
192 191
  }
193 192
  
194 193
  // add annotations as footnote key
195
  $out .= theme('cdm_annotations', $element);
194
  $out .= theme('cdm_annotations_as_footnotekeys', $element);
196 195
  return $out;
197 196
}
198 197

  
......
242 241
	$feature = $descriptionElement->feature;
243 242
	$out = theme('cdm_descriptionElementArray', $outArray, $feature, $glue, $sortOutArray, $enclosingHtml);
244 243
	
245
	$out .= '<div class="footnote_list">'. FootnoteManager::renderFootnoteList($featureUuid) . '</div>';
246
		
247 244
    RenderHints::popFromRenderStack();
248 245
    
249 246
	return $out;
......
257 254
function theme_cdm_descriptionElementDistribution($descriptionElements){
258 255

  
259 256
	$out = '';
260
	$separator = ', ';
261

  
257
	$separator = ',';
258
    RenderHints::pushToRenderStack('descriptionElementDistribution');
259
	RenderHints::setFootnoteListKey(UUID_DISTRIBUTION);
262 260
	foreach($descriptionElements as $descriptionElement){
263
		//$footnoteKey = FootnoteManager::addNewFootnote($descriptionElement->feature->uuid, $descriptionElement->area->representation_L10n);
264
//		$footnoteKeyList = '';
265
//		foreach($descriptionElement->sources as $source){
266
//			$footnoteKey = FootnoteManager::addNewFootnote($descriptionElement->feature->uuid, theme('cdm_DescriptionElementSource', $source));
267
//			$footnoteKeyList .= theme('cdm_footnode_key', $footnoteKey) . ' ';
268
//		}
269
	    $out .= $descriptionElement->area->representation_L10n . $footnoteKeyList . $separator;
261
		// annotations as footnotes
262
		$annotationFootnoteKeys = theme('cdm_annotations_as_footnotekeys', $descriptionElement);
263
		// source references as footnotes
264
		$sourcesFootnoteKeyList = '';
265
		foreach($descriptionElement->sources as $source){
266
			$_fkey = FootnoteManager::addNewFootnote(UUID_DISTRIBUTION, theme('cdm_DescriptionElementSource', $source, false));
267
			$sourcesFootnoteKeyList .= theme('cdm_footnote_key', $_fkey, UUID_DISTRIBUTION, ($sourcesFootnoteKeyList ? $separator : ''));
268
		}
269
		if($annotationFootnoteKeys && $sourcesFootnoteKeyList){
270
			$annotationFootnoteKeys .= $separator;
271
		}
272
	    $out .= $descriptionElement->area->representation_L10n . $annotationFootnoteKeys . $sourcesFootnoteKeyList . ' ';
270 273
	}
274
	
275
	
271 276
	$out = substr($out, 0, strlen($out)-strlen($separator) );
272 277
	
273 278
	$taxonTrees =  cdm_ws_get(CDM_WS_PORTAL_TAXONOMY);
......
278 283
		}
279 284
	}
280 285

  
281
//  $referenceCitation = l('<span class="reference">('.$reference->title.')</span>', path_to_reference($reference->uuid), array("class"=>"reference"), NULL, NULL, FALSE ,TRUE);
282
//	if($descriptions && strlen($descriptions) > 0 ){
283
//		$sourceRefs .= ' '.$referenceCitation;
284
//	}
285

  
286
    RenderHints::popFromRenderStack();
286 287
	return $out;
287 288

  
288 289
}
......
290 291

  
291 292
function theme_cdm_DescriptionElementSource($descriptionElementSource, $doLink = TRUE){
292 293

  
293
    $out = theme('cdm_reference', $descriptionElementSource->citation, $descriptionElementSource->citationMicroReference, TRUE);
294
      
294
    $out = theme('cdm_reference', $descriptionElementSource->citation, $descriptionElementSource->citationMicroReference, $doLink);
295
    
295 296
	// add annotations as footnote key
296
    $out .= theme('cdm_annotations', $descriptionElementSource->citation);
297
    $out .= theme('cdm_annotations_as_footnotekeys', $descriptionElementSource->citation);
297 298
    return $out;
298 299
}
299 300

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)