一般动作
登录
注册
Wiki:
Main wiki
▼
:
Document Index
»
Space:
Photos
▼
:
Document Index
»
Page:
WebHome
搜索
en
页面动作
导出
▼
:
以PDF格式导出
以RTF格式导出
以HTML格式导出
更多动作
▼
:
打印预览
察看源码
欢迎进入Wiki
»
Photo Albums
Wiki源代码
Photo Albums
在2010/09/23 14:50上被
Administrator
修改
内容
·
评论
(0)
·
Annotations
(0)
·
附件
(0)
·
记录
·
信息
隐藏行号
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" 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>