Project

General

Profile

« Previous | Next » 

Revision 344ba84d

Added by Francisco Revilla over 13 years ago

fising ticket #1804

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.common.theme
2 2
// $Id$
3 3

  
4 4
/**
5
* Copyright (C) 2007 EDIT
6
* European Distributed Institute of Taxonomy
7
* http://www.e-taxonomy.eu
8
*
9
* The contents of this file are subject to the Mozilla Public License Version 1.1
10
* See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms.
11
*/
5
 * Copyright (C) 2007 EDIT
6
 * European Distributed Institute of Taxonomy
7
 * http://www.e-taxonomy.eu
8
 *
9
 * The contents of this file are subject to the Mozilla Public License Version 1.1
10
 * See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms.
11
 */
12 12

  
13 13
define(FOOTNOTE_ANNOTATIONS, 'annotations');
14 14

  
......
112 112
function theme_cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key = array()){
113 113
	$footNoteKeys = cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key);
114 114
	foreach($footNoteKeys as $a){
115
	   //$out .=  theme('cdm_footnote_key', $a, $a->footnoteListKey, (isset($out)? ',' : ''));
116
	   $out .=  theme('cdm_footnote_key', $a, (isset($out)? ',' : ''));
117
    }
115
		//$out .=  theme('cdm_footnote_key', $a, $a->footnoteListKey, (isset($out)? ',' : ''));
116
		$out .=  theme('cdm_footnote_key', $a, (isset($out)? ',' : ''));
117
	}
118 118
	return $out;
119 119
}
120 120

  
121 121

  
122 122
function theme_cdm_annotation_footnotes($footnoteListKey, $enclosingTag = 'span'){
123
    return theme('cdm_footnotes', $footnoteListKey . '-annotations', $enclosingTag);
123
	return theme('cdm_footnotes', $footnoteListKey . '-annotations', $enclosingTag);
124 124
}
125 125

  
126 126
function theme_cdm_annotation_content($AnnotationTO){
......
175 175
	if ($separator_off){
176 176
		$separator = '';
177 177
	}
178
  $out = '<span class="footnote-key footnote-key-'.$footnoteKey->keyStr.' member-of-footnotes-'.$footnoteKey->footnoteListKey.'">'.$separator
179
        .'<a href="#footnote-'.$footnoteKey->keyStr.'">'.$footnoteKey->keyStr.'</a>'
180
        .'</span>';
181
  return $out;
178
	$out = '<span class="footnote-key footnote-key-'.$footnoteKey->keyStr.' member-of-footnotes-'.$footnoteKey->footnoteListKey.'">'.$separator
179
	.'<a href="#footnote-'.$footnoteKey->keyStr.'">'.$footnoteKey->keyStr.'</a>'
180
	.'</span>';
181
	return $out;
182 182
}
183 183

  
184 184
function theme_cdm_footnote($footnoteKey, $footnoteText){
185
  _add_js_footnotes();
186
  $out = '<span class="footnote footnote-'.$footnoteKey.'"><a name="footnote-'.$footnoteKey.'"></a><span class="footnote-anchor">'.$footnoteKey.'.</span>&nbsp;'.$footnoteText.'</span>';
187
  return $out;
185
	_add_js_footnotes();
186
	$out = '<span class="footnote footnote-'.$footnoteKey.'"><a name="footnote-'.$footnoteKey.'"></a><span class="footnote-anchor">'.$footnoteKey.'.</span>&nbsp;'.$footnoteText.'</span>';
187
	return $out;
188 188
}
189 189

  
190 190

  
......
196 196

  
197 197
function cdm_exist_footnote($footnote_list, $footnote){
198 198
	$result = false;
199
	foreach ($footnote_list as $element){
200
		if ($element == $footnote){
201
			$result = true;
199
	if (is_array($footnote_list)){
200
		foreach ($footnote_list as $element){
201
			if ($element == $footnote){
202
				$result = true;
203
			}
202 204
		}
203 205
	}
204 206
	return $result;
......
320 322
function _add_js_thickbox(){
321 323
	// ---- jQuery thickbox:
322 324
	/*
323
	* bug: compat-1.0.js && thickbox.js line 237 .trigger("unload")
324
	* -> event is not triggered because of problems with compat-1.0.js'
325
	* see INSTALL.txt
326
	*
327
	*/
325
	 * bug: compat-1.0.js && thickbox.js line 237 .trigger("unload")
326
	 * -> event is not triggered because of problems with compat-1.0.js'
327
	 * see INSTALL.txt
328
	 *
329
	 */
328 330
	//drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/jquery.imagetool.min.js');
329 331
	drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/thickbox/thickbox.js');
330 332
	drupal_add_css(drupal_get_path('module', 'cdm_dataportal').'/js/thickbox/cdm_thickbox.css');
......
353 355
}
354 356

  
355 357
function _add_js_footnotes(){
356
  drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/footnotes.js');
358
	drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/footnotes.js');
357 359
}
358 360

  
359 361

  
modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
20 20
  drupal_set_html_head('<script src=http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key='.$gmap_api_key.'" type="text/javascript"></script>');
21 21
  drupal_set_html_head('<script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1" type="text/javascript"></script>');
22 22

  
23

  
24 23
	drupal_add_js("
25 24
        if (Drupal.jsEnabled) {
26 25
          $(document).ready(function() {
......
269 268
		foreach ($elements as $element){
270 269
			if ($element->class == 'CommonTaxonName'){
271 270
				//$key = '<b>' . $element->language->representation_L10n . '</b> (' . $element->area->titleCache . ')';
272
				$key = '<b>' . $element->language->representation_L10n . '</b>';
273
				$key .= (strlen($element->area->titleCache)>0) ? ' (' . $element->area->titleCache . ')' : '';
271
				if ($element->language->representation_L10n){
272
					$key = '<b>' . $element->language->representation_L10n . '</b>';
273
					$key .= (strlen($element->area->titleCache)>0) ? ' (' . $element->area->titleCache . ')' : '';
274
				}
274 275
				$common_names[$key][] = $element;
275 276
			}else if ($element->class == 'TextData' && $element->feature->uuid == UUID_COMMON_NAME){
276 277
				$textData_commonNames[] = $element;
......
283 284
		ksort($common_names);
284 285
		//creating the output to be render by drupal
285 286
		foreach ($common_names as $key => $elements){
286

  
287 287
			$rendered_element_list = '';
288 288
			foreach($elements as $element){
289 289
				$sourcesFootnoteKeyList = '';
290
				// addinf footnotes sources
290
				// adding footnotes sources
291 291
				foreach($element->sources as $source){
292 292
					if(_is_original_source_type($source)){
293 293
						$_fkey = FootnoteManager::addNewFootnote(UUID_COMMON_NAME, theme('cdm_DescriptionElementSource', $source, false));
294 294
						$sourcesFootnoteKeyList .= theme('cdm_footnote_key', $_fkey, ($sourcesFootnoteKeyList ? $separator : ''));
295 295
					}
296 296
				}
297
				$rendered_element_list .= (strlen($rendered_element_list) > 0 ? ', ': '') . $element->name . $sourcesFootnoteKeyList;
297
				if($element->name){
298
				  $rendered_element_list .= (strlen($rendered_element_list) > 0 ? ', ': '') . $element->name . $sourcesFootnoteKeyList;
299
			  }
300
			}
301
			if ($key){
302
			 $common_name_out .= (strlen($common_name_out) > 0 ? '; ': '') . $key . ': ' . $rendered_element_list;
303
			}else{
304
			  $common_name_out .= (strlen($common_name_out) > 0 ? '; ': '') . $rendered_element_list;
298 305
			}
299
			$common_name_out .= (strlen($common_name_out) > 0 ? '; ': '') . $key . ': ' . $rendered_element_list;
300

  
301 306
		}
302 307
	}
303 308
	//handling commons names as text data
304 309
	foreach($textData_commonNames as $text_data_element){
305 310
		$text_data_out .= theme('cdm_descriptionElementTextData', $text_data_element, true, $text_data_element->feature->uuid);
306 311
	}
307
	$out_array[] = $text_data_out;
308
	return $common_name_out . theme('cdm_descriptionElementArray', $out_array, $element->feature);
312
	
313
	$common_name_out = "<div class=common_names_as_common_names> $common_name_out </div>";
314
  $out_array[] = $text_data_out;
315
	$common_name_out_text_data = '<div class=common_names_as_text_data>' . theme('cdm_descriptionElementArray', $out_array, $element->feature) . '</div>';
316
	
317
	return $common_name_out;
318
	//return $common_name_out . theme('cdm_descriptionElementArray', $out_array, $element->feature);
319
	//return "<div class=common_names> $common_name_out $common_name_out_text_data";
309 320
}
310 321

  
311 322
/**
modules/cdm_dataportal/theme/cdm_dataportal.page.theme
85 85
		$hideTabs[] = theme('cdm_taxonpage_tab', 'Images');
86 86
	}
87 87

  
88
//	$descriptionElementCount = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS_ELEMENTSBYTYPE, array($taxon->uuid, 'IndividualsAssociation'), "count=true");
89
//	if($descriptionElementCount->Integer < 0) { //DEBUG HACK
90
   // ### sending the same query twice is faster than two different ones, $descriptionElements will be retrieved again in the specimens page
88
	//	$descriptionElementCount = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS_ELEMENTSBYTYPE, array($taxon->uuid, 'IndividualsAssociation'), "count=true");
89
	//	if($descriptionElementCount->Integer < 0) { //DEBUG HACK
90
	// ### sending the same query twice is faster than two different ones, $descriptionElements will be retrieved again in the specimens page
91 91
	$descriptionElements = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS_ELEMENTSBYTYPE, array($taxon->uuid, 'IndividualsAssociation'));
92
  $descriptionElementCount = is_array($descriptionElements) ? count($descriptionElements) : 0;
92
	$descriptionElementCount = is_array($descriptionElements) ? count($descriptionElements) : 0;
93 93
	if($descriptionElementCount == 0) {
94
    $hideTabs[] = theme('cdm_taxonpage_tab', 'Specimens');
95
  }
94
		$hideTabs[] = theme('cdm_taxonpage_tab', 'Specimens');
95
	}
96 96

  
97 97
	// hideImage flag depending on administative preset
98 98
	$hideImages = false;
......
135 135
  				$structured_description_featuretree_uuid = variable_get(CDM_DATAPORTAL_STRUCTURED_DESCRIPTION_FEATURETREE_UUID, false);
136 136
  				$naturallanguage_textData = cdm_ws_get(CDM_WS_DESCRIPTION_NATURALLANGUAGE_DESCRIPTION, array($taxonDescription->uuid, $structured_description_featuretree_uuid));
137 137
  				if(!$naturallanguage_textData){
138
            drupal_set_message('The \'FeatureTree\' for the generation of natural language representations is not configured correctly, please select a \'FeatureTree\' in the '.l('CDM Dataportal Settings', 'admin/settings/cdm_dataportal/layout'), 'warning');
138
  					drupal_set_message('The \'FeatureTree\' for the generation of natural language representations is not configured correctly, please select a \'FeatureTree\' in the '.l('CDM Dataportal Settings', 'admin/settings/cdm_dataportal/layout'), 'warning');
139 139
  				}
140 140
  				$taxonDescription->elements = null;
141 141
  				$taxonDescription->elements = array($naturallanguage_textData);
......
162 162
  	// get the image gallery as configured by the admin
163 163
  	$taxon_image_gallery = call_user_func_array(
164 164
	    'taxon_image_gallery_' . variable_get('image_gallery_viewer', 'default'),
165
	    array($taxon, $media));
165
  	array($taxon, $media));
166 166
  	$out .= $taxon_image_gallery;
167 167

  
168 168
  	$out .= '</div>';
......
228 228

  
229 229
	RenderHints::pushToRenderStack('taxon_page_specimens');
230 230

  
231
  $descriptionElements = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS_ELEMENTSBYTYPE, array($taxon->uuid, 'IndividualsAssociation') );
232

  
233
  //collect media (fieldObjectMedia, derivedUnitMedia) and add as fields
234
  foreach($descriptionElements as $descriptionElement) {
235
  	if($descriptionElement->associatedSpecimenOrObservation){
236
	  	$descriptionElement->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid, 'fieldObjectMedia') );
237
	  	$descriptionElement->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid, 'derivedUnitMedia') );
238
//	  	$derivedUnitFacde = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid) );
239
//	  	$descriptionElement->_titleCache = $derivedUnitFacde->titleCache;
240
  	}
241
  }
231
	$descriptionElements = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS_ELEMENTSBYTYPE, array($taxon->uuid, 'IndividualsAssociation') );
242 232

  
243
  if(variable_get('cdm_dataportal_map_openlayers', 1)){
244
    $occurrenceQuery = cdm_ws_get(CDM_WS_GEOSERVICE_OCCURRENCEMAP, $taxon->uuid);
245
    $occurrenceQuery = $occurrenceQuery->String;
246
    $out .= get_openlayers_map(variable_get('cdm_dataportal_geoservice_display_width', false), $occurrenceQuery);
247
  }
233
	//collect media (fieldObjectMedia, derivedUnitMedia) and add as fields
234
	foreach($descriptionElements as $descriptionElement) {
235
		if($descriptionElement->associatedSpecimenOrObservation){
236
			$descriptionElement->_fieldObjectMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid, 'fieldObjectMedia') );
237
			$descriptionElement->_derivedUnitMedia = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid, 'derivedUnitMedia') );
238
			//	  	$derivedUnitFacde = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, array($descriptionElement->associatedSpecimenOrObservation->uuid) );
239
			//	  	$descriptionElement->_titleCache = $derivedUnitFacde->titleCache;
240
		}
241
	}
248 242

  
243
	if(variable_get('cdm_dataportal_map_openlayers', 1)){
244
		$occurrenceQuery = cdm_ws_get(CDM_WS_GEOSERVICE_OCCURRENCEMAP, $taxon->uuid);
245
		$occurrenceQuery = $occurrenceQuery->String;
246
		$out .= get_openlayers_map(variable_get('cdm_dataportal_geoservice_display_width', false), $occurrenceQuery);
247
	}
249 248

  
250 249

  
251
  if($descriptionElements){
252
  	$out_specimenList = '<table class="specimens">';
253
  	$i = 1;
254
  	foreach($descriptionElements as $descriptionElement) {
255
  		$i++;
256
  		if($descriptionElement->associatedSpecimenOrObservation){
257 250

  
258
  			$mediaList = array();
259
  			if(is_array($descriptionElement->_fieldObjectMedia)){
260
  				$mediaList = array_merge($mediaList, $descriptionElement->_fieldObjectMedia);
261
  			}
262
  		  if(is_array($descriptionElement->_derivedUnitMedia)){
263
          $mediaList = array_merge($mediaList, $descriptionElement->_derivedUnitMedia);
264
        }
265
  			$li = '<tr class="descriptionElement descriptionElement_IndividualsAssociation '.($i%2?'odd':'even').'"><td>' . $descriptionElement->associatedSpecimenOrObservation->titleCache;
266
  			if(count($mediaList) > 0){
267
	  			$gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
268
	  			$gallery_name =  $descriptionElement->associatedSpecimenOrObservation->uuid;
269
  				$captionElements = array('#uri'=>t('open media'));
270
	  			$gallery_html = theme(
251
	if($descriptionElements){
252
		$out_specimenList = '<table class="specimens">';
253
		$i = 1;
254
		foreach($descriptionElements as $descriptionElement) {
255
			$i++;
256
			if($descriptionElement->associatedSpecimenOrObservation){
257

  
258
				$mediaList = array();
259
				if(is_array($descriptionElement->_fieldObjectMedia)){
260
					$mediaList = array_merge($mediaList, $descriptionElement->_fieldObjectMedia);
261
				}
262
				if(is_array($descriptionElement->_derivedUnitMedia)){
263
					$mediaList = array_merge($mediaList, $descriptionElement->_derivedUnitMedia);
264
				}
265
				$li = '<tr class="descriptionElement descriptionElement_IndividualsAssociation '.($i%2?'odd':'even').'"><td>' . $descriptionElement->associatedSpecimenOrObservation->titleCache;
266
				if(count($mediaList) > 0){
267
					$gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
268
					$gallery_name =  $descriptionElement->associatedSpecimenOrObservation->uuid;
269
					$captionElements = array('#uri'=>t('open media'));
270
					$gallery_html = theme(
271 271
	  			    'cdm_media_gallerie',
272
	            $mediaList,
273
	  		      $gallery_name ,
274
						  $gallery_settings['cdm_dataportal_media_maxextend'],
275
						  $gallery_settings['cdm_dataportal_media_cols'],
276
						  $gallery_settings['cdm_dataportal_media_maxRows'],
277
						  $captionElements, 'LIGHTBOX', null, null);
278
  			} else {
279
  				$gallery_html = '';
280
  			}
281
  			$li .= '</td><td>'.$gallery_html.'</td></tr>';
282
  			$out_specimenList .= $li;
283
  		}
284
  	}
285
  	$out_specimenList .= '</table>';
286
  }
272
					$mediaList,
273
					$gallery_name ,
274
					$gallery_settings['cdm_dataportal_media_maxextend'],
275
					$gallery_settings['cdm_dataportal_media_cols'],
276
					$gallery_settings['cdm_dataportal_media_maxRows'],
277
					$captionElements, 'LIGHTBOX', null, null);
278
				} else {
279
					$gallery_html = '';
280
				}
281
				$li .= '</td><td>'.$gallery_html.'</td></tr>';
282
				$out_specimenList .= $li;
283
			}
284
		}
285
		$out_specimenList .= '</table>';
286
	}
287

  
288
	$out .= drupal_get_form('specimens_search_form');
289
	//$test = specimens_table($descriptionElements);
290
	//$out .= $test;
287 291

  
288
  $out .= $out_specimenList;
292
	$out .= $out_specimenList;
289 293

  
290 294

  
291 295
	RenderHints::popFromRenderStack();
292 296
	return $out;
293 297
}
298

  
299
function specimens_search_form() {
300

  
301
	//form select options
302
	$form['specimens_search_options'] = array(
303
    '#type' => 'value',
304
    '#value' => array(t('No sort'), t('Name'), t('CatalogNumber'), t('Gallery'))
305
	);
306

  
307
	//the form
308
	$form['specimens_search'] = array(
309
    '#title' => t('Speciments sort'),
310
	  '#type' => 'fieldset',
311
	  '#description' => t('Select your sort criteria.'),
312
	  '#collapsible' => TRUE,
313
    '#collapsed' => FALSE
314
	);
315

  
316
	//criteria
317
	$form['specimens_search']['first_criteria'] = array(
318
    '#title' => t('First criteria'),
319
    '#type' => 'select',
320
    '#options' => $form['specimens_search_options']['#value']
321
	);
322
	$form['specimens_search']['second_criteria'] = array(
323
    '#title' => t('Second criteria'),
324
    '#type' => 'select',
325
    '#options' => $form['specimens_search_options']['#value']
326
	);
327
	$form['specimens_search']['third_criteria'] = array(
328
    '#title' => t('Third criteria'),
329
    '#type' => 'select',
330
    '#options' => $form['specimens_search_options']['#value']
331
	);
332

  
333
	//submit button
334
	$form['specimens_search']['submit'] = array(
335
    '#type' => 'submit',
336
    '#value' => t('Sort')
337
	);
338

  
339
	/*
340
	//from properties
341
	$form['#method'] = 'post';
342
	$form['#action'] = 'http://example.com/?q=foo/bar';
343
	$form['#attributes'] = array(
344
    'enctype' => 'multipart/form-data',
345
    'target' => 'name_of_target_frame'
346
	);
347
	$form['#prefix'] = '<div class="my-form-class">';
348
	$form['#suffix'] = '</div>';
349
	*/
350
	
351
	//returning value
352
	return $form;
353
}
354

  
294 355
/**
295 356
 * Show whole synonymy for the accepted taxon. Synonymy list is headed by the complete scientific name
296 357
 * of the accepted taxon with nomenclatural reference.
......
318 379
		RenderHints::setFootnoteListKey(RenderHints::getRenderPath() . '-annotations');
319 380
	}
320 381
	//render accepted taxon homotypic synonymy groups or type desygnations
321
	if(!isset($synomymie->homotypicSynonymsByHomotypicGroup[0])){
382
	//if(!isset($synomymie->homotypicSynonymsByHomotypicGroup[0])){
322 383
		//if($addAcceptedTaxon && !isset($synomymie->homotypicSynonymsByHomotypicGroup[0])){
323 384
		// display the type information for the added taxon
324 385
		$typeDesignations = cdm_ws_get(CDM_WS_PORTAL_TAXON_NAMETYPEDESIGNATIONS, $taxon->uuid);
325 386
		if($typeDesignations){
326 387
			$out .= theme('cdm_typedesignations', $typeDesignations);
327 388
		}
328
	} else {
389
	//}
390
	if($synomymie->homotypicSynonymsByHomotypicGroup){
329 391
		// render the homotypicSynonymyGroup including the type information
330
		$out .= theme('cdm_homotypicSynonymyGroup', $synomymie->homotypicSynonymsByHomotypicGroup);
392
    $out .= theme('cdm_homotypicSynonymyGroup', $synomymie->homotypicSynonymsByHomotypicGroup);
331 393
	}
332 394
	//render accepted taxon heterotypic synonymy groups
333 395
	if($synomymie->heterotypicSynonymyGroups) {
......
340 402
		$taxonRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_RELATIONS, $taxon->uuid);
341 403
		$out .= theme('cdm_taxonRelationships', $taxonRelationships);
342 404
	}
343
  //render name relationships
344
  $name_rels_to_show = variable_get('name_relationships_to_show', null);
345
  $skip = array();
346
  if($name_rels_to_show){
347
	  foreach ($name_rels_to_show as $key => $value){
348
	    if ($value === 0){
349
	      $skip[] = $key;
350
	    }
351
	  }
352
	  if (sizeof($name_rels_to_show) != sizeof($skip)){
353
	   $nameRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
354
	   $out .= theme('cdm_nameRelationships', $nameRelationships, $skip);
355
	  }
356
  }
357
  /*
358
  if(variable_get(CDM_DATAPORTAL_DISPLAY_NAME_RELATIONSHIPS, CDM_DATAPORTAL_DISPLAY_NAME_RELATIONSHIPS_DEFAULT)){
359
    $nameRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
360
    // TODO is it correct to skip relationsFromThisName since all relationships are to be understood as 'is .... of'
361
    if(variable_get('cdm_dataportal_name_relations_skiptype_basionym', 1)){
362
      $skip = array(UUID_BASIONYM);
363
    }
364
    $out .= theme('cdm_nameRelationships', $nameRelationships, $skip);
365
  }
366
  */
405
	//render name relationships
406
	$name_rels_to_show = variable_get('name_relationships_to_show', null);
407
	$skip = array();
408
	if($name_rels_to_show){
409
		foreach ($name_rels_to_show as $key => $value){
410
			if ($value === 0){
411
				$skip[] = $key;
412
			}
413
		}
414
		if (sizeof($name_rels_to_show) != sizeof($skip)){
415
			$nameRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
416
			$out .= theme('cdm_nameRelationships', $nameRelationships, $skip);
417
		}
418
	}
419
	/*
420
	 if(variable_get(CDM_DATAPORTAL_DISPLAY_NAME_RELATIONSHIPS, CDM_DATAPORTAL_DISPLAY_NAME_RELATIONSHIPS_DEFAULT)){
421
	 $nameRelationships = cdm_ws_get(CDM_WS_PORTAL_TAXON_TO_NAMERELATIONS, $taxon->uuid);
422
	 // TODO is it correct to skip relationsFromThisName since all relationships are to be understood as 'is .... of'
423
	 if(variable_get('cdm_dataportal_name_relations_skiptype_basionym', 1)){
424
	 $skip = array(UUID_BASIONYM);
425
	 }
426
	 $out .= theme('cdm_nameRelationships', $nameRelationships, $skip);
427
	 }
428
	 */
367 429
	RenderHints::popFromRenderStack();
368 430

  
369 431
	return $out;
......
379 441
 */
380 442
function taxon_image_gallery_default($taxon, $media){
381 443

  
382
	 $hasImages = isset($media[0]);
383

  
384
  if($hasImages){
385
    //
386
    $maxExtend = 150;
387
    $cols = 3;
388
    $maxRows = false;
389
    $alternativeMediaUri = null;
390
    $captionElements = array('title', 'rights', '#uri'=>t('open Image'));
391
    $gallery_name = $taxon->uuid;
392
    $mediaLinkType = 'LIGHTBOX';
393

  
394
    $gallery_settings = getGallerySettings(CDM_DATAPORTAL_MEDIA_GALLERY_NAME);
395

  
396
    $out = '<div class="image-gallerie">';
397
    $out .= theme('cdm_media_gallerie', $media,
398
        $gallery_name,
399
        $gallery_settings['cdm_dataportal_media_maxextend'],
400
        $gallery_settings['cdm_dataportal_media_cols'],
401
        0, // ignore maxrows settings
402
        $captionElements,
403
        $mediaLinkType,
404
        null);
405
    $out .= '</div>';
406
  }else{
407
    $out = 'No images available.';
444
	$hasImages = isset($media[0]);
445

  
446
	if($hasImages){
447
		//
448
		$maxExtend = 150;
449
		$cols = 3;
450
		$maxRows = false;
451
		$alternativeMediaUri = null;
452
		$captionElements = array('title', 'rights', '#uri'=>t('open Image'));
453
		$gallery_name = $taxon->uuid;
454
		$mediaLinkType = 'LIGHTBOX';
455

  
456
		$gallery_settings = getGallerySettings(CDM_DATAPORTAL_MEDIA_GALLERY_NAME);
457

  
458
		$out = '<div class="image-gallerie">';
459
		$out .= theme('cdm_media_gallerie', $media,
460
		$gallery_name,
461
		$gallery_settings['cdm_dataportal_media_maxextend'],
462
		$gallery_settings['cdm_dataportal_media_cols'],
463
		0, // ignore maxrows settings
464
		$captionElements,
465
		$mediaLinkType,
466
		null);
467
		$out .= '</div>';
468
	}else{
469
		$out = 'No images available.';
408 470

  
409
  }
410
  return $out;
471
	}
472
	return $out;
411 473

  
412 474
}
413 475

  
......
420 482
 */
421 483
function taxon_image_gallery_fsi($taxon, $media){
422 484

  
423
  $flashLink = isset($media[0]);
485
	$flashLink = isset($media[0]);
424 486

  
425
  if($flashLink){
487
	if($flashLink){
426 488

  
427
    $taggedName = $taxon->name->taggedName;
489
		$taggedName = $taxon->name->taggedName;
428 490

  
429
    $nameArray = array();
430
    foreach($taggedName as $taggedText){
431
      if($taggedText->type == 'name'){
432
        $nameArray[] = $taggedText->text;
433
      }
434
    }
491
		$nameArray = array();
492
		foreach($taggedName as $taggedText){
493
			if($taggedText->type == 'name'){
494
				$nameArray[] = $taggedText->text;
495
			}
496
		}
435 497

  
436
    $query = join("%5F", $nameArray) . '%20AND%20EditWP6%20AND%20jpg';
498
		$query = join("%5F", $nameArray) . '%20AND%20EditWP6%20AND%20jpg';
437 499

  
438
    $out = '
500
		$out = '
439 501

  
440 502
<script type="text/javascript" src="http://media.bgbm.org/erez/js/fsiwriter.js"></script>
441 503

  
......
469 531

  
470 532
</noscript>';
471 533

  
472
  }else{
473
    $out = 'No images available.';
534
	}else{
535
		$out = 'No images available.';
474 536

  
475
  }
476
  return $out;
537
	}
538
	return $out;
477 539

  
478 540
}
479 541
/**

Also available in: Unified diff