Wiki source code of Manage blogs on this wiki

Version 1.1 by Administrator on 2008/11/26 06:22

Show last authors
1 {{include document="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 = $msg.get('xe.blog.manage.existing') =
13
14 #foreach($item in $xwiki.wrapDocs($xwiki.searchDocuments(", BaseObject obj where obj.name = doc.fullName and obj.className = '$blogClassname'")))
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 = $msg.get('xe.blog.manage.createnew') =
29
30 #set($title = "$!request.blogTitle")
31 #if($title != '')
32 #set($space = "$!request.blogSpace")
33 #if($space == '')
34 #warning($msg.get('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($title = $escapetool.url($title))
42 #set($parent = 'Main.WebHome')
43 $response.sendRedirect($xwiki.getURL($blogDocName, 'save', "parent=${parent}&title=${escapetool.url($title)}&template=${blogTemplate}&${blogClassname}_0_title=${escapetool.url($title)}"))
44 #end
45 #end
46 ##
47 ## Show the form
48 <form action="${xwiki.getURL('Blog.Management')}" id="newBlog" method="post">
49 <div>
50 <dl>
51 <dt><label for="blogSpace">$msg.get('xe.blog.manage.space')</label></dt>
52 <dd><input type="text" name="blogSpace" id="blogSpace" value=""/></dd>
53 <dt><label for="blogTitle">$msg.get('xe.blog.manage.title')</label></dt>
54 <dd><input type="text" name="blogTitle" id="blogTitle" value="$msg.get('xe.blog.manage.blogtitle')"/></dd>
55 <dt><label for="blogType">$msg.get('xe.blog.manage.blogtype')</label></dt>
56 <dd><select name="blogType" id="blogType">
57 <option value="inner" selected="selected">$msg.get('xe.blog.manage.inside')</option>
58 <option value="main">$msg.get('xe.blog.manage.main')</option>
59 </select></dd>
60 </dl>
61 <input type="submit" value="${escapetool.xml($msg.get('xe.blog.manage.create'))}"/>
62 </div>
63 </form>
64 #else ## !hasAdmin
65 #xwikimessageboxstart($msg.get('error') $msg.get('notallowed'))
66 #xwikimessageboxend()
67 #end
68
69 {{/html}}
70 {{/velocity}}