Zuletzt geändert von xwikiadmin am 2024/06/24 14:35

Von Version 2.1
bearbeitet von xwikiadmin
am 2022/08/11 16:36
Änderungskommentar: Migrated property [defaultCategories] from class [XWiki.WikiMacroClass]
Auf Version 5.1
bearbeitet von xwikiadmin
am 2023/10/26 09:38
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros/1.12]

Zusammenfassung

Details

XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -1,7 +1,25 @@
1 +{{velocity output="false"}}
2 +#macro (executeMacro)
3 + #set ($unescapedFilename = $xcontext.macro.params.get('att--filename'))
4 + #if (!$unescapedFilename)
5 + #set ($unescapedFilename = $xcontext.macro.params.get('name'))
6 + #end
7 + #set($escapedFilename = $services.rendering.escape($unescapedFilename, $xwiki.currentContentSyntaxId))
8 + {{office reference="$escapedFilename" /}}
9 +#end
10 +{{/velocity}}
11 +
12 +{{include reference="Licenses.Code.VelocityMacros"/}}
13 +
1 1  {{velocity}}
2 -#set ($filename = $xcontext.macro.params.get('att--filename'))
3 -#if (!$filename)
4 - #set ($filename = $xcontext.macro.params.get('name'))
15 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
16 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
17 +## don't have view right on those pages.
18 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
19 + #executeMacro
20 +#else
21 + {{error}}
22 + #getMissingLicenseMessage('proMacros.extension.name')
23 + {{/error}}
5 5  #end
6 -{{office reference="$filename" /}}
7 7  {{/velocity}}