Changes for page Spaces

Last modified by Thomas Mortagne on 2024/04/29 10:07

From version 4.1
edited by Admin
on 2010/07/02 12:02
Change comment: Imported from XAR
To version 5.1
edited by Admin
on 2011/02/07 13:37
Change comment: Imported from XAR

Summary

Details

Page properties
Content
... ... @@ -1,90 +1,1 @@
1 -{{velocity}}
2 -##
3 -## List spaces within the wiki.
4 -##
5 -$xwiki.ssx.use("Main.Spaces")##
6 -##
7 -## List of spaces in this wiki.
8 -## This page allow to display spaces within this wiki and to delete any space.
9 -## Only wiki administrators are allowed to delete spaces.
10 -##
11 -## Optional HTTP parameter :
12 -## deleteSpace name of a space to delete.
13 -##
14 -## Delete space if requested.
15 -##
16 -#set($spaceToDelete = "$!request.getParameter('deleteSpace')")
17 -#if("$!spaceToDelete" != '' && $xwiki.hasAdminRights())
18 - #foreach ($page in $xwiki.getSpaceDocsName($spaceToDelete))
19 - #set($discard = $xwiki.getDocument("${spaceToDelete}.${page}").delete())
20 - #end
21 - {{info}}Space ”${spaceToDelete}“ deleted.{{/info}}
22 - #set($xredirect = "$!request.getParameter('xredirect')")
23 - ## Redirect to the previous page if requested.
24 - #if("$!xredirect" != '')
25 - $response.sendRedirect($xredirect)
26 - #end
27 -#end
28 -#set($spaceList = $xwiki.getSpaces())
29 -## Get this very doc, useful when it is included from another one.
30 -#set($spaceListDoc = $xwiki.getDocument('Main.Spaces'))
31 -{{html wiki="true"}}
32 -<ul class="xlist">
33 - ##
34 - ## List spaces.
35 - ##
36 - #foreach($space in $spaceList)
37 - ## Display space only if the user has view right on space home and if the space is not blacklisted.
38 - ## $blacklistedSpaces is set in xwikivars.vm
39 - #if($xwiki.hasAccessLevel('view', "${space}.WebHome") && !$blacklistedSpaces.contains($space))
40 - <li class="xitem xunderline xhighlight space">
41 - <div class="xitemcontainer">
42 - <div class="spSpaceName">[[${space}>>${space}.WebHome]]</div>
43 - <div class="xshowonhover spSpaceActions">
44 - ## Link to the space index.
45 - <a href="$xwiki.getURL('Main.SpaceIndex', 'view', "space=$escapetool.url($space)")" title="$msg.get('xe.spaces.action.index')">
46 - <img src="$xwiki.getSkinFile('icons/silk/book_open.gif')" alt="Space index icon"/>
47 - </a>
48 - ## If the user has admin right on the space display links to administration and delete.
49 - #if($xwiki.hasAccessLevel('admin', "${space}.XWikiPreferences"))
50 - <a href="$xwiki.getURL("${space}.WebPreferences", 'admin')" title="$msg.get('xe.spaces.action.admin')">
51 - <img src="$xwiki.getSkinFile('icons/silk/cog.gif')" alt="Administrate space icon"/>
52 - </a>
53 - ## <a href="#" onclick="confirm('ALL THE PAGES WITHIN THE SPACE &ldquo;${space}&rdquo; WILL BE DELETED, are you sure that you want to continue ?'); this.href='$spaceListDoc.getURL('view', "deleteSpace=${space}&amp;xredirect=$doc.getExternalURL()")'" title="$msg.get('xe.spaces.action.delete')">
54 - ## <img src="$xwiki.getSkinFile('icons/silk/cross.gif')" alt="Delete space icon" />
55 - ##</a>
56 - #end
57 - </div>
58 - <div class="xspacer">&nbsp;</div>
59 - </div>
60 - </li>
61 - #end
62 - #end
63 - ##
64 - ## Space creation.
65 - ##
66 - #if($xwiki.hasAdminRights())
67 - <li id="spSpaceCreateItem" class="xitem space">
68 - <div class="xitemcontainer">
69 - <div id="spSpaceCreateLabel" class="spSpaceName"><a href="$xwiki.getURL('XWiki.CreatePage', 'view', 'tocreate=space')" onclick="toggleClass($('spSpaceCreateForm'), 'hidden'); return false;">$msg.get('xe.spaces.createspace')</a></div>
70 - <div class="spacer">&nbsp;</div>
71 - <div id="spSpaceCreateForm" class="hidden">
72 - <form method="post" action="$doc.getURL('view', 'xpage=create')">
73 - <div>
74 - <input name="tocreate" type="hidden" value="space" />
75 - #set($newSpaceName = $msg.get('xe.spaces.createspace.defaultname'))
76 - <label class="hidden" for="spSpaceCreateTextInput">$newSpaceName</label>
77 - <input id="spSpaceCreateTextInput" type="text" name="space" value="$newSpaceName" class="panelinput" onfocus="if(this.value=='$newSpaceName') this.value=''" onblur="if(this.value=='') this.value='$newSpaceName'" />
78 - <span class="buttonwrapper">
79 - <input type="submit" value="$msg.get('xe.spaces.createspace.submit')" class="button" />
80 - </span>
81 - </div>
82 - </form>
83 - </div>
84 - <div class="spacer">&nbsp;</div>
85 - </div>
86 - </li>
87 - #end
88 -</ul>
89 -{{/html}}
90 -{{/velocity}}
1 +{{spaces /}}
XWiki.StyleSheetExtension[0]
Caching policy
... ... @@ -1,1 +1,1 @@
1 -default
1 +long
Name
... ... @@ -1,1 +1,1 @@
1 -XWiki.Spaces
1 +Spaces list CSS
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,0 +1,64 @@
1 +{{velocity}}
2 +##
3 +## List spaces within the wiki.
4 +##
5 +$xwiki.ssx.use('Main.Spaces')##
6 +#set($spaceList = $xwiki.getSpaces())
7 +{{html wiki="true"}}
8 +<ul class="xlist">
9 + ##
10 + ## List spaces.
11 + ##
12 + #foreach($space in $spaceList)
13 + ## Display space only if the user has view right on space home and if the space is not blacklisted.
14 + ## $blacklistedSpaces is set in xwikivars.vm
15 + #if($xwiki.hasAccessLevel('view', "${space}.WebHome") && !$blacklistedSpaces.contains($space))
16 + <li class="xitem xunderline xhighlight space">
17 + <div class="xitemcontainer">
18 + <div class="spSpaceName">[[${space}>>${space}.WebHome]]</div>
19 + <div class="xshowonhover spSpaceActions">
20 + ## Link to the space index.
21 + <a href="{{html wiki="false"}}$xwiki.getURL('Main.SpaceIndex', 'view', "space=$escapetool.url($space)"){{/html}}" title="$msg.get('xe.spaces.action.index')">
22 + <img src="{{html wiki="false"}}$xwiki.getSkinFile('icons/silk/book_open.gif'){{/html}}" alt="$msg.get('xe.spaces.action.index.alt')"/>
23 + </a>
24 + ## If the user has admin right on the space display links to administration and delete.
25 + #if($xwiki.hasAccessLevel('admin', "${space}.XWikiPreferences"))
26 + <a href="{{html wiki="false"}}$xwiki.getURL("${space}.WebPreferences", 'admin'){{/html}}" title="$msg.get('xe.spaces.action.admin')">
27 + <img src="{{html wiki="false"}}$xwiki.getSkinFile('icons/silk/cog.gif'){{/html}}" alt="$msg.get('xe.spaces.action.admin.alt')"/>
28 + </a>
29 + #end
30 + </div>
31 + <div class="xspacer">&nbsp;</div>
32 + </div>
33 + </li>
34 + #end
35 + #end
36 + ##
37 + ## Space creation.
38 + ##
39 + #if($xwiki.hasAdminRights())
40 + <li id="spSpaceCreateItem" class="xitem space">
41 + <div class="xitemcontainer">
42 + <div id="spSpaceCreateLabel" class="spSpaceName"><a href="{{html wiki="false"}}$xwiki.getURL('XWiki.CreatePage', 'view', 'tocreate=space'){{/html}}" onclick="toggleClass($('spSpaceCreateForm'), 'hidden'); return false;">$msg.get('xe.spaces.createspace')</a></div>
43 + <div class="spacer">&nbsp;</div>
44 + <div id="spSpaceCreateForm" class="hidden">
45 + <form method="post" action="{{html wiki="false"}}$doc.getURL('view', 'xpage=create'){{/html}}">
46 + <div>
47 + <input name="tocreate" type="hidden" value="space" />
48 + #set($newSpaceName = $escapetool.xml($msg.get('xe.spaces.createspace.defaultname')))
49 + <label class="hidden" for="spSpaceCreateTextInput">$newSpaceName</label>
50 + <input id="spSpaceCreateTextInput" type="text" name="space" value="$newSpaceName" class="panelinput withTip" />
51 + <span class="buttonwrapper">
52 + <input type="submit" value="$msg.get('xe.spaces.createspace.submit')" class="button" />
53 + </span>
54 + </div>
55 + </form>
56 + </div>
57 + <div class="spacer">&nbsp;</div>
58 + </div>
59 + </li>
60 + #end
61 +</ul>
62 +{{/html}}
63 +{{/velocity}}
64 +
Macro content availability
... ... @@ -1,0 +1,1 @@
1 +No content
Default category
... ... @@ -1,0 +1,1 @@
1 +Navigation
Macro description
... ... @@ -1,0 +1,1 @@
1 +Displays all the spaces in this wiki.
Macro id
... ... @@ -1,0 +1,1 @@
1 +spaces
Macro name
... ... @@ -1,0 +1,1 @@
1 +Spaces
Supports inline mode
... ... @@ -1,0 +1,1 @@
1 +No
Macro visibility
... ... @@ -1,0 +1,1 @@
1 +Current Wiki