Toggle navigation
Log-in
myITGuide
Page Index
User Index
Application Index
Global
Wiki Index
Home
Blog
Links
Database
SQL Server
Cassandra
BigData
PostgreSQL
Redis
MariaDB
MongoDB
Tools
T-SQL
Powershell
Python
Scala
R
Jupyter
Java
Solution
Streaming
Spark
Storm
Search
Solr
ElasticSearch
Kafka
Puppet
Kibana
Docker
Kubernetes
OS
Windows
Linux
About
About Us
Email Us
Blog
Manage blogs on this wiki
Wiki source code of
Manage blogs on this wiki
Last modified by superadmin on 2016/12/20 10:05
Hide line numbers
1: {{include reference="Blog.BlogCode"/}} 2: 3: {{velocity filter="none"}} 4: {{html clean="false" wiki="true"}} 5: #if($hasAdmin) 6: ## 7: ## 8: ## List existing blogs. 9: ## TODO: Display the number of articles in each blog 10: ## TODO: Provide some management links: delete, edit title, configure... 11: ## 12: = $services.localization.render('xe.blog.manage.existing') = 13: 14: #foreach($item in $xwiki.wrapDocs($services.query.hql(", BaseObject obj where obj.name = doc.fullName and obj.className = '$blogClassname' and doc.fullName <> '$blogTemplate' ").execute())) 15: #getBlogTitle($item $title) 16: #if($title != '') 17: * [[$title>>$item.fullName]] 18: #else 19: * [[$item.displayTitle>>$item.fullName]] 20: <p/> 21: #end 22: #end 23: ## 24: ## 25: ## New blog 26: ## 27: 28: = $services.localization.render('xe.blog.manage.createnew') = 29: 30: #set($title = "$!request.blogTitle") 31: #if($title != '') 32: #set($space = "$!request.blogSpace") 33: #if($space == '') 34: #warning($services.localization.render('xe.blog.manage.nospace')) 35: #else 36: #if("$!request.blogType" == 'main') 37: #set($blogDocName = "${space}.WebHome") 38: #else 39: #set($blogDocName = "${space}.Blog") 40: #end 41: #set($parent = $services.model.resolveDocument('', 'default', $doc.documentReference.extractReference('WIKI'))) 42: $response.sendRedirect($xwiki.getURL($blogDocName, 'save', "parent=${parent}&title=${escapetool.url($title)}&template=${blogTemplate}&${blogClassname}_0_title=${escapetool.url($title)}&form_token=$!{request.getParameter('form_token')}")) 43: #end 44: #end 45: ## 46: ## Show the form 47: <form action="${xwiki.getURL('Blog.Management')}" id="newBlog" method="post"> 48: <div> 49: <input type="hidden" name="form_token" value="$!{services.csrf.getToken()}" /> 50: <dl> 51: <dt><label for="blogSpace">$services.localization.render('xe.blog.manage.space')</label></dt> 52: <dd><input type="text" name="blogSpace" id="blogSpace" value=""/></dd> 53: <dt><label for="blogTitle">$services.localization.render('xe.blog.manage.title')</label></dt> 54: <dd><input type="text" name="blogTitle" id="blogTitle" value="$services.localization.render('xe.blog.manage.blogtitle')"/></dd> 55: <dt><label for="blogType">$services.localization.render('xe.blog.manage.blogtype')</label></dt> 56: <dd><select name="blogType" id="blogType"> 57: <option value="inner" selected="selected">$services.localization.render('xe.blog.manage.inside')</option> 58: <option value="main">$services.localization.render('xe.blog.manage.main')</option> 59: </select></dd> 60: </dl> 61: <input class="button" type="submit" value="${escapetool.xml($services.localization.render('xe.blog.manage.create'))}"/> 62: </div> 63: </form> 64: #else ## !hasAdmin 65: #xwikimessageboxstart($services.localization.render('error') $services.localization.render('notallowed')) 66: #xwikimessageboxend() 67: #end 68: 69: {{/html}} 70: {{/velocity}}