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