Project

General

Profile

« Previous | Next » 

Revision aa582de0

Added by Andreas Kohlbecker almost 14 years ago

now using DerivedUnitFacade

View differences:

modules/cdm_dataportal/cdm_api/webservice_uris.php
99 99
define('CDM_WS_FEATURETREES', 'featuretree');
100 100

  
101 101
define('CDM_WS_GEOSERVICE_DISTRIBUTIONMAP', 'geo/map/distribution/$0');
102

  
103
define('CDM_WS_DERIVEDUNIT_FACADE', 'derivedunitfacade/$0');
modules/cdm_dataportal/theme/cdm_dataportal.name.theme
20 20

  
21 21
	$specimenTypeDesignations = array();
22 22
	foreach($typeDesignations as $typeDesignation){
23
		
23 24
		if($typeDesignation->class == 'SpecimenTypeDesignation'){
24 25
			// SpecimenTypeDesignations should be ordered. collect theme here only
26
			
27
			
25 28
			$specimenTypeDesignations[] = $typeDesignation;
26 29
		}else {
27 30

  
......
36 39
					$referenceUri = url(path_to_reference($typeDesignation->typeName->nomenclaturalReference->uuid));
37 40
				}
38 41
				$out .= theme('cdm_taxonName', $typeDesignation->typeName, $link_to_name_page, $referenceUri);
39

  
40
				//        if($typeDesignation->typeName->class == 'ZoologicalName') {
41
				//          // appending authorTeam which has been skipped in cdm_name
42
				//          $authorTeam = cdm_taggedtext_value($typeDesignation->typeName->taggedName, 'authors');
43
				//          $authorTeamPart = l('<span class="authors">'.$authorTeam.'</span>', "/cdm_dataportal/reference/".$typeDesignation->typeName->nomenclaturalReference->uuid, array(), NULL, NULL, FALSE, TRUE);
44
				//          $out .= (str_endsWith($authorTeam, ')') ? '' : ', ').$authorTeamPart;
45
				//        } else {
46
				//          $out .= ' '.theme('cdm_reference', $typeDesignation->citation, true, $referenceStyle);
47
				//          $out .= '</li>';
48
				//        }
49 42
			}
50 43
		}
51 44
	}
......
75 68
				$typeReference .= $shortCitation.'</span>';
76 69
				$typeReference .= ':'. $std->citationMicroReference .')';
77 70

  
78
			    $_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-lectotypes', $std->citation->titleCache);
71
			  $_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-lectotypes', $std->citation->titleCache);
79 72
				$typeReference .= theme('cdm_footnote_key', $_fkey2); 
80
        //$citation = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION, array($taxonName->nomenclaturalReference->uuid), "microReference=".urlencode($microreference));
81
        //$citation = $citation->String;
82
				
83

  
84
				//$typeReference .= '<span class="reference only-print">(designated by '.theme('cdm_reference',$std->citation ).')</span>';
85
			}
73
     	}
86 74

  
75
     	$derivedUnitFacadeInstance = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $std->typeSpecimen->uuid);
87 76
			
88 77
			$out .= '<li class="specimenTypeDesignation">';
89
			$out .= '<span class="status">'.(($std->typeStatus->representation_L10n) ? $std->typeStatus->representation_L10n : t('Type')) .$typeReference.'</span>: '.$std->typeSpecimen->titleCache;
90
			$out .= theme('cdm_specimen', $std->typeSpecimen);
78
			$out .= '<span class="status">'.(($std->typeStatus->representation_L10n) ? $std->typeStatus->representation_L10n : t('Type')) .$typeReference.'</span>: '.$derivedUnitFacadeInstance->titleCache;
79
			$out .= theme('cdm_specimen', $derivedUnitFacadeInstance);
91 80

  
92 81
			//footnotes for synonymy acronyms 
93
			$_fkey = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-acronyms', $std->typeSpecimen->collection->titleCache);
82
			$_fkey = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-acronyms', $derivedUnitFacadeInstance->collection->titleCache);
94 83
            $out .= theme('cdm_footnote_key', $_fkey);  
95 84
			$out .= '</li>';
96 85
			
......
214 203
	foreach($homotypicalGroup as $synonym){
215 204
		if($is_first_entry){
216 205
			$is_first_entry = false;
217
			//$typeDesignations = cdm_ws_get(CDM_WS_NAME_TYPEDESIGNATIONS, $synonym->name->uuid);
218
			$typeDesignations = cdm_ws_get(CDM_WS_PORTAL_TAXON_NAMETYPEDESIGNATIONS, $synonym->uuid);
206
			$typeDesignations = cdm_ws_get(CDM_WS_NAME_TYPEDESIGNATIONS, $synonym->name->uuid);
219 207
			// is first list entry
220 208
			$out .= '<li class="firstentry synonym">'.theme('cdm_related_taxon',$synonym, UUID_HETEROTYPIC_SYNONYM_OF).'</li>';
221 209
		} else {
......
259 247
		$out .= '<li class="synonym">'.theme('cdm_related_taxon', $synonym, UUID_HOMOTYPIC_SYNONYM_OF).'</li>';
260 248
	}
261 249

  
262
	$typeDesignations = cdm_ws_get(CDM_WS_PORTAL_TAXON_NAMETYPEDESIGNATIONS, $synonymList[0]->uuid);
250
	$typeDesignations = cdm_ws_get(CDM_WS_NAME_TYPEDESIGNATIONS, $synonymList[0]->name->uuid);
263 251
	if($typeDesignations){
264 252
		$out .= theme('cdm_typedesignations', $typeDesignations);
265 253
	}
modules/cdm_dataportal/theme/cdm_dataportal.occurrence.theme
10 10
* See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms.
11 11
*/
12 12

  
13
function theme_cdm_specimen($specimen){
13
/**
14
 * 
15
 * @param $specimenTypeDesignation
16
 * @return unknown_type
17
 */
18
function theme_cdm_specimen($specimenTypeDesignation){
14 19

  
15
	_add_js_thickbox();
20
	// _add_js_thickbox();
21
	
22
	if($specimenTypeDesignation->typeSpecimen){
23
		$derivedUnitFacade = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $specimenTypeDesignation->typeSpecimen->uuid);
24
		var_dump($derivedUnitFacade);
25
	}
16 26

  
17 27
	$out = '';
18
	if(isset($specimen->media[0])){
28
	if(isset($specimenTypeDesignation->media[0])){
19 29

  
20 30
		$image_url = drupal_get_path('module', 'cdm_dataportal').'/images/external_link.gif';
21 31
		// thickbox has problems reading the first url parameter, so a litte hack is needed here:
22 32
		// adding a meaningless patameter &tb_hack=1& ....
23
		$out .= '&nbsp;<a href="#TB_inline?tb_hack=1&width=300&amp;height=330&amp;inlineId=specimen_media_'.$specimen->uuid.'" class="thickbox">'
33
		$out .= '&nbsp;<a href="#TB_inline?tb_hack=1&width=300&amp;height=330&amp;inlineId=specimen_media_'.$specimenTypeDesignation->uuid.'" class="thickbox">'
24 34
		.'<img src="'.$image_url.'" title="'.t('Show media').'" /></a>';
25 35

  
26
		$out .= '<div id="specimen_media_'.$specimen->uuid.'" class="tickbox_content"><table>';
36
		$out .= '<div id="specimen_media_'.$specimenTypeDesignation->uuid.'" class="tickbox_content"><table>';
27 37

  
28 38
		$media_row = '<tr class="media_data">';
29 39
		$meta_row = '<tr class="meta_data">';
30 40

  
31
		foreach($specimen->media as $media){
41
		foreach($specimenTypeDesignation->media as $media){
32 42
			foreach($media->representations as $representation){
33 43

  
34 44
				//TODO this this is PART 2/2 of a HACK - select preferred representation by mimetype and size
......
61 71
							}
62 72
						}
63 73
						$media_row .= '<td><a href="'.$part->uri.'" target="'.$part->uuid.'">'.$a_child.'</a></td>';
64
						$meta_row .= '<td><span class="label">'.check_plain($specimen->titleCache).'</span><div class="webapp">'.$webapp.'</div></td>';
74
						$meta_row .= '<td><span class="label">'.check_plain($specimenTypeDesignation->titleCache).'</span><div class="webapp">'.$webapp.'</div></td>';
65 75
					} // END parts
66 76
					//TODO this is PART 2/2 of a hack
67 77
					break;

Also available in: Unified diff