General Actions:
Log-in
Register
Wiki:
games
▼
:
Document Index
»
Space:
BBCode
▼
:
Document Index
»
Page:
TopicClassSheet
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Wiki Home
»
XWiki Space
»
Data types
»
TopicClass
»
TopicClassSheet
Wiki source code of
TopicClassSheet
Last modified by
Administrator
on 2008/03/18 01:23
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#set ($showattachments = "no") #set ($showcomments = "no") <style type="text/css"> #includeTopic('BBCode.Skin') </style> {pre} <script type="text/javascript"> function quote(id) { $('BBCode.PostClass_postcontent').value = "-quote:"+id+"-" + $('BBCode.PostClass_postcontent').value; } function setquote() { var s = $('BBCode.PostClass_postcontent').value var matches = s.match(/-quote:message[0-9]*-/); for (var i=0; i < matches.length; i++) { var oldmatch = matches[i]; var newmatch = matches[i].replace(/-quote:(message[0-9]*)-/, "$1"); s = s.replace(oldmatch, "<blockquote>" + $(newmatch).innerHTML + "</blockquote>"); } $('BBCode.PostClass_postcontent').value = s; return false; //return cancelCancelEdit(); } </script> {/pre} #if($request.parent && $request.parent!="") #set($parent=$request.parent) #else #set($parent=$doc.parent) #end <input type="hidden" name="parent" value="$parent" /> #set($class = $doc.getObject("BBCode.TopicClass").xWikiClass) <input type="hidden" name="title" value="$doctitle" /> <div class="bbbigbox"> #if ($context.action == 'inline') $msg.bb_entertopictitle<br /> $doc.display('topictitle') $msg.bb_entertopicdescription<br /> $doc.display('topicdescription') #template('tagedit.vm') #set($newtopictitle = $request.nicetopictitle) #if($newtopictitle) #set($newtopictitle = $newtopictitle.replaceAll('"',"'")) <script type="text/javascript"> var nicetopictitle = "${newtopictitle}"; {pre} document.forms.inline["BBCode.TopicClass_0_topictitle"].value = nicetopictitle; document.forms.inline["title"].value = nicetopictitle; {/pre} </script> #end #if($doc.isNew() == 'false') #set($title = $doc.getValue('topictitle', $doc.getObject('BBCode.TopicClass'))) <script type="text/javascript"> var nicetopictitle = "${title}"; {pre} document.forms.inline["title"].value = nicetopictitle; {/pre} </script> #end #else #set($postindex = 0) <table class="topictable"> <tr> <th> $msg.bb_author </th> <th> #if ($doc.getValue('topictitle', $doc.getObject('BBCode.TopicClass')) != "") $doc.display('topictitle') #else $doc.name #end #if ($doc.getValue('topicdescription', $doc.getObject('BBCode.TopicClass')) != "") - <span class="bbdatatext">$doc.display('topicdescription') </span> #end </th> </tr> #set($postclass = $doc.getObjects('BBCode.PostClass')) #set($tagClass = $xwiki.getClass("XWiki.TagClass")) #set($tagsProp = $tagClass.tags) #set($sep = $tagsProp.getProperty("separator").getValue()) #set ($tags = $doc.tags.split("${sep}")) #set($existingTags = $xwiki.arrayList) #foreach($tag in $tags) #set($discard = $existingTags.add($tag)) #end <tr> <td colspan="2"> <div class="tags"> #if ($existingTags.size()>0 && $existingTags.get(0).length()>0) <span class="bbdatatext"> $msg.bb_topictags #foreach ($tag in $existingTags) <a href='$xwiki.getURL("WebHome")?tag=$tag'> $tag </a> #end </span> #end </div> <span class="bbdatatext"> $msg.bb_thereis $postclass.size() $msg.bb_messagesintopic </span> </td> </tr> #foreach($item in $postclass) #set ($postauthor = $xwiki.getUserName($doc.display('postauthor', $item), true)) #if ($doc.getValue('postcontent', $item) != '') #set ($postindex = $postindex + 1) <tr class="#if($postindex % 2 == 0) evenpost #end"> <td id="posttd"> #set ($localpostauthor = $doc.display('postauthor', $item)) #set ($index = $localpostauthor.indexOf(":")) #set ($index = $index + 1) #set ($localpostauthor = $localpostauthor.substring($index)) <div class="avatar"> <a href="$xwiki.getURL($localpostauthor)"> #useravatar($localpostauthor) </a><br /> $postauthor<br /> #if($context.user == $doc.display('postauthor', $item) || $xwiki.hasAdminRights() == 'true') <a class="red" href="$doc.getURL("objectremove", "classname=BBCode.PostClass&classid=${item.number}&xredirect=${request.getRequestURL()}")">$msg.bb_deletethismessage</a> #end #end </div></td> <td id="posttd"> <div id="message$item.number"> <span class="bbdatatext"> <a name=$postindex href="#$postindex">$postindex</a> - $msg.bb_postedon $doc.display('postdate', $item) $msg.bb_by $postauthor </span> - <a href="#postmessage" onclick="quote('message$item.number')"> $msg.bb_quotemessage </a> <hr size="1" /> <div class="postcontent"> $doc.display('postcontent', $item) </div></div> </td> </tr> #end <tr> <td> </td> <td> #if ($context.user == 'XWiki.XWikiGuest') <span class="bbdatatext"> $msg.bb_needloginmessage </span> #else #set ($lastpostid = $postclass.size() + 1) <span class="bbsmalltitle"> <a name=postmessage href="#postmessage"> $msg.bb_postmessage </a> </span> <form method="post" action="$doc.getURL("objectadd")" onsubmit="setquote();"> <input type="hidden" name="xredirect" value="$doc.getURL()#$lastpostid" /> <input type="hidden" name="classname" value="BBCode.PostClass" /> <input type="hidden" name="BBCode.PostClass_postauthor" value="$context.user" /> <textarea rows="10" cols="65" id="BBCode.PostClass_postcontent" name="BBCode.PostClass_postcontent" /></textarea><br /> <input type="submit" value="$msg.bb_postyourmessage" /> </form> #end </td> </tr> </table> #end </div>