Изменения документа Поддомены2
отредактировано Andrey Shilin
на 2025/07/10 15:52
на 2025/07/10 15:52
отредактировано Andrey Shilin
на 2024/12/24 11:22
на 2024/12/24 11:22
Изменить комментарий:
Imported from XAR
Комментарий
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
-
Объекты (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -5,8 +5,6 @@ 5 5 #if ($request.getCookie('subdomain')) 6 6 #set($cookie = $request.getCookie('subdomain')) 7 7 #set ($currentSubDomain = $util.decodeURI($cookie.value)) 8 -#elseif($request.get('subdomain')) 9 - #set ($currentSubDomain = $request.get('subdomain')) 10 10 #end 11 11 #set ($mainDoc = $xwiki.getDocument('Main.WebHome')) 12 12 #set ($subdomains= [] ) ... ... @@ -18,9 +18,7 @@ 18 18 #set ($selfShow = true) 19 19 #end 20 20 #end 21 -#set($q = "select doc.fullName from XWikiDocument as doc, BaseObject as obj where doc.fullName = obj.name and obj.className like 'SUZ.Code.SubDomainClass' and doc.space not like '%Sandbox%'") 22 -#set($query = $services.query.hql($q).execute()) 23 -#foreach ($child in $query) 19 +#foreach ($child in $mainDoc.getChildrenReferences()) 24 24 #set ($childDoc = $xwiki.getDocument($child).getTranslatedDocument()) 25 25 #set ($xobject = $childDoc.getObject('SUZ.Code.SubDomainClass')) 26 26 #if ($xobject) ##Включаем только страницы с SubDomainClass ... ... @@ -28,15 +28,12 @@ 28 28 #if ($docTitle == '') 29 29 #set ($docTitle = $childDoc.getDocumentReference().getParent().getName()) 30 30 #end 31 - #set($docRef = $childDoc.getDocumentReference().getParent().getName()) 32 32 #if($selfShow) 33 - #set($row = '[[' + $docTitle + '>>' + $doc.getTranslatedDocument() + '||value="' + $escapetool.xml($doc Ref) + '"]]')28 + #set($row = '[[' + $docTitle + '>>' + $doc.getTranslatedDocument() + '||value="' + $escapetool.xml($docTitle) + '"]]') 34 34 #else 35 35 #set($row = $docTitle) 36 36 #end 37 - #set($sortCode = "99999999") 38 - #set($sortCode = $xobject.getValue('sortCode')) 39 - #set ($discard = $subdomains.add({"title": $docTitle, "value": $row, "docRef":$docRef,"sortCode":$sortCode})) 32 + #set ($discard = $subdomains.add({"title": $docTitle, "value": $row})) 40 40 #end 41 41 #end 42 42 ## Пункт "Все" ... ... @@ -45,10 +45,10 @@ 45 45 #else 46 46 #set($row = "Все") 47 47 #end 48 -#set ($menuSubDomains = [{"title": '', " docRef":'',"value": $row}])49 -#set ($discard = $menuSubDomains.addAll($ collectiontool.sort($subdomains, ["sortCode","title", "value"])))41 +#set ($menuSubDomains = [{"title": '', "value": $row}]) 42 +#set ($discard = $menuSubDomains.addAll($sorttool.sort($subdomains, ["title", "value"]))) 50 50 #foreach ($row in $menuSubDomains) 51 -#if ($row. docRef== $currentSubDomain and $selfShow)44 +#if ($row.title == $currentSubDomain and $selfShow) 52 52 * **$row.value** 53 53 #else 54 54 * $row.value
- XWiki.UIExtensionClass[0]
-
- Executed Content
-
... ... @@ -1,21 +1,18 @@ 1 -{{velocity output="false"}}1 +{{velocity}} 2 2 ##Показать меню подразжелов только на определенных страницах 3 -#set ($classesForMenu = ['SUZ.Materials.Code.MaterialsSectionClass', 'SUZ.Methodology.Code.MethodologySectionClass', 'SUZ.Indicators.Code.IndicatorsClass']) ##Массив классов, где нужно показывать меню 4 -#set($q = "select doc.fullName from XWikiDocument as doc, BaseObject as obj where doc.fullName = obj.name and obj.className like 'SUZ.Code.SubDomainClass' and doc.space not like '%Sandbox%' and doc.fullName not like '%SUZ%'") 5 -#set($query = $services.query.hql($q).execute()) 6 -#set ($selfShow = false) 7 -#set ($objNames = $doc.getxWikiObjects().keySet()) ##Список наименований классов в текущем объекте 8 -#foreach ($obj in $objNames) 9 - #if ($classesForMenu.contains($obj) && $query.size() > 0) 10 - #set ($selfShow = true) 11 - #end 12 -#end 13 -{{/velocity}}{{velocity}} 14 -#if($selfShow) 3 +###set ($classesForMenu = ['SUZ.Materials.Code.MaterialsSectionClass', 'SUZ.Methodology.Code.MethodologySectionClass', 'SUZ.Indicators.Code.IndicatorsClass']) ##Массив классов, где нужно показывать меню 4 +###set ($selfShow = false) 5 +###set ($objNames = $doc.getxWikiObjects().keySet()) ##Список наименований классов в текущем объекте 6 +###foreach ($obj in $objNames) 7 +## #if ($classesForMenu.contains($obj)) 8 +## #set ($selfShow = true) 9 +## #end 10 +###end 11 +###if ($selfShow) ##Условие показа меню 15 15 #panelheader($services.localization.render('suz.menu.'+'Поддомены')) 16 16 {{menu type="vertical collapsible open" id="subdomains"}} 17 17 {{include reference="$uix.doc.documentReference" /}} 18 18 {{/menu}} 19 19 #panelfooter() 20 -#end 17 +###end 21 21 {{/velocity}}