Wiki source code of Pages on this Wiki
Last modified by Aurelie Bertrand on 2024/09/13 16:14
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
2.1 | 1 | {{livetableExporter livetable="AllDocs"/}} |
2 | |||
![]() |
1.1 | 3 | {{velocity}} |
4 | ##================ | ||
5 | ## Find which tab to display | ||
6 | ##================ | ||
7 | #if("$!{view}" == '') | ||
8 | #set($view = $request.getParameter('view')) | ||
9 | #if("$!{view}" == '') | ||
10 | #set ($view = 'index') | ||
11 | #end | ||
12 | #end | ||
13 | ##======== | ||
14 | ## Set Tab Data | ||
15 | ##======== | ||
16 | #set($tabs = []) | ||
17 | #macro(addAllDocsTab $tab) | ||
18 | #if($xwiki.hasAccessLevel('view', "$!xcontext.user", $tab.get('document'))) | ||
19 | #set($discard = $tabs.add($tab)) | ||
20 | #end | ||
21 | #end | ||
22 | #addAllDocsTab({'tabName' : 'index', 'idSuffix' : 'index', 'translationKey' : 'platform.index', 'document' : 'XWiki.Tableview'}) | ||
23 | #addAllDocsTab({'tabName' : 'tree', 'idSuffix' : 'treeview', 'translationKey' : 'platform.index.tree', 'document' : 'XWiki.Treeview'}) | ||
24 | #if ($services.parentchild.isParentChildMechanismEnabled()) | ||
25 | #addAllDocsTab({'tabName' : 'orphans', 'idSuffix' : 'orphansview', 'translationKey' : 'platform.index.orphaned', 'document' : 'XWiki.OrphanedPages'}) | ||
26 | #end | ||
27 | #addAllDocsTab({'tabName' : 'attachments', 'idSuffix' : 'attachments', 'translationKey' : 'platform.index.attachments', 'document' : 'XWiki.AllAttachments'}) | ||
28 | #addAllDocsTab({'tabName' : 'deletedDocs', 'idSuffix' : 'deletedDocs', 'translationKey' : 'platform.index.documentsTrash', 'document' : 'XWiki.DeletedDocuments'}) | ||
29 | #addAllDocsTab({'tabName' : 'deletedAttachments', 'idSuffix' : 'deletedAttachments', 'translationKey' : 'platform.index.attachmentsTrash', 'document' : 'XWiki.DeletedAttachments'}) | ||
30 | ##============================================= | ||
31 | ## Add External Links tab if the LinkChecker module is present. | ||
32 | ## TODO: In the future replace this hardcoded link with Interface Extensions | ||
33 | ##============================================= | ||
34 | #if($services.rendering.defaultTransformationNames.contains('linkchecker') && $services.linkchecker) | ||
35 | #set ($dummy = $tabs.add({'tabName' : 'externalLinks', 'idSuffix' : 'externalLinks', 'translationKey' : 'platform.linkchecker.indexTab', 'document' : 'XWiki.ExternalLinks'})) | ||
36 | #end | ||
37 | ##=========== | ||
38 | ## Display the Tabs | ||
39 | ##=========== | ||
40 | {{html}} | ||
41 | <div class="floatcontainer"> | ||
42 | <ul class="xwikitabbar"> | ||
43 | #foreach ($tab in $tabs) | ||
44 | <li id="xwiki$tab['idSuffix']"#if($view == $tab['tabName']) class="active"#end><a href="$doc.getURL('view', "view=$tab['tabName']&$!param")">$services.localization.render($tab['translationKey'])</a></li> | ||
45 | #end | ||
46 | </ul> | ||
47 | </div> | ||
48 | {{/html}} | ||
49 | |||
50 | ##========================== | ||
51 | ## Include the Tab data for the selected Tab | ||
52 | ##========================== | ||
53 | {{html wiki="true"}} | ||
54 | <div class='xwikitabpanescontainer'> | ||
55 | #foreach ($tab in $tabs) | ||
56 | #if ($tab['tabName'] == $view) | ||
57 | {{include reference="$tab['document']"/}} | ||
58 | #break | ||
59 | #end | ||
60 | #end | ||
61 | </div> | ||
62 | {{/html}} | ||
63 | #set($docextras=[]) | ||
64 | {{/velocity}} | ||
![]() |
2.1 | 65 | |
66 |