Project

General

Profile

Download (19.8 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 media_content_type_dir($media_representation, $default = false){
14

    
15
	if($media_representation->mimeType){
16
		return substr($media_representation->mimeType, 0, stripos($media_representation->mimeType, '/'));
17
	} else {
18
		return $default;
19
	}
20
}
21

    
22
function getimagesize_remote($image_url) {
23

    
24
	$contents = cdm_http_request($image_url);
25
	if(!$contents){
26
		return false;
27
	}
28

    
29
	$im = @ImageCreateFromString($contents); // using@ to avoid php user warnings
30
	if (!$im) {
31
		return false;
32
	}
33
	$gis[0] = ImageSX($im);
34
	$gis[1] = ImageSY($im);
35
	// array member 3 is used below to keep with current getimagesize standards
36
	$gis[3] = "width={$gis[0]} height={$gis[1]}";
37
	ImageDestroy($im);
38
	return $gis;
39
}
40

    
41

    
42

    
43
function theme_cdm_media($descriptionElement, $mimeTypePreference){
44
	$out = "";
45

    
46
	_add_js_thickbox();
47

    
48
	$uuid = $descriptionElement->uuid;
49
	$feature = $descriptionElement->feature;
50
	$medias = $descriptionElement->media;
51

    
52
	foreach($medias as $media){
53
		$prefRepresentations = cdm_preferred_media_representations($media, $mimeTypePreference, 300, 400);
54
		$mediaRepresentation = array_shift($prefRepresentations);
55
		if($mediaRepresentation) {
56

    
57
			$contentTypeDirectory = media_content_type_dir($mediaRepresentation);
58

    
59
			$out .= theme('cdm_media_mime_' . $contentTypeDirectory,  $mediaRepresentation, $feature);
60

    
61
			//			$attributes = array('class'=>'thickbox', 'rel'=>'descriptionElement-'.$uuid, 'title'=>$feature->term);
62
			//		    for($i = 0; $part = $mediaRepresentation->representationParts[$i]; $i++){
63
			//		    	if($i == 0){
64
			//		    	    $image_url = drupal_get_path('module', 'cdm_dataportal').'/images/'.$feature->term.'-media.png';
65
			//		    	    $media = '<img src="'.$image_url.'" height="14px" alt="'.$feature->term.'" />';
66
			//		    	    $out .= l($media, $part->uri, $attributes, NULL, NULL, TRUE, TRUE);
67
			//		    	} else {
68
			//		    		$out .= l('', $part->uri, $attributes, NULL, NULL, TRUE);
69
			//		    	}
70
			//		  	}
71
		} else {
72
			// no media available, so display just the type term
73
			$out .=  $feature->representation_L10n;
74
		}
75
	}
76
	return $out;
77

    
78
}
79

    
80
function theme_cdm_mediaTypeTerm($feature, $mediaUrl = false){
81

    
82
	$provider = '';
83
	//TODO directly use favicon from referred URI and overlay on $icon_image, but for now we comment this out
84
	//	if(strpos($mediaUrl, 'biodiversitylibrary.org') > 0){
85
	//    $provider = '-BHL';
86
	//	}
87

    
88
	$icon_image = $feature->representation_L10n.'-media'.$provider.'.png';
89
	$icon_url = drupal_get_path('module', 'cdm_dataportal').'/images/'.$icon_image;
90
	return '<img src="'.$icon_url.'" height="14px" alt="'.$feature->representation_L10n.'" />';
91
}
92

    
93
function theme_cdm_media_mime_application($mediaRepresentation, $feature){
94

    
95
	foreach($mediaRepresentation->parts as $part){
96
		$attributes = array('title'=> theme('cdm_feature_name', $feature->representation_L10n), 'target'=>'_blank');
97
		//$attributes = array('title'=>$feature->representation_L10n, 'target'=>'_blank');
98
		//$attributes = array('title'=>'original publication', 'target'=>'_blank');
99
		$out .= l(theme('cdm_mediaTypeTerm', $feature, $part->uri), $part->uri, $attributes, NULL, NULL, TRUE, TRUE);
100
	}
101
	return $out;
102
}
103

    
104
function theme_cdm_media_mime_image($mediaRepresentation, $feature){
105
	$out = '';
106
	//TODO thickbox is not used anymore -> delete ?
107
	$attributes = array('class'=>'thickbox', 'rel'=>'representation-'.$representation->uuid, 'title'=>$feature->representation_L10n);
108
	for($i = 0; $part = $representation->representationParts[$i]; $i++){
109
		if($i == 0){
110
			$out .= l(theme('cdm_mediaTypeTerm', $feature, $part->uri), $part->uri, $attributes, NULL, NULL, TRUE, TRUE);
111
		} else {
112
			$out .= l('', $part->uri, $attributes, NULL, NULL, TRUE);
113
		}
114
	}
115
	return $out;
116
}
117

    
118
function theme_cdm_media_mime_text($representation, $feature){
119

    
120
	foreach($representation->parts as $part){
121
		$attributes = array('title'=> theme('cdm_feature_name', $feature->representation_L10n), 'target'=>'_blank');
122
		//$attributes = array('title'=>t('original publication'), 'target'=>'_blank');
123
		$out .= l(theme('cdm_mediaTypeTerm', $feature, $part->uri), $part->uri, $attributes, NULL, NULL, TRUE, TRUE);
124
	}
125
	return $out;
126
}
127

    
128

    
129
function theme_cdm_media_caption($media, $elements = array('title', 'description', 'artist', 'location', 'rights'), $fileUri = null){
130

    
131
	$media_metadata = cdm_read_media_metadata($media);
132

    
133
	$doTitle= !$elements || array_search('title', $elements)!== false;
134
	$doDescription = !$elements || array_search('description', $elements)!== false;
135
	$doArtist = !$elements || array_search('artist', $elements)!== false;
136
	$doLocation = !$elements || array_search('location', $elements)!== false;
137
	$doRights = !$elements || array_search('rights', $elements)!== false;
138

    
139
	$descriptionPrefix = "";
140

    
141
	$out = '<dl class="media-caption">';
142
	//title
143
	if($doTitle) {
144
	    if($media_metadata['title']){
145
		  $out .= '<dt class = "title">' . t('Title') . '</dt> <dd class = "title">' . $media_metadata['title'] . '</dd>';
146
		  $descriptionPrefix = "- ";
147
	    } else if(!($doDescription && $media_metadata['description'])) {
148
	      // use filename as fallbackoption if no description will be shown
149
          $out .= '<dt class = "title">' . t('Title') . '</dt> <dd class = "title">' . $media_metadata['filename'] . '</dd>';
150
          $descriptionPrefix = "- ";
151
	    }
152
	}
153
	//description
154
	if($media_metadata['description'] && $doDescription) {
155
		$out .= '<dt class = "description">' . t('Description') . '</dt> <dd class = "description">' . $descriptionPrefix . $media_metadata['description'] . '</dd>';
156
	}
157
	//artist
158
	if($media_metadata['artist'] && $doArtist) {
159
		$out .= '<dt class = "artist">' . t('Artist') . '</dt> <dd class = "astist">' . $media_metadata['artist'] . '</dd>';
160
	}
161
	//location
162
	if($doLocation){
163
		$location = '';
164
		$location .= $media_metadata['location']['sublocation'];
165
		if ($location && $media_metadata['location']['city']){
166
			$location .= ', ';
167
		}
168
		$location .= $media_metadata['location']['city'];
169
		if ($location && $media_metadata['location']['province']){
170
			$location .= ', ';
171
		}
172
		$location .= $media_metadata['location']['province'];
173
		if ($location && $media_metadata['location']['country']){
174
			$location .= ' (' . $media_metadata['location']['country'] . ')';
175
		} else {
176
			$location .= $media_metadata['location']['country'];
177
		}
178
		if ($location){
179
			$out .= '<dt class = "location">' . t('Location') . '</dt> <dd class = "location">' . $location  . '</dd>';
180
		}
181
	}
182
	//rights
183
	if($doRights){
184
		$rights = '';
185
		//copyrights
186
		$cnt = count($media_metadata['rights']['copyright']['agentNames']);
187
		if($cnt > 0){
188
			$rights .= '<dt class="rights">&copy;</dt> <dd class="rights"> ';
189
			for($i = 0; $i < $cnt; $i++){
190
				$rights .= $media_metadata['rights']['copyright']['agentNames'][$i];
191
				if($i+1 < $cnt){
192
					$rights .= ' / ';
193
				}
194
			}
195
			$rights .= '</dd>';
196
		}
197
		//license
198
		$cnt = count($media_metadata['rights']['license']['agentNames']);
199
		if($cnt > 0){
200
			$rights .= '<dt class ="license">' . t('License') . '</dt> <dd class = "license">';
201
			for($i = 0; $i < $cnt; $i++){
202
				$rights .= $media_metadata['rights']['license']['agentNames'][$i];
203
				if ($i+1 < $cnt){
204
					$rights .= ' / ';
205
				}
206
			}
207
			$rights .= '</dd>';
208
		}
209
		if($rights){
210
			$out .=  $rights . '</dt>';
211
		}
212
	}
213
	//TODO add all other metadata elemenst generically
214
	$out .= '</dl>';
215
	//return value
216
	return $out;
217
}
218

    
219

    
220
/**
221
 * @param $mediaList an array of Media entities
222
 * @param $maxExtend
223
 * @param $cols
224
 * @param $maxRows
225
 * @param $captionElements an array possible values are like in the following example: array('title', 'description', 'file', 'filename'),
226
 *         to add a link to the caption: array('titlecache', '#uri'=>t('open Image'));
227
 * @param $mediaLinkType valid values:
228
 *      "NONE": do not link the images,
229
 *      "LIGHTBOX": open the link in a light box,
230
 *      "NORMAL": link to the image page or to the $alternativeMediaUri if it is defined
231
 * @param $alternativeMediaUri an array of alternative URIs to link the images wich will overwrite the URIs of the media parts.
232
 *     The order of URI in this array must correspond with the order of images in $mediaList
233
 * @param $galleryLinkUri an URI to link the the hint on more images to; if null no link is created
234
 * @return unknown_type
235
 */
236
function theme_cdm_media_gallerie(
237
	$mediaList,
238
    $galleryName,
239
	$maxExtend = 150,
240
	$cols = 4,
241
	$maxRows = false,
242
	$captionElements = array('title'),
243
	$mediaLinkType = 'LIGHTBOX',
244
	$alternativeMediaUri = null,
245
	$galleryLinkUri = null,
246
	$showCaption = true){
247

    
248
	if(!is_array($captionElements)){
249
		$captionElements = array();
250
	}
251
	//TODO correctly handle multiple media representation parts
252
	$_SESSION['cdm']['last_gallery']= substr($_SERVER['REQUEST_URI'],strpos($_SERVER['REQUEST_URI'], "?q=")+3);
253
	// prevent from errors
254
	if(!isset($mediaList[0])){
255
		return;
256
	}
257

    
258
	$galleryID = "media_gallery_".$galleryName;
259
	$mediaPartLinkAttributes = array();
260
	$openMediaLinkAttributes = array();
261

    
262
	// prepare media links
263
	$doLink = false;
264
	if($mediaLinkType != 'NONE'){
265
		$doLink = true;
266
	}
267
	if($mediaLinkType == 'LIGHTBOX'){
268
		$doLink = true;
269
		_add_js_lightbox($galleryID);
270
	}
271

    
272
	// render the media gallery grid
273
	$out = '<table id="'.$galleryID.'" class="media_gallery">';
274
	$out .= '<colgroup>';
275
	for($c = 0; $c < $cols; $c++){
276
		$out .= '<col width="'.(100 / $cols).'%">';
277
	}
278
	$out .= '</colgroup>';
279
	for($r = 0; ($r < $maxRows || !$maxRows) && count($mediaList) > 0; $r++){
280
		$captionParts = array();
281
		$out .= '<tr>';
282
		for($c = 0; $c < $cols; $c++){
283
			$media = array_shift($mediaList);
284
			if(isset($media->representations[0]->parts[0])){
285

    
286
				//
287
				// find preferred representation
288
				//
289
				$preferred_media_representations_list = cdm_preferred_media_representations(
290
				$media,
291
				array('image/jpg', 'image/jpeg', 'image/png', 'image/gif'),
292
				$maxExtend, $maxExtend);
293
				if(count($preferred_media_representations_list) == 0){
294
					// fallback to using the first one in the list
295
					$preferred_media_representations_list = $media->representations;
296
				}
297
				$preferred_media_representation = array_shift($preferred_media_representations_list);
298

    
299
				// $preferred_media_representation->parts[0]->uri = "http://127.0.0.1/images/palmae/palm_tc_14415_1.jpg";
300
				$contentTypeDirectory = media_content_type_dir($preferred_media_representation, 'application');
301
				$mediaIndex++;
302
				$mediaPartHtml = theme('cdm_media_gallerie_'.$contentTypeDirectory, $preferred_media_representation->parts[0], $maxExtend, TRUE);
303
				// --- compose Media Link
304
				$mediaLinkUri = false;
305
				if($alternativeMediaUri){
306
					if(isset($alternativeMediaUri[$mediaIndex])){
307
						$mediaLinkUri = $alternativeMediaUri[$mediaIndex];
308
					}
309
					if(is_string($alternativeMediaUri)){
310
						$mediaLinkUri = $alternativeMediaUri;
311
					}
312
				} else {
313
					$mediaLinkUri = $preferred_media_representation->parts[0]->uri;
314
				}
315

    
316
				_add_js_ahah();
317
				$content_url = cdm_compose_url(CDM_WS_PORTAL_MEDIA, $media->uuid);
318

    
319
				$cdm_proxy_url = url('cdm_api/proxy/'.urlencode($content_url)."/cdm_media_caption/".serialize($captionElements));
320
				$captionPartHtml = '<div class="ahah-content" rel="'.$cdm_proxy_url.'"><span class="loading" style="display: none;">Loading ....</span></div>';
321

    
322
				// generate gallery caption
323
				if($mediaLinkType == 'LIGHTBOX' && $contentTypeDirectory == 'image'){
324
					$mediaPartLinkAttributes['class'] = "lightbox";
325
				} else {
326
					$mediaPartLinkAttributes['target'] = "specimen";
327
					$openMediaLinkAttributes['target'] = "specimen";
328
				}
329
				// generate & add caption to lightbox
330
				$lightBoxCaptionElements = null;
331
				$cdm_proxy_url = url('cdm_api/proxy/'.urlencode($content_url)."/cdm_media_caption"); //.($lightBoxCaptionElements?'/'.join	(',',$lightBoxCaptionElements):''));
332
				$mediaPartLinkAttributes['alt'] = '<div class="ahah-content" rel="'.$cdm_proxy_url.'"><span class="loading" style="display: none;">Loading ....</span></div>';
333

    
334
				if(isset($captionElements['#uri'])){
335
					if($contentTypeDirectory == 'image'){
336
						$captionPartHtml .= '<div>'.l($captionElements['#uri'], path_to_media($media->uuid), null, null, null, FALSE, TRUE).'</div>';
337
					} else {
338
						$captionPartHtml .= '<div>'.l($captionElements['#uri'], $mediaLinkUri, $openMediaLinkAttributes, null, null, TRUE, TRUE).'</div>';
339
					}
340
				}
341
				$captionParts[] = $captionPartHtml;
342

    
343
				// --- surround imagePart with link
344
				if($doLink){
345
					$mediaPartHtml = l($mediaPartHtml, $mediaLinkUri, $mediaPartLinkAttributes, null, null, FALSE, TRUE);
346
				}
347

    
348
			} else {
349
				$mediaPartHtml = '';
350
				$captionParts[] = '';
351
			}
352
			$out .= '<td class="media">'.$mediaPartHtml.'</td>';
353
		}
354
		$out .= '</tr>'; // end of media parts
355
		if ($showCaption){
356
		     if(count($captionElements) > 0){
357
            $out .= '<tr>';
358
            // add caption row
359
            foreach($captionParts as $captionPartHtml){
360
                $out .= '<td class="caption">'.$captionPartHtml.'</td>';
361
            }
362
            $out .= '</tr>';
363
            }
364
		}
365
	}
366
	if($galleryLinkUri){
367
		if(count($mediaList) > 0){
368
			$moreHtml = count($mediaList).' '.t('more in gallery');
369
		} else {
370
			$moreHtml = t('open gallery');
371
		}
372
		$moreHtml = l($moreHtml, $galleryLinkUri);
373
		$out .= '<tr><td colspan="'.$cols.'">'.$moreHtml.'</td></tr>';
374
	}
375
	$out .= '</table>';
376
	return $out;
377
}
378

    
379
function theme_cdm_media_gallerie_image($mediaRepresentationPart, $maxExtend, $addPassePartout = FALSE, $attributes = null){
380
	//TODO merge with theme_cdm_media_mime_image?
381

    
382
	if(isset($mediaRepresentationPart)){
383

    
384
		$h = $mediaRepresentationPart->height;
385
		$w = $mediaRepresentationPart->width;
386
		if($w == 0 || $h == 0){
387
			$image_uri = str_replace(' ','%20',$mediaRepresentationPart->uri); //take url and replace spaces
388
			$imageDimensions = getimagesize_remote($image_uri);
389
			if(!$imageDimensions){
390
				return '<div>'.t('Image unavailable, uri: ').$mediaRepresentationPart->uri.'</div>';
391
			}
392
			$w = $imageDimensions[0];
393
			$h = $imageDimensions[1];
394
		}
395
		$margins = '0 0 0 0';
396
		$ratio = $w / $h;
397
		if($ratio > 1){
398
			$displayHeight = round($maxExtend / $ratio);
399
			$displayWidth = $maxExtend;
400
			$m = round(($maxExtend - $displayHeight) / 2);
401
			$margins = 'margin:'.$m.'px 0 '.$m.'px 0;';
402
		} else {
403
			$displayHeight = $maxExtend;
404
			$displayWidth = round($maxExtend * $ratio);
405
			$m = round(($maxExtend - $displayWidth) / 2);
406
			$margins = 'margin:0 '.$m.'px 0 '.$m.'px;';
407
		}
408

    
409
		// turn attributes array into string
410
		$attrStr = ' ';
411
		//$attributes['title'] = 'h:'.$h.', w:'.$w.',ratio:'.$ratio;
412
		if(is_array($attributes)){
413
			foreach($attributes as $name=>$value){
414
				$attrStr .= $name.'="'.$value.'" ';
415
			}
416
		}
417

    
418
		//return  '<img src="'."http://wp5.e-taxonomy.eu/dataportal/cichorieae/media/photos/Lapsana_communis_A_01.jpg".'" width="'.$maxExtend.'" height="'.$maxExtend.'" />';
419
		if($addPassePartout){
420
			$out .= '<div class="image-passe-partout" style="width:'.$maxExtend.'px; height:'.$maxExtend.'px;">';
421
		} else {
422
			// do not add margins if no pass partout is shown
423
			$margins = '';
424
		}
425
		$out .= '<img src="'.$mediaRepresentationPart->uri.'" width="'.$displayWidth.'" height="'.$displayHeight.'" style="'.$margins.'"'.$attrStr.' />';
426

    
427
		if($addPassePartout){
428
			$out .= '</div>';
429
		}
430
		return $out;
431
	}
432

    
433
}
434

    
435
function theme_cdm_media_gallerie_application($mediaRepresentationPart, $maxExtend, $addPassePartout = FALSE, $attributes = null){
436

    
437
	if(isset($mediaRepresentationPart)){
438

    
439
		if($addPassePartout){
440
			$out .= '<div class="image-passe-partout" style="width:'.$maxExtend.'px; height:'.$maxExtend.'px;">';
441
		} else {
442
			// do not add margins if no pass partout is shown
443
			$margins = '';
444
		}
445
		$out .= '<div class="appication">Web Application</div>';
446

    
447
		if($addPassePartout){
448
			$out .= '</div>';
449
		}
450
		return $out;
451
	}
452

    
453
}
454

    
455
function theme_cdm_media_gallerie_text($mediaRepresentationPart, $maxExtend, $addPassePartout = FALSE, $attributes = null){
456

    
457
	if(isset($mediaRepresentationPart)){
458

    
459
		if($addPassePartout){
460
			$out .= '<div class="image-passe-partout" style="width:'.$maxExtend.'px; height:'.$maxExtend.'px;">';
461
		} else {
462
			// do not add margins if no pass partout is shown
463
			$margins = '';
464
		}
465
		$out .= '<div class="appication">Web Application</div>';
466

    
467
		if($addPassePartout){
468
			$out .= '</div>';
469
		}
470
		return $out;
471
	}
472

    
473
}
474

    
475
function theme_cdm_openlayers_image($mediaRepresentationPart, $maxExtend){
476

    
477
	// see http://trac.openlayers.org/wiki/UsingCustomTiles#UsingTilesWithoutaProjection
478
	// and http://trac.openlayers.org/wiki/SettingZoomLevels
479

    
480
	drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/OpenLayers/OpenLayers.js', 'core', 'header');
481

    
482
	//TODO megre code below with code from theme_cdm_media_gallerie_image
483
	//var_dump("MEDIA URI: " . $mediaRepresentationPart->uri);
484
	//TODO merge code below with code from theme_cdm_media_gallerie_image
485
	$w = $mediaRepresentationPart->width;
486
	$h = $mediaRepresentationPart->height;
487

    
488
	if($w == 0 || $h == 0){
489
		$image_uri = str_replace(' ','%20',$mediaRepresentationPart->uri); //take url and replace spaces
490
		$imageDimensions = getimagesize_remote($image_uri);
491
		if(!$imageDimensions){
492
			return '<div>'.t('Image unavailable, uri:').$mediaRepresentationPart->uri.'</div>';
493
		}
494
		$w = $imageDimensions[0];
495
		$h = $imageDimensions[1];
496
	}
497

    
498
	// calculate  maxResolution (default is 360 deg / 256 px) and the bounds
499
	if($w > $h){
500
		$lat = 90;
501
		$lon = 90 * ($h / $w);
502
		$maxRes = $w / $maxExtend;
503
	} else {
504
		$lat = 90 * ($w / $h);
505
		$lon = 90;
506
		$maxRes =  $h / $maxExtend ;
507
	}
508

    
509
	$maxRes *= 1;
510
	drupal_add_js('
511
 var map;
512

    
513
 var imageLayerOptions={
514
     maxResolution: '.$maxRes.',
515
     maxExtent: new OpenLayers.Bounds(0, 0, '.$w.', '.$h.')
516
  };
517
  var mapOptions={
518
      controls:
519
       [
520
         new OpenLayers.Control.PanZoom(),
521
         new OpenLayers.Control.Navigation({zoomWheelEnabled: false, handleRightClicks:true, zoomBoxKeyMask: OpenLayers.Handler.MOD_CTRL})
522
       ],
523
     restrictedExtent:  new OpenLayers.Bounds(0, 0, '.$w.', '.$h.')
524
  };
525

    
526
 var graphic = new OpenLayers.Layer.Image(
527
          \'Image Title\',
528
          \''.$mediaRepresentationPart->uri.'\',
529
          new OpenLayers.Bounds(0, 0, '.$w.', '.$h.'),
530
          new OpenLayers.Size('.$w.', '.$h.'),
531
          imageLayerOptions
532
          );
533

    
534
 function init() {
535
   map = new OpenLayers.Map(\'openlayers_image\', mapOptions);
536
   map.addLayers([graphic]);
537
   map.setCenter(new OpenLayers.LonLat(0, 0), 1);
538
   map.zoomToMaxExtent();
539
 }
540

    
541
$(document).ready(function(){
542
  init();
543

    
544
});'
545
	, 'inline');
546
	$out = '<div id="openlayers_image" class="image_viewer" style="width: '.$maxExtend.'px; height:'.($maxExtend).'px"></div>';
547
	return $out;
548

    
549
}
550

    
551

    
552
function theme_cdm_preferredImage($media, $defaultRepresentationPart, $imageMaxExtend, $parameters = ''){
553

    
554
	if(isset($media[0])){
555
		$representationPart = $media[0]->representations[0]->parts[0];
556
		if($parameters){
557
			$representationPart->uri.$parameters;
558
		}
559
	} else {
560
		$representationPart = $defaultRepresentationPart;
561
	}
562

    
563
	//$widthAndHeight = ($imageWidth ? ' width="'.$imageWidth : '').($imageHeight ? '" height="'.$imageHeight : '');
564
	//  $imageUri = $preferredMedia ? $preferredMedia->representations[0]->parts[0]->uri . $parameters : $defaultImage;
565
	$attributes = array('alt'=>($preferredMedia ? $preferredMedia->representations[0]->parts[0]->uri : "no image available"));
566
	$out .= theme('cdm_media_gallerie_image', $representationPart, $imageMaxExtend, false, $attributes);
567
	// $out = '<img class="left" '.$widthAndHeight.' " src="'.$imageUri.'" alt="'.$altText.'" />';
568
	return $out;
569
}
(3-3/8)