Changes for page Rangee Index

Last modified by Tobias Wintrich on 2025/06/04 09:20

From version 12.31
edited by Tobias Wintrich
on 2021/09/28 12:01
Change comment: There is no comment for this version
To version 11.11
edited by Tobias Wintrich
on 2021/09/28 10:23
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,28 +1,20 @@
1 1  {{velocity}}
2 -##{{tree links="true" edges="false"}}
2 +{{tree links="true" edges="false"}}
3 3  #set($depth = $wikimacro.parameters.depth)
4 -#if ($xcontext.locale == 'de')
5 - #set($locale = '')
6 -#else
7 - #set($locale = $xcontext.locale)
8 -#end
9 9  {{html wiki=true}}
10 -language $locale
11 11  <ul>
12 12   #set($results = false)
13 13   #set ($query = $services.query.xwql('where doc.parent = :doc and doc.hidden = 0 order by doc.title asc'))
14 - #set($results = $query.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute())
8 + #set($results = $query.bindValue('doc', $doc.fullName).addFilter('currentlanguage').execute())
15 15   #foreach($docname in $results)
16 16   #set($rdoc = $xwiki.getDocument($docname).getTranslatedDocument())
17 - #if ($locale == $rdoc.getLanguage())
18 - <li class="
19 - #if ($depth > 0)
20 - jstree-open
21 - #end
22 - ">
23 - [[$rdoc.getDisplayTitle()>>$rdoc.fullName]]
24 - </li>
11 + <li class="
12 + #if ($depth > 0)
13 + jstree-open $depth
25 25   #end
15 + ">
16 + [[$rdoc.getDisplayTitle()>>$rdoc.fullName]]
17 + </li>
26 26   #set($results2 = false)
27 27   #set($query2 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
28 28   #set($results2 = $query2.bindValue('doc', $docname).addFilter('currentlanguage').execute())
... ... @@ -29,9 +29,9 @@
29 29   <ul>
30 30   #foreach($rdoc in $results2)
31 31   #set($rdoc2 = $xwiki.getDocument($rdoc).getTranslatedDocument())
32 - <li class="$rdoc.getLanguage()
24 + <li class="
33 33   #if ($depth > 1)
34 - jstree-open
26 + jstree-open $depth
35 35   #end
36 36   ">
37 37   [[$rdoc2.getDisplayTitle()>>$rdoc2.fullName]]
... ... @@ -44,7 +44,7 @@
44 44   #set($rdoc3 = $xwiki.getDocument($rdoc2).getTranslatedDocument())
45 45   <li class="
46 46   #if ($depth > 2)
47 - jstree-open
39 + jstree-open $depth
48 48   #end
49 49   ">
50 50   [[$rdoc3.getDisplayTitle()>>$rdoc3.fullName]]
... ... @@ -57,7 +57,7 @@
57 57   #set($rdoc4 = $xwiki.getDocument($rdoc3).getTranslatedDocument())
58 58   <li class="
59 59   #if ($depth > 3)
60 - jstree-open
52 + jstree-open $depth
61 61   #end
62 62   ">
63 63   [[$rdoc4.getDisplayTitle()>>$rdoc4.fullName]]
... ... @@ -87,5 +87,5 @@
87 87  </ul>
88 88  
89 89  {{/html}}
90 -##{{/tree}}
82 +{{/tree}}
91 91  {{/velocity}}