Changes for page Rangee Index

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

From version 12.32
edited by Tobias Wintrich
on 2021/09/28 12:02
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,15 +29,13 @@
29 29   <ul>
30 30   #foreach($rdoc in $results2)
31 31   #set($rdoc2 = $xwiki.getDocument($rdoc).getTranslatedDocument())
32 - #if ($locale == $rdoc.getLanguage())
33 - <li class="$rdoc.getLanguage()
34 - #if ($depth > 1)
35 - jstree-open
36 - #end
37 - ">
38 - [[$rdoc2.getDisplayTitle()>>$rdoc2.fullName]]
39 - </li>
40 - #end
24 + <li class="
25 + #if ($depth > 1)
26 + jstree-open $depth
27 + #end
28 + ">
29 + [[$rdoc2.getDisplayTitle()>>$rdoc2.fullName]]
30 + </li>
41 41   #set($results3 = false)
42 42   #set($query3 = $services.query.xwql('where doc.parent=:doc and doc.hidden = 0 order by doc.title asc'))
43 43   #set($results3 = $query3.bindValue('doc', $rdoc).addFilter('currentlanguage').execute())
... ... @@ -46,7 +46,7 @@
46 46   #set($rdoc3 = $xwiki.getDocument($rdoc2).getTranslatedDocument())
47 47   <li class="
48 48   #if ($depth > 2)
49 - jstree-open
39 + jstree-open $depth
50 50   #end
51 51   ">
52 52   [[$rdoc3.getDisplayTitle()>>$rdoc3.fullName]]
... ... @@ -59,7 +59,7 @@
59 59   #set($rdoc4 = $xwiki.getDocument($rdoc3).getTranslatedDocument())
60 60   <li class="
61 61   #if ($depth > 3)
62 - jstree-open
52 + jstree-open $depth
63 63   #end
64 64   ">
65 65   [[$rdoc4.getDisplayTitle()>>$rdoc4.fullName]]
... ... @@ -89,5 +89,5 @@
89 89  </ul>
90 90  
91 91  {{/html}}
92 -##{{/tree}}
82 +{{/tree}}
93 93  {{/velocity}}