General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
PhotoAlbumClassSheet
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Main wiki
»
XWiki Space
»
Data types
»
PhotoAlbumClass
»
Photo Album Class Sheet
Wiki source code of
Photo Album Class Sheet
Last modified by
Administrator
on 2010/09/23 14:50
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: #set($obj = $doc.getObject("XWiki.PhotoAlbumClass", 0)) 2: 3: <br /> 4: 1 $doc.display("title", $obj) 5: 6: $doc.display("description", $obj) 7: 8: #if($context.action != "inline") 9: 10: #set($diapo = $request.get("diapo")) 11: #if(!$diapo) 12: #set($diapo="all") 13: #end 14: 15: #if($diapo=="all") 16: 17: #macro(photosAlbum2 $height) 18: #set($current = 0) 19: #foreach ($attach in $doc.attachmentList) 20: #set($current = $current + 1) 21: <a href="$doc.getURL("view","diapo=$current")" > 22: <img src="$doc.getAttachmentURL($attach.filename,"download")" height="${height}" alt="photo ${current}" /> 23: </a> 24: #end 25: #end 26: 27: ## Compute the size of the thumbnails. If there's no height property specified default to 150 28: #if(!$obj.getProperty("height")) 29: #set($height = 150) 30: #else 31: #set($height = $doc.display("height", "view", $obj)) 32: #end 33: 34: #photosAlbum2($height) 35: 36: #else 37: 38: #set($current = 0) 39: #set($height = 400) 40: #foreach ($attach in $doc.attachmentList) 41: #set($current = $current + 1) 42: #set($scurrent = "$current") 43: #if("$diapo" == "$current") 44: #set($prev = ($current - 1)) 45: #set($next = ($current + 1)) 46: <a href="$doc.getAttachmentURL($attach.filename,"download")" > 47: <img src="$doc.getAttachmentURL($attach.filename,"download")" height="${height}" /> 48: </a> 49: #end 50: #end 51: #if($prev==0) 52: #set($prev = $doc.attachmentList.size()) 53: #end 54: #if($next==$doc.attachmentList.size()+1) 55: #set($next = 1) 56: #end 57: 58: #if(!$prev) 59: #set($prev = 1) 60: #set($next = 1) 61: #end 62: <br /> 63: ~~[Previous Photo>${doc.name}?diapo=$prev] [Next Photo>${doc.name}?diapo=$next]~~ 64: 65: #end 66: 67: <br /> 68: ~~<a href="$doc.getURL("attach")">Add Photos</a> <a href="$doc.getURL("inline")">Modify the Album</a> [All Photos>${doc.name}?diapo=all] [Diaporama>${doc.name}?diapo=1]~~ 69: #end 70: 71: #set($showattachments = 0)