General Actions:
Log-in
Register
Wiki:
Main wiki
▼
:
Document Index
»
Space:
Photos
▼
:
Document Index
»
Page:
WebHome
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Main wiki
»
Photo Albums
Wiki source code of
Photo Albums
Last modified by
Administrator
on 2010/09/23 14:50
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
1 Photo Albums {table} Photo|Title|Description|Comments #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='XWiki.PhotoAlbumClass' and obj.name <> 'XWiki.PhotoAlbumClassTemplate' order by doc.creationDate desc") #foreach ($item in $xwiki.searchDocuments($sql)) #set($bentrydoc = $xwiki.getDocument($item)) #set($comments = $bentrydoc.getComments()) #if($comments.size()>0) #set($i = 0) #set($cobj = $comments.get($i)) #set($comment = $bentrydoc.display("comment", "view", $cobj)) #else #set($comment = "") #end #set($comment = $comment.replaceAll("\n","<br />")) #set($bentryobj = $bentrydoc.getObject("XWiki.PhotoAlbumClass",0)) #if($bentrydoc.attachmentList.size()>0) #set($attach = $bentrydoc.attachmentList.get(0)) <img src="$bentrydoc.getAttachmentURL($attach.filename,"download")" height="50" alt="$!{bentrydoc.display("title","view",$bentryobj)}" />|[$!{bentrydoc.display("title","view",$bentryobj)}>$item] | $!bentrydoc.display("description", "view", $bentryobj) | $!comment #else [No photo>$item]|[$!{bentrydoc.display("title","view",$bentryobj)}>$item] | $!bentrydoc.display("description","view",$bentryobj) | $!comment #end #end {table} 1.1 Add an Album <form action="" id="newdoc"> <div> <input type="hidden" name="parent" value="Photos.WebHome" /> <input type="hidden" name="template" value="XWiki.PhotoAlbumClassTemplate" /> <input type="hidden" name="sheet" value="1" /> <input type="hidden" name="webname" value="Photos" /> Wiki name of the album: <input type="text" name="name" value="short name no special chars" size="40" /> <input type="button" value="Add this Album" onclick='updateName(this.form.name); action="../../inline/" + this.form.webname.value + "/" + this.form.name.value; this.form.submit();' /> </div> </form>