Wiki source code of Photos

Version 1.1 by Administrator on 2016/04/22 21:42

Show last authors
1 1 Photo Albums
2
3 {table}
4 Photo|Title|Description|Comments
5 #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")
6 #foreach ($item in $xwiki.searchDocuments($sql))
7 #set($bentrydoc = $xwiki.getDocument($item))
8 #set($comments = $bentrydoc.getComments())
9 #if($comments.size()>0)
10 #set($i = 0)
11 #set($cobj = $comments.get($i))
12 #set($comment = $bentrydoc.display("comment", "view", $cobj))
13 #else
14 #set($comment = "")
15 #end
16 #set($comment = $comment.replaceAll("\n","<br />"))
17 #set($bentryobj = $bentrydoc.getObject("XWiki.PhotoAlbumClass",0))
18 #if($bentrydoc.attachmentList.size()>0)
19 #set($attach = $bentrydoc.attachmentList.get(0))
20 <img src="$bentrydoc.getAttachmentURL($attach.filename,"download", "height=50")" height="50" alt="$!{bentrydoc.display("title","view",$bentryobj)}" />|[$!{bentrydoc.display("title","view",$bentryobj)}>$item] | $!bentrydoc.display("description", "view", $bentryobj) | $!comment
21 #else
22 [No photo>$item]|[$!{bentrydoc.display("title","view",$bentryobj)}>$item] | $!bentrydoc.display("description","view",$bentryobj) | $!comment
23 #end
24 #end
25 {table}
26
27 1.1 Add an Album
28
29 <form action="" id="newdoc">
30 <div>
31 <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" />
32 <input type="hidden" name="parent" value="Photos.WebHome" />
33 <input type="hidden" name="template" value="XWiki.PhotoAlbumClassTemplate" />
34 <input type="hidden" name="sheet" value="1" />
35 <input type="hidden" name="webname" value="Photos" />
36 Wiki name of the album: <input type="text" name="name" value="short name no special chars" size="40" />
37 <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();' />
38 </div>
39 </form>

Submit feedback regarding this wiki to [email protected]

This wiki is licensed under a Creative Commons 2.0 license
XWiki 14.10.13 - Documentation