General Actions:
Log-in
Wiki:
Courses
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
CreatePost
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to L3D's XWiki for Courses
»
The Wiki Blog
»
Create a new blog post
Wiki source code of
Create a new blog post
Last modified by
Administrator
on 2008/11/25 23:44
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: {{include document="Blog.BlogCode"/}} 2: 3: {{velocity filter="none"}} 4: {{html clean="false" wiki="true"}} 5: #if($hasEdit) 6: $xwiki.jsx.use($blogScriptsDocumentName)## 7: ## 8: ## 9: ## 10: #set($name = "$!request.entryTitle") 11: #if($name == '') 12: ## First step, display the create form 13: #set($space = "$!request.entrySpace") 14: #if($space == '') 15: #set($space = $doc.space) 16: #end 17: <form action="${xwiki.getURL('Blog.CreatePost', 'view', 'xpage=plain')}" id="newBlogPost" method="post"> 18: <div> 19: <input type="hidden" name="entrySpace" value="$space"/> 20: #if($doc.getObject($blogCategoryClassname)) 21: <input type="hidden" name="category" value="${escapetool.xml(${doc.fullName})}"/> 22: #end 23: <label class="createPost" for="entryTitle">$msg.get('xe.blog.post.createpost') </label><input type="text" id="entryTitle" name="entryTitle" value="$msg.get('xe.blog.post.title')" class="withTip"/> <span class="buttonwrapper"><input type="submit" value="${escapetool.xml($msg.get('xe.blog.post.create'))}" class="button"/></span> 24: </div> 25: </form> 26: #else 27: ## Second step, form submitted, create the document 28: #set($space = "$!request.entrySpace") 29: #if($space == '') 30: #set($space = 'Main') 31: #end 32: ## Remove . and : from the document name, as they have a special meaning in XWiki document names 33: #set($postDocName = "${space}.${name.replaceAll('[.:]', '')}") 34: ## Get the target blog document, to set it as the parent 35: #getBlogDocument($space $blogDoc) 36: #set($parent = $blogDoc.fullName) 37: #set($title = $util.encodeURI($name)) 38: #if("$!request.category" != '') 39: #set($category = "&${blogPostClassname}_${blogPostObjectNumber}_category=${escapetool.url(${request.category})}") 40: #end 41: $response.sendRedirect($xwiki.getURL($postDocName, 'inline', "template=${blogPostTemplate}&parent=${parent}&title=${title}&${blogPostClassname}_0_title=${title}$!{category}")) 42: #end## name == '' 43: #elseif("$!request.entryTitle" != '')## !hasEdit && form submitted 44: #template('accessdenied.vm') 45: #end## hasEdit 46: {{/html}} 47: {{/velocity}}
Recent Blog Posts
Storm Drain Survey
Computer Science Department Wikipedia Article
Delicious Cookies!!!
Assignment 13 posted
Makeshift Crew Project Survey for Cookies!!!
Assignments 11 & 12 Posted
Assignment 10 Posted
Assignment 9 (Project Progress Report) Posted
Organize Your Projects
A8 Posted
Blog Categories
News
(10)
Other
(2)
Personal
(1)
Survey
(1)
Blog Archive
2009
(1)
Quick Links
DSSF 2008
DCNM 2009
HCCF 2010
Document Index
Sandbox
My Recent Modifications
ASSIGNMENTNAME