Project

General

Profile

Download (19.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
// $Id$
3

    
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
*/
12

    
13
function theme_cdm_feature_nodesTOC($featureNodes){
14

    
15
	$out .= '<ul>';
16

    
17
	foreach($featureNodes as $node){
18
		// process $descriptionElements with content only
19
		if(is_array($node->descriptionElements) && count($node->descriptionElements) > 0){
20

    
21
			$featureRepresentation = isset($node->feature->representation_L10n) ? $node->feature->representation_L10n : 'Feature';
22
			// HACK to implement images for taxa, should be removed
23
			if($node->feature->uuid != UUID_IMAGE){
24
				$out .= '<li>'.l(t(theme('cdm_feature_name', $featureRepresentation)), $_GET['q'], array("class"=>"toc"), NULL, generalizeString($featureRepresentation)).'</li>';
25
			}
26
		}
27
	}
28

    
29
	$out .= '</ul>';
30
	return $out;
31
}
32

    
33
function theme_cdm_feature_name($feature_name){
34
	//TODO replace by using translations ?
35
	switch($feature_name){
36
		default: return t(ucfirst($feature_name));
37
	}
38
}
39

    
40
function theme_cdm_featureTrees($mergedTrees, $taxon){
41

    
42
	if(!$mergedTrees){
43
		return;
44
	}
45

    
46
	foreach($mergedTrees as &$mTree){
47
		//TODO diplay title and reference in case of multiple $mergedTrees -> theme
48
		$out .= theme('cdm_feature_nodes', $mTree->root->children, $taxon);
49
	}
50
	return $out;
51
}
52

    
53

    
54

    
55
function theme_cdm_featureTreeTOCs($mergedTrees){
56

    
57
	if(!$mergedTrees){
58
		return;
59
	}
60
	//FIXME
61
	$out = '<div class="featureTOC">';
62
	$out .= '<h2>' . t('Content') .'</h2>';
63

    
64
	//TODO diplay title and reference in case of multiple $mergedTrees -> theme
65

    
66
	foreach($mergedTrees as &$mTree){
67
		$out .= theme('cdm_feature_nodesTOC', $mTree->root->children);
68
	}
69

    
70
	$out .= '</div>';
71
	return $out;
72
}
73

    
74

    
75

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

    
78
	$gallery_settings = getGallerySettings(CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME);
79
	
80
	foreach($featureNodes as $node){
81
		// process $descriptionElements with content only
82
		if(is_array($node->descriptionElements) && count($node->descriptionElements) > 0){
83

    
84
			$featureRepresentation = isset($node->feature->representation_L10n) ? $node->feature->representation_L10n : 'Feature';
85

    
86
			$block->module = 'cdm_dataportal';
87

    
88
			if($node->feature->uuid != UUID_IMAGE){
89
				$block->delta = generalizeString($featureRepresentation);
90
				$block->subject = theme('cdm_feature_name', $featureRepresentation);
91
				$block->module = "cdm_dataportal-feature";
92

    
93
				//get the text for the feature block
94
				$block->content = theme('cdm_descriptionElements', $node->descriptionElements, $node->feature->uuid);
95
				// get media for the feature block
96
				$media_list = cdm_dataportal_media_from_descriptionElements($node->descriptionElements);
97
				$captionElements = array('title', 'rights');
98
				//$block->content .= theme('cdm_media_gallerie', $media_list, "test", 150, 4, false, $captionElements);
99
				$block->content .= theme('cdm_media_gallery', $media_list, 
100
					CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME.'_'.$node->feature->uuid,
101
					$gallery_settings['cdm_dataportal_media_maxextend'], 
102
	             	$gallery_settings['cdm_dataportal_media_cols'], 
103
	             	$gallery_settings['cdm_dataportal_media_maxRows'],
104
	             	$captionElements);
105
				
106
				// set anchor; FIXME put anchor in $block->subject
107
				$out .= '<a name="'.$block->delta.'"></a>';
108
				$out .= theme('block', $block);
109

    
110
				// TODO HACK
111
				if($node->feature->uuid == UUID_DISTRIBUTION){
112
					$out .= theme('cdm_descriptionElements_distribution', $taxon);
113
				}
114
			}
115
		}
116
		// theme
117
		if(count($node->children) > 0){
118
			$out .= '<div class="nested_description_elements">';
119
			$out .= theme('cdm_feature_nodes', $node->children, $taxon);
120
			$out .= '</div>';
121
		}
122
	}
123
	return $out;
124
}
125

    
126

    
127

    
128

    
129
function theme_cdm_descriptionElementArray($elementArray, $feature, $glue = '', $sortArray = false, $enclosingHtml = 'ul'){
130
	$out = '<'.$enclosingHtml.' class="description" id="'.$feature->representation_L10n.'">';
131

    
132
	if($sortArray) sort($elementArray);
133

    
134
	$out .= join($elementArray, $glue);
135

    
136
	$out .= '</'.$enclosingHtml.'>';
137
	return $out;
138
}
139

    
140
/**
141
 * TODO: assign a new name to the function? because it is used for the citations 
142
 *       textdata elements and not for all text data description elements
143
 * @param $element The description element which contains the text information
144
 * @param $asListElement A boolean which determines whether the citations should 
145
 *                       be renderer as a list or not  
146
 * @return unknown_type Html to be renderized in drupal
147
 */
148
function theme_cdm_descriptionElementTextData($element, $asListElement){
149

    
150
  $description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text);
151
  $sourceRefs = '';
152
  $result = array();
153
  $res_text;
154
  $res_author;
155
  $res_date;
156
    
157
  foreach($element->sources as $source){
158
    $referenceCitation = theme('cdm_DescriptionElementSource', $source);
159
    if($description && strlen($description) > 0 && $referenceCitation ){
160
        $sourceRefs .= ' ('.$referenceCitation.')' ;
161
    }
162
  }
163
  if(strlen($sourceRefs) > 0){
164
    $sourceRefs = '<span class="sources">' . $sourceRefs . '</span>';
165
  }
166
/*  
167
          $out = l('<span class="reference">'.$reference.'</span>'
168
          , path_to_reference($descriptionElementSource->citation->uuid)
169
          , array("class"=>"reference")
170
          , NULL, NULL, FALSE ,TRUE);
171
*/  
172
  if ($source->nameUsedInSource->uuid){ //do a link to name page
173
    $name_used_in_source_link_to_show = l($source->nameUsedInSource->titleCache,
174
                                           path_to_name($source->nameUsedInSource->uuid), 
175
                                           array(),
176
                                           NULL, NULL, FALSE ,TRUE);
177
   
178
  }else if (strlen($source->nameUsedInSource->originalNameString) > 0){ //show a text without link
179
  	$name_used_in_source_link_to_show = $source->nameUsedInSource->originalNameString;
180
  }
181
  /*
182
  if (strlen($name_used_in_source) > 0){
183
    $name_used_in_source_text_to_show = "  (name used in source: " . $name_used_in_source . ")";
184
  }
185
  */
186
  
187
  if ($asListElement){
188
    $res_text = '<li class="descriptionText">' 
189
      . $name_used_in_source_link_to_show . ': ' . $description . $sourceRefs . '</li>';
190
  }else{
191
    $res_text = $description . $sourceRefs . ' (name in source: '. $name_used_in_source_link_to_show . ')';
192
  }
193
  return $res_text;
194
}
195

    
196

    
197
/**
198
 * Theme a list of description elements, usually of a specific feature type
199
 * @param $descriptionElements
200
 * @return unknown_type
201
 */
202
function theme_cdm_descriptionElements($descriptionElements, $featureUuid){
203
	$outArray = array();
204
	$glue = '';
205
	$sortOutArray = false;
206
	$enclosingHtml = 'ul';
207
	$distributionElements = array();
208

    
209
	foreach($descriptionElements as $descriptionElement){
210
		
211
		if($descriptionElement->feature->uuid == UUID_DISTRIBUTION){
212
			if($descriptionElement->class == 'Distribution'){
213
				$distributionElements[]= $descriptionElement;
214
			} else if($descriptionElement->class == 'TextData'){
215
				$asListElement = false;
216
				$repr = theme ('cdm_descriptionElementTextData', $descriptionElement, $asListElement);
217
					
218
				if( !array_search($repr, $outArray)){
219
					$outArray[] = $repr;
220
					$glue = '<br/> ';
221
					$sortOutArray = true;
222
					$enclosingHtml = 'p';
223
				}
224
			}
225
		} else if($descriptionElement->class == 'TextData'){
226
			$asListElement = true;
227
			$outArray[] = theme('cdm_descriptionElementTextData', $descriptionElement, $asListElement);
228
		} else {
229
			$outArray[] = '<li>No method for rendering unknown description class: '.$descriptionElement->classType.'</li>';
230
		}
231

    
232
	}
233

    
234
	$outArray[] = theme('cdm_descriptionElementDistribution', $distributionElements);
235
	
236
	
237
	// take the feature of the last $descriptionElement
238
	$feature = $descriptionElement->feature;
239
	$out = theme('cdm_descriptionElementArray', $outArray, $feature, $glue, $sortOutArray, $enclosingHtml);
240
	$out .= '<div class="footnote_list">'. FootnoteManager::renderFootnoteList($featureUuid) . '</div>';
241
	return $out;
242
}
243

    
244
/**
245
 * 
246
 * @param unknown_type $descriptionElements
247
 * @return unknown_type
248
 */
249
function theme_cdm_descriptionElementDistribution($descriptionElements){
250

    
251
	$out = '';
252
	$separator = ', ';
253

    
254
	foreach($descriptionElements as $descriptionElement){
255
		//$footnoteKey = FootnoteManager::addNewFootnote($descriptionElement->feature->uuid, $descriptionElement->area->representation_L10n);
256
	  $footnoteKeyList = '';
257
		foreach($descriptionElement->sources as $source){
258
  		$footnoteKey = FootnoteManager::addNewFootnote($descriptionElement->feature->uuid, $source, 'cdm_DescriptionElementSource');
259
  		$footnoteKeyList .= theme('cdm_footnode_key', $footnoteKey) . ' ';
260
		}
261
    $out .= $descriptionElement->area->representation_L10n . $footnoteKeyList . $separator;
262
	}
263
	$out = substr($out, 0, strlen($out)-strlen($separator) );
264
	
265
	$taxonTrees =  cdm_ws_get(CDM_WS_PORTAL_TAXONOMY);
266
	foreach($taxonTrees as $taxonTree){
267
		if ($taxonTree -> uuid == variable_get('cdm_taxonomictree_uuid', FALSE)){
268
			$reference = $taxonTree-> reference;
269
			break;
270
		}
271
	}
272

    
273
//  $referenceCitation = l('<span class="reference">('.$reference->title.')</span>', path_to_reference($reference->uuid), array("class"=>"reference"), NULL, NULL, FALSE ,TRUE);
274
//	if($descriptions && strlen($descriptions) > 0 ){
275
//		$sourceRefs .= ' '.$referenceCitation;
276
//	}
277

    
278
	return $out;
279

    
280
}
281

    
282

    
283
function theme_cdm_DescriptionElementSource($descriptionElementSource, $doLink = TRUE){
284

    
285
    //ev. delegate to theme_cdm_ReferencedEntityBase
286
    $out = '';
287
    if($descriptionElementSource->citation){
288
      $datePublished = $descriptionElementSource->citation->datePublished;
289
      if (strlen($datePublished->start) >0){
290
        $year=substr($datePublished->start,0,strpos($datePublished->start,'-'));
291
      }
292
      $author_team_titlecache = $descriptionElementSource->citation->authorTeam->titleCache;
293
      if (strlen($year)>0){
294
        $reference = $author_team_titlecache.' '. $year;
295
      }else {
296
        $reference = $author_team_titlecache ;
297
      }
298
      
299
      if($doLink){
300
        $out = l('<span class="reference">'.$reference.'</span>'
301
          , path_to_reference($descriptionElementSource->citation->uuid)
302
          , array("class"=>"reference")
303
          , NULL, NULL, FALSE ,TRUE);
304
      } else {
305
       $out = $reference;
306
      }
307
      if($descriptionElementSource->citationMicroReference){
308
        $out .= ': '. $descriptionElementSource->citationMicroReference;
309
      }
310
    }
311
    return $out;
312
}
313

    
314

    
315

    
316
/**
317
 * TODO
318
 * Quick-and-dirty solution to show distribution service to exemplar groups
319
 *
320
 * @param unknown_type $featureTo
321
 * @return unknown
322
 */
323
function theme_cdm_descriptionElements_distribution($taxon){
324

    
325
	$fontStyles = array(0 => "plane", 1 => "italic");
326
	$server = variable_get('cdm_dataportal_geoservice_access_point', false);
327

    
328
	if(!server){
329
		return "<p>No geoservice specified</p>";
330
	}else{
331
		$map_data_parameters = cdm_ws_get(CDM_WS_GEOSERVICE_DISTRIBUTIONMAP, $taxon->uuid);
332

    
333
		$display_width = variable_get('cdm_dataportal_geoservice_display_width', false);
334
		$bounding_box = variable_get('cdm_dataportal_geoservice_bounding_box', false);
335
		$labels_on = variable_get('cdm_dataportal_geoservice_labels_on', 0);
336

    
337
		$query_string = ($display_width ? '&ms=' . $display_width: '')
338
		. ($bounding_box ? '&bbox=' .  $bounding_box : '')
339
		. ($labels_on ? '&labels=' .  $labels_on : '');
340

    
341
		if(variable_get('cdm_dataportal_map_openlayers', 1)){
342
			// embed into openlayers viewer
343
			$query_string .= '&img=false&legend=1&mlp=3';
344
			$map_tdwg_Uri = url($server. '/areas.php?' .$map_data_parameters->String, $query_string);
345
			$legend_url_font_size = variable_get('cdm_dataportal_geoservice_legend_font_size', 10);
346
			$legend_url_font_style = variable_get('cdm_dataportal_geoservice_legend_font_style', 1);
347
			$legend_url_font_style = $fontStyles[$legend_url_font_style];
348
			$legend_url_icon_width  = variable_get('cdm_dataportal_geoservice_legend_icon_width', 35);
349
			$legend_url_icon_height = variable_get('cdm_dataportal_geoservice_legend_icon_height', 15);
350

    
351
			//#print($map_tdwg_Uri.'<br>');
352

    
353
			//$map_tdwg_Uri ='http://edit.csic.es/v1/areas3_ol.php?l=earth&ad=tdwg4:c:UGAOO,SAROO,NZSOO,SUDOO,SPAAN,BGMBE,SICSI,TANOO,GEROO,SPASP,KENOO,SICMA,CLCBI,YUGMA,GRCOO,ROMOO,NZNOO,CLCMA,YUGSL,CLCLA,ALGOO,SWIOO,CLCSA,MDROO,HUNOO,ETHOO,BGMLU,COROO,BALOO,POROO,BALOO|e:CZESK,GRBOO|g:AUTAU|b:LBSLB,TUEOO|d:IREIR,AUTLI,POLOO,IRENI|f:NETOO,YUGCR|a:TUEOO,BGMBE,LBSLB||tdwg3:c:BGM,MOR,SPA,SIC,ITA,MOR,SPA,FRA|a:YUG,AUT&as=a:8dd3c7,,1|b:fdb462,,1|c:4daf4a,,1|d:ffff33,,1|e:bebada,,1|f:ff7f00,,1|g:377eb8,,1&&ms=610&bbox=-180,-90,180,90';
354
			//$tdwg_sldFile = cdm_http_request($map_tdwg_Uri);
355

    
356
			// get the respone from the map service
357
			$responseObj = cdm_ws_get($map_tdwg_Uri, null, null, "GET", TRUE);
358
			$responseObj = $responseObj[0];
359

    
360
			$geoserver_uri = $responseObj->geoserver;
361
			// get the sld files from the response object
362
			if(isset($responseObj->layers)){
363
				if(isset($responseObj->legend)){
364
					//$splittedLegendSldUrl = explode("http://edit.csic.es/v1/sld/", $responseObj->legend);
365
					//$tdwg_sldLegend = $splittedLegendSldUrl[1];
366
					$sldLegend=$responseObj->legend;
367
					//$legend_url  ="http://edit.csic.es/geoserver/wms/GetLegendGraphic?SERVICE=WMS&VERSION=1.1.1&format=image".urlencode('/')."png&TRANSPARENT=TRUE";
368
					$legend_url  ="http://193.190.223.46:8080/geoserver/wms/GetLegendGraphic?SERVICE=WMS&VERSION=1.1.1&format=image".urlencode('/')."png&TRANSPARENT=TRUE";
369
					$legend_url .= "&WIDTH=".$legend_url_icon_width."&HEIGHT=".$legend_url_icon_height."&";
370
					$legend_url .="layer=topp".urlencode(':')."tdwg_level_4&LEGEND_OPTIONS=forceLabels".urlencode(':')."on;fontStyle".urlencode(':').$legend_url_font_style.";fontSize".urlencode(':').$legend_url_font_size."&SLD=".urlencode($sldLegend);
371
				}
372
				$layerSlds = $responseObj->layers;
373
				foreach($layerSlds as $layer){
374
					$tdwg_sldUris[$layer->tdwg] = $layer->sld;
375
					//#print($tdwg_sldUris[$layer->tdwg].'<br>');
376
				}
377
			}
378
			// get the bbox from the response object
379
			$zoomto_bbox = ($bounding_box ? $bounding_box : ($responseObj->bbox ? $responseObj->bbox :'-180, -90, 180, 90') );
380

    
381
			$add_tdwg1 = (isset($tdwg_sldUris['tdwg1']) ? "
382
          tdwg_1.params.SLD = '".$tdwg_sldUris['tdwg1']."';
383
          map.addLayers([tdwg_1]);" : '');
384
			$add_tdwg2 = (isset($tdwg_sldUris['tdwg2']) ? "
385
          tdwg_2.params.SLD = '".$tdwg_sldUris['tdwg2']."';
386
          map.addLayers([tdwg_2]);" : '');
387
			$add_tdwg3 = (isset($tdwg_sldUris['tdwg3']) ? "
388
          tdwg_3.params.SLD = '".$tdwg_sldUris['tdwg3']."';
389
          map.addLayers([tdwg_3]);" : '');
390
			$add_tdwg4 = (isset($tdwg_sldUris['tdwg4']) ? "
391
          tdwg_4.params.SLD = '".$tdwg_sldUris['tdwg4']."';
392
          map.addLayers([tdwg_4]);" : '');
393

    
394
			//      $googleMapsApiKey_localhost = 'ABQIAAAAFho6eHAcUOTHLmH9IYHAeBRi_j0U6kJrkFvY4-OX2XYmEAa76BTsyMmEq-tn6nFNtD2UdEGvfhvoCQ';
395
			//      drupal_set_html_head(' <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key='.$googleMapsApiKey_localhost.'"></script>');
396

    
397
			/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
398
			 * OpenLayers.js must be loaded BEFORE jQuery.
399
			 * If jQuery loaded before $.something will fail in IE8.
400
			 * Therefore we add OpenLayers.js it in the page.tpl.php
401
			 * -----------------------------------------------------
402
			 * Andreas Kohlbecker [Feb 25th 2010]:
403
			 * This problems seems to be solved somehow (a bugfix in IE8?)
404
			 * so I am removing this "hack" by uncommenting the line below
405
			 */
406
			drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/OpenLayers/OpenLayers.js', 'core', 'header');
407
			drupal_add_js('
408
 var map;
409
 
410
 var layerOptions = {
411
     maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
412
     isBaseLayer: false,
413
     displayInLayerSwitcher: false
414
  };
415
 
416
 var tdwg_1 = new OpenLayers.Layer.WMS.Untiled( 
417
    "tdwg level 1", 
418
    "'.$geoserver_uri.'/wms",
419
    {layers:"topp:tdwg_level_1",transparent:"true", format:"image/png"},
420
    layerOptions
421
  );
422
  
423
 var tdwg_2 = new OpenLayers.Layer.WMS.Untiled( 
424
    "tdwg level 2", 
425
    "'.$geoserver_uri.'/wms",
426
    {layers:"topp:tdwg_level_2",transparent:"true", format:"image/png"},
427
    layerOptions
428
  );
429
  
430
 var tdwg_3 = new OpenLayers.Layer.WMS.Untiled( 
431
    "tdwg level 3", 
432
    "'.$geoserver_uri.'/wms",
433
    {layers:"topp:tdwg_level_3", transparent:"true", format:"image/png"},
434
    layerOptions
435
  );
436
  
437
  var tdwg_4 = new OpenLayers.Layer.WMS.Untiled( 
438
    "tdwg level 4", 
439
    "'.$geoserver_uri.'/wms",
440
    {layers:"topp:tdwg_level_4",transparent:"true", format:"image/png"},
441
    layerOptions
442
  );
443
  
444
 // make baselayer
445
 layerOptions[\'isBaseLayer\'] = true; 
446
 
447
 var ol_wms = new OpenLayers.Layer.WMS( 
448
    "OpenLayers WMS",
449
    "http://labs.metacarta.com/wms/vmap0",
450
    {layers: \'basic\'}, 
451
    layerOptions
452
  );
453
  
454
  
455
  // ------------------------------
456
  
457
  
458
 function init() {
459
 
460
   var mapOptions={
461
     controls: 
462
       [ 
463
         new OpenLayers.Control.PanZoom(),
464
         new OpenLayers.Control.Navigation({zoomWheelEnabled: false, handleRightClicks:true, zoomBoxKeyMask: OpenLayers.Handler.MOD_CTRL})
465
       ],
466
       maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
467
       maxResolution: '.(360 / $display_width).',
468
       restrictedExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
469
       projection: new OpenLayers.Projection("EPSG:4326")
470
    };
471
   
472
   map = new OpenLayers.Map(\'openlayers_map\', mapOptions);
473
   map.addLayers([ol_wms]);
474
   '.$add_tdwg1.'
475
   '.$add_tdwg2.'
476
   '.$add_tdwg3.'
477
   '.$add_tdwg4.'
478
   map.zoomToExtent(new OpenLayers.Bounds('.$zoomto_bbox.'), false);
479
 }
480
 
481
$(document).ready(function(){
482
  init();
483
  $(\'#openlayers_legend\').css(\'top\', -$(\'#openlayers_map\').height());
484
  $(\'#openlayers_legend\').css(\'left\', $(\'#openlayers_map\').width()-100);
485
});'
486
, 'inline');
487
// showing openlayers
488
$out = '<div id="openlayers">';
489
$out .= '<div id="openlayers_map" class="smallmap" style="width: '.$display_width.'px; height:'.($display_width / 2).'px"></div>';
490
// showing lengeds
491
if (variable_get('cdm_dataportal_geoservice_legend_on', TRUE)){
492
	$out .= '<div id="openlayers_legend"><img id="legend" src="'.$legend_url.'"></div>';
493
}
494
// showing map caption
495
$out .= '<div class="distribution_map_caption">' . variable_get('cdm_dataportal_geoservice_map_caption', '') . '</div>' . '<br>';
496
$out .= '</div>';
497
 
498
		} else {
499
			// simple image
500
			$mapStaticCaption = '&mc_s=Georgia,15,blue&mc=' . variable_get('cdm_dataportal_geoservice_map_caption', '');
501
			$query_string .= '&img=true&legend=1&mlp=3' . $mapStaticCaption . '&recalculate=false';
502
			$mapUri = url($server. '/areas.php?' .$map_data_parameters->String, $query_string);
503
			$out .= '<img class="distribution_map" src="' . $mapUri . '" alt="Distribution Map" />';
504
		}
505
		/*
506
		 // add a simple legend
507
		 if(variable_get('cdm_dataportal_geoservice_legend_on', TRUE)){
508
			$legenddata = array(
509
			'native' => "4daf4a",
510
			'native_doubtfully_native' => "377eb8",
511
			'cultivated' => "984ea3",
512
			'introduced' => "ff7f00",
513
			'introduced adventitious' => "ffff33",
514
			'introduced cultivated' => "a65628",
515
			'introduced naturalized' => "f781bf"
516
			);
517

    
518
			$out .= '<div class="distribution_map_legend">';
519
			foreach($legenddata as $term => $color){
520
			$out .= '<img style="width: 3em; height: 1em; background-color: #'.$color.'" src="'.
521
			drupal_get_path('module', 'cdm_dataportal').'/images/clear.gif" />'.t($term).' ';
522
			}
523
			$out .= '</div>';
524

    
525
			}
526
			*/
527
		return $out;
528
	}
529
}
(2-2/8)