Änderungen von Dokument Balsamiq Macro

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

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,4 +1,5 @@
1 -{{velocity}}
1 +{{velocity output="false"}}
2 +#macro (executeMacro)
2 2   ## Macro parameters
3 3   #set($resourceID = $wikimacro.parameters.get('initialResourceID'))
4 4   #set($initialBranchID = $wikimacro.parameters.get('initialBranchID'))
... ... @@ -13,12 +13,27 @@
13 13   #if("$!alignment" != '')
14 14   #set($imageAlignment = $alignment.toLowerCase())
15 15   #end
16 - #set($attchmentName = "${attachmentNamePrefix}_${resourceID}_${attachmentNameSuffix}.png")
17 - #set($attachment = $doc.getAttachment($attchmentName))
17 + #set($attachmentName = "${attachmentNamePrefix}_${resourceID}_${attachmentNameSuffix}.png")
18 + #set($attachment = $doc.getAttachment($attachmentName))
18 18   ## Display
19 19   #if($attachment)
20 20   (% style="text-align: ${imageAlignment}"%)(((
21 - [[image:${attchmentName}]]
22 + [[image:$services.rendering.escape($attachmentName, $xwiki.currentContentSyntaxId)]]
22 22   )))
23 23   #end
25 +#end
24 24  {{/velocity}}
27 +
28 +{{include reference="Licenses.Code.VelocityMacros"/}}
29 +
30 +{{velocity}}
31 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
32 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
33 +## don't have view right on those pages.
34 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
35 + #executeMacro
36 +#else
37 + {{error}}
38 + #getMissingLicenseMessage('proMacros.extension.name')
39 + {{/error}}
40 +#end