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