Modifications pour le document Espaces
Modifié par superadmin le 2021/12/12 21:39
modifié par Administrator
sur 2013/06/04 10:06
sur 2013/06/04 10:06
modifié par Paul Libbrecht (admin)
sur 2016/07/26 21:56
sur 2016/07/26 21:56
Commentaire de modification :
Install extension [org.xwiki.platform:xwiki-platform-index-ui-8.2]
Résumé
Détails
- Propriétés de la Page
-
- Titre
-
... ... @@ -1,1 +1,1 @@ 1 -$services.localization.render(' xe.spaces')1 +$services.localization.render('index.spacesMacro.title') - Auteur du document
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. Admin1 +XWiki.adminPolx - Masqué
-
... ... @@ -1,1 +1,1 @@ 1 - false1 +true
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -3,7 +3,7 @@ 3 3 ## List spaces within the wiki. 4 4 ## 5 5 $xwiki.ssx.use('Main.Spaces')## 6 -#set($spaceList = $xwi ki.getSpaces())6 +#set($spaceList = $services.query.xwql('select distinct doc.space from Document doc order by doc.space').addFilter('hidden').execute()) 7 7 {{html}} 8 8 <ul class="xlist"> 9 9 ## ... ... @@ -12,7 +12,7 @@ 12 12 #foreach($space in $spaceList) 13 13 ## Display space only if the user has view right on space home and if the space is not blacklisted. 14 14 ## $blacklistedSpaces is set in xwikivars.vm 15 - #set ($spaceHomeDocumentReference = $services.model. createDocumentReference($xcontext.database, $space, 'WebHome'))15 + #set ($spaceHomeDocumentReference = $services.model.resolveSpace($space)) 16 16 #if($xwiki.hasAccessLevel('view', $services.model.serialize($spaceHomeDocumentReference)) && !$blacklistedSpaces.contains($space)) 17 17 <li class="xitem xunderline xhighlight space"> 18 18 <div class="xitemcontainer"> ... ... @@ -19,14 +19,14 @@ 19 19 <div class="spSpaceName"><a href="$xwiki.getURL($spaceHomeDocumentReference)">${escapetool.xml($space)}</a></div> 20 20 <div class="xshowonhover spSpaceActions"> 21 21 ## Link to the space index. 22 - <a href="$xwiki.getURL('Main.SpaceIndex', 'view', "space=$escapetool.url($space)")" title="$services.localization.render(' xe.spaces.action.index')">23 - <img src="$xwiki.getSkinFile('icons/silk/book_open.png')" alt="$services.localization.render(' xe.spaces.action.index.alt')"/>22 + <a href="$xwiki.getURL('Main.SpaceIndex', 'view', "space=$escapetool.url($space)")" title="$services.localization.render('index.spacesMacro.spaceIndex.title')"> 23 + <img src="$xwiki.getSkinFile('icons/silk/book_open.png')" alt="$services.localization.render('index.spacesMacro.spaceIndex.alt')"/> 24 24 </a> 25 25 ## If the user has admin right on the space display links to administration and delete. 26 - #set ($spacePreferencesDocumentReference = $services.model.create DocumentReference($xcontext.database, $space, 'WebPreferences'))26 + #set ($spacePreferencesDocumentReference = $services.model.createEntityReference('WebPreferences', 'DOCUMENT', $spaceHomeDocumentReference)) 27 27 #if($xwiki.hasAccessLevel('admin', $services.model.serialize($spacePreferencesDocumentReference))) 28 - <a href="$xwiki.getURL($spacePreferencesDocumentReference, 'admin', '')" title="$services.localization.render(' xe.spaces.action.admin')">29 - <img src="$xwiki.getSkinFile('icons/silk/wrench.png')" alt="$services.localization.render(' xe.spaces.action.admin.alt')"/>28 + <a href="$xwiki.getURL($spacePreferencesDocumentReference, 'admin', '')" title="$services.localization.render('index.spacesMacro.spaceAdministration.title')"> 29 + <img src="$xwiki.getSkinFile('icons/silk/wrench.png')" alt="$services.localization.render('index.spacesMacro.spaceAdministration.alt')"/> 30 30 </a> 31 31 #end 32 32 </div> ... ... @@ -38,21 +38,22 @@ 38 38 ## 39 39 ## Space creation. 40 40 ## 41 - ## Only if the current user has admin rights and the current action is not inline. If it's inline, then there is already a form, and if we render the second, nested one, the DOM is messed up in IE. 42 - #if($xwiki.hasAdminRights() && "$!context.action" != "inline") 41 + ## Only if the current user has the right to create spaces and the current action is not inline. 42 + ## If it's inline, then there is already a form, and if we render the second, nested one, the DOM is messed up in IE. 43 + #if($hasCreateSpace && "$!xcontext.action" != "inline" && "$!xcontext.action" != "edit") 43 43 <li id="spSpaceCreateItem" class="xitem space"> 44 44 <div class="xitemcontainer"> 45 - <div id="spSpaceCreateLabel" class="spSpaceName"><a href="$xwiki.getURL('XWiki.CreatePage', 'view', 'tocreate=space')" onclick="toggleClass($('spSpaceCreateForm'), 'hidden'); return false;">$services.localization.render(' xe.spaces.createspace')</a></div>46 + <div id="spSpaceCreateLabel" class="spSpaceName"><a href="$xwiki.getURL('XWiki.CreatePage', 'view', 'tocreate=space')" onclick="toggleClass($('spSpaceCreateForm'), 'hidden'); return false;">$services.localization.render('index.spacesMacro.createSpace.link')</a></div> 46 46 <div class="spacer"> </div> 47 47 <div id="spSpaceCreateForm" class="hidden"> 48 48 <form method="post" action="$doc.getURL('create')" class="xformInline"> 49 49 <div> 50 50 <input name="tocreate" type="hidden" value="space" /> 51 - #set($newSpaceName = $escapetool.xml($services.localization.render(' xe.spaces.createspace.defaultname')))52 + #set($newSpaceName = $escapetool.xml($services.localization.render('index.spacesMacro.createSpace.defaultSpaceName'))) 52 52 <label class="hidden" for="spSpaceCreateTextInput">$newSpaceName</label> 53 53 <input id="spSpaceCreateTextInput" type="text" name="space" value="$newSpaceName" class="panelinput withTip" /> 54 54 <span class="buttonwrapper"> 55 - <input type="submit" value="$services.localization.render(' xe.spaces.createspace.submit')" class="button" />56 + <input type="submit" value="$services.localization.render('index.spacesMacro.createSpace.submit')" class="button" /> 56 56 </span> 57 57 </div> 58 58 </form>