Änderungen von Dokument RecentlyUpdated
Zuletzt geändert von xwikiadmin am 2025/05/21 10:12
Von Version 1.1
bearbeitet von xwikiadmin
am 2023/03/07 16:26
am 2023/03/07 16:26
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.7]
Auf Version 2.1
bearbeitet von xwikiadmin
am 2023/04/25 11:49
am 2023/04/25 11:49
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros/1.7.1]
Zusammenfassung
-
Objekte (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -170,32 +170,47 @@ 170 170 #set ($return = $NULL) 171 171 #setVariable("$return" $options) 172 172 #end 173 + 174 +#macro (executeMacro) 175 + ## ----------------------------------------------------------------- 176 + ## ----------------------------------------------------------------- 177 + ## ----------------------------------------------------------------- 178 + ## Fetch results 179 + ## ----------------------------------------------------------------- 180 + $xwiki.ssx.use('xwiki:Confluence.Macros.RecentlyUpdated') 181 + $xwiki.jsx.use('xwiki:Confluence.Macros.RecentlyUpdated') 182 + {{html clean="false"}} 183 + #initOptionsFromParameters($options) 184 + #fetchResults($options, $results) 185 + #set ($confluenceWidth = $escapetool.xml($wikimacro.parameters.width)) 186 + #set ($widthStyle = "style='--width: $confluenceWidth'") 187 + <section class="recently-updated-macro" $widthStyle> 188 + #if ("$wikimacro.parameters.hideHeading" != "true") 189 + <h2>$escapetool.xml($services.localization.render('recentlyUpdatedMacro.title'))</h2> 190 + #end 191 + <ul class="results theme-${options.theme}"> 192 + #displayResults($results $options) 193 + </ul> 194 + <button class="btn btn-link show-more"> 195 + Show more 196 + </button> 197 + </section> 198 + {{/html}} 199 +#end 173 173 {{/velocity}} 174 174 202 +{{include reference="Licenses.Code.VelocityMacros"/}} 203 + 175 175 {{velocity}} 176 -## ----------------------------------------------------------------- 177 -## ----------------------------------------------------------------- 178 -## ----------------------------------------------------------------- 179 -## Fetch results 180 -## ----------------------------------------------------------------- 181 -$xwiki.ssx.use('xwiki:Confluence.Macros.RecentlyUpdated') 182 -$xwiki.jsx.use('xwiki:Confluence.Macros.RecentlyUpdated') 183 -{{html clean="false"}} 184 - #initOptionsFromParameters($options) 185 - #fetchResults($options, $results) 186 - #set ($confluenceWidth = $escapetool.xml($wikimacro.parameters.width)) 187 - #set ($widthStyle = "style='--width: $confluenceWidth'") 188 - <section class="recently-updated-macro" $widthStyle> 189 - #if ("$wikimacro.parameters.hideHeading" != "true") 190 - <h2>$escapetool.xml($services.localization.render('recentlyUpdatedMacro.title'))</h2> 191 - #end 192 - <ul class="results theme-${options.theme}"> 193 - #displayResults($results $options) 194 - </ul> 195 - <button class="btn btn-link show-more"> 196 - Show more 197 - </button> 198 - </section> 199 -{{/html}} 205 +## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 206 +## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 207 +## don't have view right on those pages. 208 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 209 + #executeMacro 210 +#else 211 + {{error}} 212 + #getMissingLicenseMessage('proMacros.extension.name') 213 + {{/error}} 214 +#end 200 200 {{/velocity}} 201 201