Änderungen von Dokument Mockup Macro

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

Von Version 1.1
bearbeitet von xwikiadmin
am 2022/02/23 10:52
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros/1.2.1]
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,4 +1,5 @@
1 -{{velocity}}
1 +{{velocity output="false"}}
2 +#macro (executeMacro)
2 2   ## Filename format : <balsamiq/mockup>_<$Name/$initialResourceID>[/_$initialBranchID].png
3 3   #set($attachmentNamePrefix = 'balsamiq')
4 4   #set($attachmentNameSuffix = '')
... ... @@ -17,6 +17,22 @@
17 17   #set($attachment = $doc.getAttachment($attachmentName))
18 18   #end
19 19   #if($attachment)
20 - [[image:${attachmentName}]]
21 + [[image:$services.rendering.escape($attachmentName, $xwiki.currentContentSyntaxId)]]
21 21   #end
23 +#end
22 22  {{/velocity}}
25 +
26 +{{include reference="Licenses.Code.VelocityMacros"/}}
27 +
28 +{{velocity}}
29 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
30 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
31 +## don't have view right on those pages.
32 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
33 + #executeMacro
34 +#else
35 + {{error}}
36 + #getMissingLicenseMessage('proMacros.extension.name')
37 + {{/error}}
38 +#end
39 +{{/velocity}}