Project

General

Profile

« Previous | Next » 

Revision aa582de0

Added by Andreas Kohlbecker almost 14 years ago

now using DerivedUnitFacade

View differences:

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