Wiki source code of Pages on this Wiki

Last modified by Thomas Mortagne on 2015/11/23 11:40

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