Afficher les derniers auteurs
1 {{velocity}}
2 ##
3 ## Tag application.
4 ##
5 ## - See a Tag Cloud of all tags within the wiki.
6 ## - See all the pages tagged with the given tag.
7 ## - Rename a tag.
8 ## - Delete a tag.
9 ##
10 $xwiki.ssx.use('Main.Tags')##
11 $xwiki.ssx.use('Main.Dashboard')##
12 ##
13 ## Set application variables (action and tag) from URL parameters.
14 ##
15 #set($do = "$!{request.get('do')}")
16 #set($tag = "$!{request.get('tag')}")
17 ##
18 ## Macro displayTagAppTitle. Display level1 title of this app.
19 ##
20 #macro(displayTagAppTitle $tag $displayButtons)
21 <h1 class="xapp">
22 <span class="highlight tag">
23 <a href="$doc.getURL('view', "do=viewTag&amp;tag=${tag}")">$tag</a>
24 #if($xwiki.hasAdminRights() && $displayButtons)
25 <a href="$doc.getURL('view', "do=prepareRename&amp;tag=${tag}")" class="button rename" rel="nofollow">Rename</a>&nbsp;<a href="$doc.getURL('view', "do=prepareDelete&amp;tag=${tag}")" class="button delete" rel="nofollow">Delete</a>
26 #end
27 </span>
28 </h1>
29 #end
30 ##
31 ## Switch between all possible actions:
32 ## viewTag, prepareRename, rename, prepareDelete, delete, default (Tag cloud)
33 ##
34 {{html}}
35 #if($do == 'viewTag')
36 ##
37 ## View tag
38 ##
39 #displayTagAppTitle($tag true)
40 #if("$!{request.get('renamedTag')}" != '')
41 #info($msg.get('xe.tag.rename.success', [$request.get('renamedTag')]))
42 #end
43 #set ($list = $xwiki.tag.getDocumentsWithTag($tag))
44 <div>
45 <div id="dashboardleft">
46 <div id="dashboardleftcontent">
47 <h3 class="xapp"><span>$msg.get('xe.tag.alldocs', [$tag])</span></h3>
48 #displayDocumentList($list true $blacklistedSpaces)
49 </div>
50 </div>
51 <div id="dashboardright">
52 <div id="dashboardrightcontent">
53 <h3 class="xapp"><span>$msg.get("xe.tag.recentchanges", [$tag])</span></h3>
54 #set($rcTag = [$tag])
55 #includeInContext('Main.RecentChanges')
56 </div>
57 </div>
58 <div style="clear:both; margin-bottom: 40px;"><!-- --></div>
59 </div>
60 #elseif($do == 'prepareRename')
61 ##
62 ## Prepare rename tag
63 ##
64 #displayTagAppTitle($tag false)
65 <form id="renameForm" action="$doc.getURL()" method="post">
66 <div>
67 <input name="do" type="hidden" value="renameTag" />
68 <input name="tag" type="hidden" value="$tag" />
69 $msg.get('xe.tag.rename.renameto', [$tag]) <input type="text" name="renameTo" /> <span class="buttonwrapper"><input type="submit" value="$msg.get('xe.tag.rename')"/></span>
70 </div>
71 </form>
72 #elseif($do == 'renameTag')
73 ##
74 ## Rename tag
75 ##
76 #set($renameTo = "$!{request.get('renameTo')}")
77 #set($success = false)
78 #if ($renameTo != '')
79 #set($success = $xwiki.tag.renameTag($tag, $renameTo))
80 #end
81 #if ($success == true || $success == 'OK')
82 #set($encodedRenameTo = $util.encodeURI($renameTo))
83 #set($encodedTag = $util.encodeURI($tag))
84 $response.sendRedirect($doc.getURL('view', "do=viewTag&tag=${encodedRenameTo}&renamedTag=${encodedTag}"))
85 #else
86 #error($msg.get('xe.tag.rename.failure', [$tag, $renameTo]))
87 #end
88 #elseif($do == 'prepareDelete')
89 ##
90 ## Prepare delete tag
91 ##
92 #displayTagAppTitle($tag false)
93 <form id="deleteForm" action="$doc.getURL()" method="post">
94 <div>
95 <input name="do" type="hidden" value="deleteTag" />
96 <input name="tag" type="hidden" value="$tag" />
97 <span class="buttonwrapper"><input type="submit" value="$msg.get("xe.tag.delete", [$tag])" /></span>
98 </div>
99 </form>
100 #elseif($do == 'deleteTag')
101 ##
102 ## Delete tag
103 ##
104 #set($success = $xwiki.tag.deleteTag($tag))
105 #if ($success == true || $success == 'OK')
106 #set($encodedTag = $util.encodeURI($tag))
107 $response.sendRedirect($doc.getURL('view', "deletedTag=${encodedTag}"))
108 #else
109 #error($msg.get('xe.tag.delete.failure', [$tag]))
110 #end
111 #else
112 ##
113 ## View all tags (Tag Cloud)
114 ##
115 #set($tags = $xwiki.tag.getTags(true))
116 #set ($title = 'All Tags')
117 #if("$!{request.get('deletedTag')}" != '')
118 #info($msg.get('xe.tag.delete.success', [$request.get('deletedTag')]))
119 #end
120 #set($docextras = [])
121 #includeInContext("XWiki.TagCloud")
122 #end
123 {{/html}}
124 {{/velocity}}
#getBlogDocument($space $blogDoc)
XWiki Enterprise 14.5 - Documentation