Änderungen von Dokument Layout Cell 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 3.1
bearbeitet von xwikiadmin
am 2023/04/25 10:54
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros/1.7.1]

Zusammenfassung

Details

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