Changes for page Pages on this Wiki
Last modified by Leo Wei on 2023/12/29 09:40
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -60,3 +60,66 @@ 60 60 {{/html}} 61 61 #set($docextras=[]) 62 62 {{/velocity}} 63 + 64 +{{velocity}} 65 +##================ 66 +## Find which tab to display 67 +##================ 68 +#if("$!{view}" == '') 69 + #set($view = $request.getParameter('view')) 70 + #if("$!{view}" == '') 71 + #set ($view = 'index') 72 + #end 73 +#end 74 +##======== 75 +## Set Tab Data 76 +##======== 77 +#set($tabs = []) 78 +#macro(addAllDocsTab $tab) 79 + #if($xwiki.hasAccessLevel('view', "$!xcontext.user", $tab.get('document'))) 80 + #set($discard = $tabs.add($tab)) 81 + #end 82 +#end 83 +#addAllDocsTab({'tabName' : 'index', 'idSuffix' : 'index', 'translationKey' : 'platform.index', 'document' : 'XWiki.Tableview'}) 84 +#addAllDocsTab({'tabName' : 'tree', 'idSuffix' : 'treeview', 'translationKey' : 'platform.index.tree', 'document' : 'XWiki.Treeview'}) 85 +#if ($services.parentchild.isParentChildMechanismEnabled()) 86 + #addAllDocsTab({'tabName' : 'orphans', 'idSuffix' : 'orphansview', 'translationKey' : 'platform.index.orphaned', 'document' : 'XWiki.OrphanedPages'}) 87 +#end 88 +#addAllDocsTab({'tabName' : 'attachments', 'idSuffix' : 'attachments', 'translationKey' : 'platform.index.attachments', 'document' : 'XWiki.AllAttachments'}) 89 +#addAllDocsTab({'tabName' : 'deletedDocs', 'idSuffix' : 'deletedDocs', 'translationKey' : 'platform.index.documentsTrash', 'document' : 'XWiki.DeletedDocuments'}) 90 +#addAllDocsTab({'tabName' : 'deletedAttachments', 'idSuffix' : 'deletedAttachments', 'translationKey' : 'platform.index.attachmentsTrash', 'document' : 'XWiki.DeletedAttachments'}) 91 +##============================================= 92 +## Add External Links tab if the LinkChecker module is present. 93 +## TODO: In the future replace this hardcoded link with Interface Extensions 94 +##============================================= 95 +#if($services.rendering.defaultTransformationNames.contains('linkchecker') && $services.linkchecker) 96 + #set ($dummy = $tabs.add({'tabName' : 'externalLinks', 'idSuffix' : 'externalLinks', 'translationKey' : 'platform.linkchecker.indexTab', 'document' : 'XWiki.ExternalLinks'})) 97 +#end 98 +##=========== 99 +## Display the Tabs 100 +##=========== 101 +{{html}} 102 +<div class="floatcontainer"> 103 + <ul class="xwikitabbar"> 104 +#foreach ($tab in $tabs) 105 + <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> 106 +#end 107 + </ul> 108 +</div> 109 +{{/html}} 110 + 111 +##========================== 112 +## Include the Tab data for the selected Tab 113 +##========================== 114 +{{html wiki="true"}} 115 +<div class='xwikitabpanescontainer'> 116 +#foreach ($tab in $tabs) 117 + #if ($tab['tabName'] == $view) 118 + {{include reference="$tab['document']"/}} 119 + #break 120 + #end 121 +#end 122 +</div> 123 +{{/html}} 124 +#set($docextras=[]) 125 +{{/velocity}}