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
Hide line numbers
1: #set ($showattachments = "no") 2: #set ($showcomments = "no") 3: 4: <style type="text/css"> 5: #includeTopic('BBCode.Skin') 6: </style> 7: 8: {pre} 9: <script type="text/javascript"> 10: function quote(id) { 11: $('BBCode.PostClass_postcontent').value = "-quote:"+id+"-" + $('BBCode.PostClass_postcontent').value; 12: } 13: 14: function setquote() { 15: var s = $('BBCode.PostClass_postcontent').value 16: var matches = s.match(/-quote:message[0-9]*-/); 17: for (var i=0; i < matches.length; i++) { 18: var oldmatch = matches[i]; 19: var newmatch = matches[i].replace(/-quote:(message[0-9]*)-/, "$1"); 20: s = s.replace(oldmatch, "<blockquote>" + $(newmatch).innerHTML + "</blockquote>"); 21: } 22: $('BBCode.PostClass_postcontent').value = s; 23: return false; 24: //return cancelCancelEdit(); 25: } 26: </script> 27: {/pre} 28: 29: #if($request.parent && $request.parent!="") #set($parent=$request.parent) #else #set($parent=$doc.parent) #end 30: <input type="hidden" name="parent" value="$parent" /> 31: 32: #set($class = $doc.getObject("BBCode.TopicClass").xWikiClass) 33: 34: <input type="hidden" name="title" value="$doctitle" /> 35: 36: <div class="bbbigbox"> 37: 38: #if ($context.action == 'inline') 39: $msg.bb_entertopictitle<br /> $doc.display('topictitle') 40: 41: $msg.bb_entertopicdescription<br /> $doc.display('topicdescription') 42: 43: #template('tagedit.vm') 44: 45: #set($newtopictitle = $request.nicetopictitle) 46: #if($newtopictitle) 47: #set($newtopictitle = $newtopictitle.replaceAll('"',"'")) 48: <script type="text/javascript"> 49: var nicetopictitle = "${newtopictitle}"; 50: {pre} 51: document.forms.inline["BBCode.TopicClass_0_topictitle"].value = nicetopictitle; 52: document.forms.inline["title"].value = nicetopictitle; 53: {/pre} 54: </script> 55: #end 56: 57: #if($doc.isNew() == 'false') 58: #set($title = $doc.getValue('topictitle', $doc.getObject('BBCode.TopicClass'))) 59: <script type="text/javascript"> 60: var nicetopictitle = "${title}"; 61: {pre} 62: document.forms.inline["title"].value = nicetopictitle; 63: {/pre} 64: </script> 65: #end 66: 67: #else 68: 69: #set($postindex = 0) 70: 71: <table class="topictable"> 72: 73: <tr> 74: <th> $msg.bb_author </th> 75: <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> 76: </tr> 77: 78: #set($postclass = $doc.getObjects('BBCode.PostClass')) 79: 80: #set($tagClass = $xwiki.getClass("XWiki.TagClass")) 81: #set($tagsProp = $tagClass.tags) 82: #set($sep = $tagsProp.getProperty("separator").getValue()) 83: #set ($tags = $doc.tags.split("${sep}")) 84: #set($existingTags = $xwiki.arrayList) 85: #foreach($tag in $tags) 86: #set($discard = $existingTags.add($tag)) 87: #end 88: 89: <tr> 90: <td colspan="2"> 91: <div class="tags"> 92: #if ($existingTags.size()>0 && $existingTags.get(0).length()>0) 93: <span class="bbdatatext"> $msg.bb_topictags 94: #foreach ($tag in $existingTags) 95: <a href='$xwiki.getURL("WebHome")?tag=$tag'> $tag </a> 96: #end 97: </span> 98: #end 99: </div> 100: <span class="bbdatatext"> $msg.bb_thereis $postclass.size() $msg.bb_messagesintopic </span> 101: </td> 102: </tr> 103: 104: #foreach($item in $postclass) 105: #set ($postauthor = $xwiki.getUserName($doc.display('postauthor', $item), true)) 106: #if ($doc.getValue('postcontent', $item) != '') 107: #set ($postindex = $postindex + 1) 108: 109: <tr class="#if($postindex % 2 == 0) evenpost #end"> 110: <td id="posttd"> 111: #set ($localpostauthor = $doc.display('postauthor', $item)) 112: #set ($index = $localpostauthor.indexOf(":")) 113: #set ($index = $index + 1) 114: #set ($localpostauthor = $localpostauthor.substring($index)) 115: <div class="avatar"> 116: <a href="$xwiki.getURL($localpostauthor)"> #useravatar($localpostauthor) </a><br /> 117: $postauthor<br /> 118: #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 119: </div></td> 120: <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> 121: <hr size="1" /> 122: <div class="postcontent"> 123: $doc.display('postcontent', $item) 124: </div></div> 125: </td> 126: </tr> 127: 128: #end 129: 130: <tr> 131: <td> </td> 132: <td> 133: #if ($context.user == 'XWiki.XWikiGuest') 134: <span class="bbdatatext"> $msg.bb_needloginmessage </span> 135: #else 136: #set ($lastpostid = $postclass.size() + 1) 137: <span class="bbsmalltitle"> <a name=postmessage href="#postmessage"> $msg.bb_postmessage </a> </span> 138: <form method="post" action="$doc.getURL("objectadd")" onsubmit="setquote();"> 139: <input type="hidden" name="xredirect" value="$doc.getURL()#$lastpostid" /> 140: <input type="hidden" name="classname" value="BBCode.PostClass" /> 141: <input type="hidden" name="BBCode.PostClass_postauthor" value="$context.user" /> 142: <textarea rows="10" cols="65" id="BBCode.PostClass_postcontent" name="BBCode.PostClass_postcontent" /></textarea><br /> 143: <input type="submit" value="$msg.bb_postyourmessage" /> 144: </form> 145: #end 146: </td> 147: </tr> 148: </table> 149: 150: #end 151: 152: </div>