Project

General

Profile

« Previous | Next » 

Revision 2d284a25

Added by Andreas Kohlbecker about 13 years ago

listing identificationKeys

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.page.theme
62 62
	$hideTabs = array();
63 63

  
64 64

  
65
	// get images
65
	// --- GET Images --- //
66 66
	$prefMimeTypeRegex = 'image:.*';
67 67
	$prefMediaQuality = '*';
68
	//$media =  cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_MEDIA, array(variable_get('cdm_taxonomictree_uuid', false),$taxon->uuid));
69

  
70

  
71 68
	$selectShowMedia = variable_get('cdm_dataportal_show_media', 0);
72 69
	if ($selectShowMedia == 0){
73 70
		$media = cdm_ws_get(CDM_WS_PORTAL_TAXON_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
74 71
	}else{
75 72
		$media = cdm_ws_get(CDM_WS_PORTAL_TAXON_SUBTREE_MEDIA, array($taxon->uuid, $prefMimeTypeRegex, $prefMediaQuality));
76 73
	}
77
	/*
78
	 if(!isset($mediaList[0])) {
79
	 $hideTabs[] = theme('cdm_taxonpage_tab', 'Images');
80
	 }
81
	 */
82

  
83 74
	if(!isset($media[0])) {
84 75
		$hideTabs[] = theme('cdm_taxonpage_tab', 'Images');
85 76
	}
77
	// hideImage flag depending on administative preset
78
	$hideImages = false;
79
	if(variable_get('image_hide_rank', '0') != '0'){
80
		$rankCompare = rank_compare($taxon->name->rank->uuid, variable_get('image_hide_rank', '-99'));
81
		$hideImages =  ($rankCompare > -1);
82
	}
86 83

  
84
	// --- GET specimensOrObersvations --- //
87 85
	$specimensOrObersvations = cdm_ws_get(CDM_WS_TAXON, array($taxon->uuid, 'specimensOrObersvations') );
88 86
	$specimensOrObersvationsCount = is_array($specimensOrObersvations) ? count($specimensOrObersvations) : 0;
89 87
	if($specimensOrObersvationsCount == 0) {
90 88
		$hideTabs[] = theme('cdm_taxonpage_tab', 'Specimens');
91 89
	}
92 90

  
93
	// hideImage flag depending on administative preset
94
	$hideImages = false;
95
	if(variable_get('image_hide_rank', '0') != '0'){
96
		$rankCompare = rank_compare($taxon->name->rank->uuid, variable_get('image_hide_rank', '-99'));
97
		$hideImages =  ($rankCompare > -1);
91
	// --- GET polytomousKeys --- //
92
	$polytomousKeysPager = cdm_ws_get(CDM_WS_POLYTOMOUSKEY, null, "findByTaxonomicScope=$taxon->uuid");
93
  $identificationKeyCount = 0;
94
	if($polytomousKeysPager){
95
	 $identificationKeyCount += $polytomousKeysPager->count;
96
	}
97
	if($identificationKeyCount == 0){
98
		$hideTabs[] = theme('cdm_taxonpage_tab', 'Keys');
98 99
	}
99
	// $hideTabs[] = theme('cdm_taxonpage_tab', 'General');
100
	// $hideTabs[] = theme('cdm_taxonpage_tab', 'Synonymy')
100
  // -------------------------------------------- //
101 101

  
102 102
	// hide tabs
103 103
	$tabhide_js = '';
......
116 116
  	$out .= theme('cdm_acceptedFor', 'page_general');
117 117
  }
118 118

  
119
  // --- DESCRIPTION --- //
119
  // --- PAGE PART: DESCRIPTION --- //
120 120
  if($page_part == 'description' || $page_part == 'all'){
121 121

  
122 122
  	$featureTree = cdm_ws_get(CDM_WS_FEATURETREE, variable_get(CDM_DATAPORTAL_DEFAULT_FEATURETREE_UUID, UUID_DEFAULT_FEATURETREE));
......
149 149
  	$out .= '</div>';
150 150
  }
151 151

  
152
  // --- IMAGES --- //
152
  // --- PAGE PART: IMAGES --- //
153 153
  if(!$hideImages && $page_part == 'images' || $page_part == 'all'){
154 154
  	$out .= '<div id="images">';
155 155
  	if($page_part == 'all'){
156 156
  		$out .= '<h2>'.t('Images').'</h2>';
157 157
  	}
158
  	
158

  
159 159
  	// get the image gallery as configured by the admin
160 160
  	$taxon_image_gallery = call_user_func_array( 'taxon_image_gallery_' . variable_get('image_gallery_viewer', 'default'),
161 161
  	     array($taxon, $media));
......
168 168
  	}
169 169
  }
170 170

  
171
  // --- SYNONYMY --- //
171
  // --- PAGE PART: SYNONYMY --- //
172 172
  if($page_part == 'synonymy' || $page_part == 'all'){
173 173
  	$out .= '<div id="synonymy">';
174 174
  	if($page_part == 'all'){
......
180 180
  	$out .= '</div>';
181 181
  }
182 182

  
183
  // --- SPECIMENS --- //
183
  // --- PAGE PART: SPECIMENS --- //
184 184
  if($specimensOrObersvationsCount > 0 && ($page_part == 'specimens' || $page_part == 'all') ){
185 185
  	$out .= '<div id="specimens">';
186 186
  	if($page_part == 'all'){
......
189 189
  	$out .= theme('cdm_taxon_page_specimens', $taxon);
190 190
  	$out .= '</div>';
191 191
  }
192

  
193
  // --- PAGE PART: KEYS --- //
194
  if($identificationKeyCount > 0 && ($page_part == 'keys' || $page_part == 'all') ){
195
    $out .= '<div id="keys">';
196
        if($page_part == 'all'){
197
      $out .= '<h2>'.t('Keys').'</h2>';
198
    }
199
    $out .= theme('cdm_block_IdentificationKeys', $taxon->uuid);
200
    $out .= '</div>';
201
  }
192 202
  return $out;
193 203
}
194 204

  
......
370 380
		if(isset($taxon->name->nomenclaturalReference)){
371 381
			$referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid));
372 382
		}
373
		
383

  
374 384
		$accepted_name = theme('cdm_taxonName', $taxon->name, null, $referenceUri);
375 385
		$out .= '<span class="accepted-name">';
376 386
		$out .= $accepted_name;
377 387
        $out .= '</span>';
378
		
388

  
379 389
		$special_annotations_array = array();
380 390
		$special_annotations_array[] = $taxon->name;
381 391
		$special_annotations_array[] = $taxon;
......
389 399
		//if($addAcceptedTaxon && !isset($synomymie->homotypicSynonymsByHomotypicGroup[0])){
390 400
		// display the type information for the added taxon
391 401
    //}
392
    
402

  
393 403
    //render accepted taxon homotypic synonymy groups or type desygnations but
394 404
	//show only the typedesignations at the homotypic synonymy group
395 405
	if (!$synomymie->homotypicSynonymsByHomotypicGroup[0]->name->uuid){
......
453 463
	return $out;
454 464
}
455 465

  
456

  
457 466
/**
458 467
 * TODO Implementation of Hook taxon_image_gallery()
459 468
 *
......
478 487
		//$gallery_settings = getGallerySettings(CDM_DATAPORTAL_MEDIA_GALLERY_NAME);
479 488
		$gallery_settings = getGallerySettings(CDM_DATAPORTAL_TAXON_MEDIA_GALLERY_NAME_TAB);
480 489
		$out = '<div class="image-gallerie">';
481
		$out .= theme('cdm_media_gallerie', 
490
		$out .= theme('cdm_media_gallerie',
482 491
		  $media,
483 492
		  $gallery_name,
484 493
		  $gallery_settings['cdm_dataportal_media_maxextend'],

Also available in: Unified diff