Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 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="parent" value="Photos.WebHome" /> | ||
| 32 | <input type="hidden" name="template" value="XWiki.PhotoAlbumClassTemplate" /> | ||
| 33 | <input type="hidden" name="sheet" value="1" /> | ||
| 34 | <input type="hidden" name="webname" value="Photos" /> | ||
| 35 | Wiki name of the album: <input type="text" name="name" value="short name no special chars" size="40" /> | ||
| 36 | <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();' /> | ||
| 37 | </div> | ||
| 38 | </form> |