Toggle navigation
Log-in
Wiki Index
Page Index
User Index
Application Index
Blog
Create a new blog post
Wiki source code of
Create a new blog post
Last modified by superadmin on 2016/07/29 17:18
Export
Print preview
View Source
Siblings
Content
Comments
Attachments
History
Information
×
Export
Export as PDF
Export as HTML
Cancel
Hide line numbers
1: {{include reference="Blog.BlogCode"/}} 2: 3: {{velocity}} 4: {{html clean="false" wiki="true"}} 5: #set($name = "$!request.entryTitle") 6: #if($name == '') 7: ## If there's also a form_token passed it means the user has entered an empty blog post title, let the user know about it! 8: #if ("$!request.form_token" != '') 9: {{error}}$services.localization.render('xe.blog.post.titleEmptyError'){{/error}} 10: 11: #end 12: ## First step, display the create form 13: #if($hasEdit) 14: $xwiki.jsx.use($blogScriptsDocumentName)## 15: #set($space = "$!request.entrySpace") 16: #if($space == '') 17: #set($space = $doc.space) 18: #end 19: <form action='$doc.getURL()' id="newBlogPost" method="post" class="xformInline"> 20: <div> 21: <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" /> 22: <input type="hidden" name="entrySpace" value="$!{escapetool.xml($space)}"/> 23: #if($doc.getObject($blogCategoryClassname)) 24: <input type="hidden" name="category" value="$services.rendering.escape(${escapetool.xml(${doc.fullName})}, $doc.syntax)"/> 25: #end 26: <label class="createPost" for="entryTitle">$services.localization.render('xe.blog.post.createpost') </label><input type="text" id="entryTitle" name="entryTitle" value="$services.localization.render('xe.blog.post.title')" class="withTip" size="30" /> <span class="buttonwrapper"><input type="submit" value="${escapetool.xml($services.localization.render('xe.blog.post.create'))}" class="btn btn-success button"/></span> 27: </div> 28: </form> 29: #elseif("$!request.entryTitle" != '')## !hasEdit && form submitted 30: #template('accessdenied.vm') 31: #end## hasEdit 32: #else 33: ## Second step, form submitted, create the document 34: #set($space = "$!request.entrySpace") 35: #if($space == '') 36: #set($space = 'Main') 37: #end 38: ## Remove . and : from the document name, as they have a special meaning in XWiki document names 39: #set($postDocName = "${space}.${name.replaceAll('[.:]', '')}") 40: ## Get the target blog document, to set it as the parent 41: #getBlogDocument($space $blogDoc) 42: #set($parent = "$!{escapetool.url($blogDoc.fullName)}") 43: #set($title = "$!{escapetool.url($name)}") 44: #if("$!request.category" != '') 45: #set($category = "&${blogPostClassname}_${blogPostObjectNumber}_category=${escapetool.url(${request.category})}") 46: #end 47: $response.sendRedirect($xwiki.getURL($postDocName, 'edit', "template=${blogPostTemplate}&parent=${parent}&title=${title}&${blogPostClassname}_0_title=${title}$!{category}&form_token=$!{request.getParameter('form_token')}")) 48: #end## name == '' 49: {{/html}} 50: {{/velocity}}
Applications
Blog
Dashboard
Sandbox
More applications
Navigation
Recent Blog Posts
WajunPCの評価記事、NECの再生PC
ジーンディコードのぺーじ
ストレスに強い人の特徴
国立感染症研究所
CDC発表
研究所流出説
茶番かも!?
コロナまとめ 2021-0523sun
病床数と5類についての意見メモ
本日のリアル管理栄養士のお言葉
Blog Categories
KVM
(1)
News
(4)
Other
(0)
Personal
(15)
Serverなど
(0)
Windows
(0)
firewall
(1)
routing
(1)
中学、高校の数学・物理の復習
(4)
中学、高校、大学の数学・物理・化学の復習
(3)
Blog Archive
2009
(1)
2016
(4)
2017
(1)
2021
(23)
2022
(2)