Änderungen von Dokument Layout Section Macro

Zuletzt geändert von xwikiadmin am 2023/10/26 09:24

Von Version 2.1
bearbeitet von xwikiadmin
am 2022/08/11 16:36
Änderungskommentar: Migrated property [defaultCategories] from class [XWiki.WikiMacroClass]
Auf Version 4.1
bearbeitet von xwikiadmin
am 2023/10/26 09:24
Änderungskommentar: Migrated property [type] from class [XWiki.WikiMacroParameterClass]

Zusammenfassung

Details

XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -1,12 +1,29 @@
1 +{{velocity output="false"}}
2 +#macro (executeMacro)
3 + #set ($discard = $xwiki.ssx.use('Confluence.Macros.LayoutSection'))
4 + #set ($cssLayoutClass = $xcontext.macro.params.get('ac:type'))
5 + (% class="macro-layout-section $cssLayoutClass" %)(((
6 + ## Since 11.5 the content of the macro can be edited in WYSIWYG editor.
7 + #if ($services.rendering.getMacroDescriptor($services.rendering.resolveMacroId('wikimacrocontent')))
8 + {{wikimacrocontent /}}
9 + #else
10 + $!xcontext.macro.content
11 + #end
12 + )))
13 +#end
14 +{{/velocity}}
15 +
16 +{{include reference="Licenses.Code.VelocityMacros"/}}
17 +
1 1  {{velocity}}
2 -#set ($discard = $xwiki.ssx.use('Confluence.Macros.LayoutSection'))
3 -#set ($cssLayoutClass = $xcontext.macro.params.get('ac:type'))
4 -(% class="macro-layout-section $cssLayoutClass" %)(((
5 - ## Since 11.5 the content of the macro can be edited in WYSIWYG editor.
6 - #if ($services.rendering.getMacroDescriptor($services.rendering.resolveMacroId('wikimacrocontent')))
7 - {{wikimacrocontent /}}
8 - #else
9 - $!xcontext.macro.content
10 - #end
11 -)))
19 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
20 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
21 +## don't have view right on those pages.
22 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
23 + #executeMacro
24 +#else
25 + {{error}}
26 + #getMissingLicenseMessage('proMacros.extension.name')
27 + {{/error}}
28 +#end
12 12  {{/velocity}}