Revision e2eaa6c7
Added by Patrick Plitzner over 7 years ago
modules/cdm_dataportal/includes/occurrences.inc | ||
---|---|---|
192 | 192 |
); |
193 | 193 |
$alternativeMediaUris = array(); |
194 | 194 |
foreach($images as $image){ |
195 |
$mediaUri = getMediaUri($image); |
|
196 |
if($mediaUri){ |
|
197 |
$alternativeMediaUris[] = $mediaUri; |
|
198 |
} |
|
199 |
else{ |
|
195 | 200 |
$alternativeMediaUris[] = path_to_media($image->uuid); |
201 |
} |
|
196 | 202 |
} |
197 | 203 |
|
198 | 204 |
$gallery_html = theme('cdm_media_gallerie', array( |
... | ... | |
210 | 216 |
return "<br>".create_label($galleryName)."<br>".$gallery_html; |
211 | 217 |
} |
212 | 218 |
|
219 |
function getMediaUri($media){ |
|
220 |
if(isset($media->representations) && sizeof($media->representations)==1 |
|
221 |
&& isset($media->representations[0]->parts) && |
|
222 |
sizeof($media->representations[0]->parts)==1) { |
|
223 |
return $media->representations[0]->parts[0]->uri; |
|
224 |
} |
|
225 |
return null; |
|
226 |
} |
|
227 |
|
|
213 | 228 |
|
214 | 229 |
/** |
215 | 230 |
* Formats the given string to a label for displaying key-value pairs in HTML |
Also available in: Unified diff
ref #6042 Open media with direct link instead of media page