Изменения документа Поддомены2
отредактировано Andrey Shilin
на 2025/04/28 14:40
на 2025/04/28 14:40
отредактировано Andrey Shilin
на 2024/12/24 11:22
на 2024/12/24 11:22
Изменить комментарий:
Imported from XAR
Комментарий
-
Свойства страницы (1 изменено, 0 добавлено, 0 удалено)
-
Объекты (1 изменено, 0 добавлено, 0 удалено)
Подробности
- Свойства страницы
-
- Содержимое
-
... ... @@ -16,9 +16,7 @@ 16 16 #set ($selfShow = true) 17 17 #end 18 18 #end 19 -#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%'") 20 -#set($query = $services.query.hql($q).execute()) 21 -#foreach ($child in $query) 19 +#foreach ($child in $mainDoc.getChildrenReferences()) 22 22 #set ($childDoc = $xwiki.getDocument($child).getTranslatedDocument()) 23 23 #set ($xobject = $childDoc.getObject('SUZ.Code.SubDomainClass')) 24 24 #if ($xobject) ##Включаем только страницы с SubDomainClass ... ... @@ -41,7 +41,7 @@ 41 41 #set($row = "Все") 42 42 #end 43 43 #set ($menuSubDomains = [{"title": '', "value": $row}]) 44 -#set ($discard = $menuSubDomains.addAll($ collectiontool.sort($subdomains, ["title", "value"])))42 +#set ($discard = $menuSubDomains.addAll($sorttool.sort($subdomains, ["title", "value"]))) 45 45 #foreach ($row in $menuSubDomains) 46 46 #if ($row.title == $currentSubDomain and $selfShow) 47 47 * **$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}}