Änderungen von Dokument Section
Zuletzt geändert von xwikiadmin am 2023/10/26 09:24
Von Version 2.1
bearbeitet von xwikiadmin
am 2022/08/11 16:36
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
am 2023/10/26 09:24
Änderungskommentar:
Migrated property [type] from class [XWiki.WikiMacroParameterClass]
Zusammenfassung
-
Objekte (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,17 +1,34 @@ 1 +{{velocity output="false"}} 2 +#macro (executeMacro) 3 + #set ($discard = $xwiki.ssx.use('Confluence.Macros.Section')) 4 + #set ($discard = $xwiki.jsx.use('Confluence.Macros.Section')) 5 + #set ($hasBorder = "$!xcontext.macro.params.border") 6 + #set ($extraClass = '') 7 + #if ($hasBorder == 'true') 8 + #set ($extraClass = 'hasBorder') 9 + #end 10 + (% class="macro-section $extraClass" %)((( 11 + ## Since 11.5 the content of the macro can be edited in WYSIWYG editor. 12 + #if ($services.rendering.getMacroDescriptor($services.rendering.resolveMacroId('wikimacrocontent'))) 13 + {{wikimacrocontent /}} 14 + #else 15 + $!xcontext.macro.content 16 + #end 17 + ))) 18 +#end 19 +{{/velocity}} 20 + 21 +{{include reference="Licenses.Code.VelocityMacros"/}} 22 + 1 1 {{velocity}} 2 -#set ($discard = $xwiki.ssx.use('Confluence.Macros.Section')) 3 -#set ($discard = $xwiki.jsx.use('Confluence.Macros.Section')) 4 -#set ($hasBorder = "$!xcontext.macro.params.border") 5 -#set ($extraClass = '') 6 -#if ($hasBorder == 'true') 7 - #set ($extraClass = 'hasBorder') 24 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 25 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 26 +## don't have view right on those pages. 27 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 28 + #executeMacro 29 +#else 30 + {{error}} 31 + #getMissingLicenseMessage('proMacros.extension.name') 32 + {{/error}} 8 8 #end 9 -(% class="macro-section $extraClass" %)((( 10 - ## Since 11.5 the content of the macro can be edited in WYSIWYG editor. 11 - #if ($services.rendering.getMacroDescriptor($services.rendering.resolveMacroId('wikimacrocontent'))) 12 - {{wikimacrocontent /}} 13 - #else 14 - $!xcontext.macro.content 15 - #end 16 -))) 17 17 {{/velocity}}