Changes for page View File
Last modified by Admin Trust-IT on 2026/05/29 08:29
To version 2.2
edited by Admin Trust-IT
on 2026/05/29 08:28
on 2026/05/29 08:28
Change comment:
There is no comment for this version
Summary
-
Objects (3 modified, 0 added, 2 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,28 +1,12 @@ 1 -#set($attName = $xcontext.macro.params.name) 2 -#set($targetPage = $xcontext.macro.params.page) 3 -#if("$!targetPage" == '') 4 - #set($docRef = $doc.documentReference) 5 -#else 6 - #set($docRef = $services.model.resolveDocument($targetPage)) 1 +{{velocity}} 2 +#set($fileName = $xcontext.macro.params.get('att--filename')) 3 +#if("$!fileName" == "") 4 + #set($fileName = $xcontext.macro.params.name) 7 7 #end 8 -#set($attDoc = $xwiki.getDocument($docRef)) 9 -#set($att = $attDoc.getAttachment($attName)) 10 -#if(!$att) 11 - {{warning}}Allegato "$!attName" non trovato.{{/warning}} 6 + 7 +#if("$!fileName" != "") 8 + [[image:icon:attach]] [[$fileName>>attach:$fileName]] 12 12 #else 13 - #set($url = $attDoc.getAttachmentURL($attName)) 14 - #set($mime = $att.getMimeType()) 15 - #set($w = $xcontext.macro.params.width) 16 - #set($h = $xcontext.macro.params.height) 17 - #if("$!w" == '')#set($w = '100%')#end 18 - #if("$!h" == '')#set($h = '600px')#end 19 - #if($mime.startsWith('image/')) 20 - [[image:$attName||width="$w"]] 21 - #elseif($mime == 'application/pdf') 22 - {{html clean="false"}}<iframe src="$url" width="$w" height="$h" style="border:1px solid #ccc;"></iframe>{{/html}} 23 - #elseif($mime.contains('word') || $mime.contains('excel') || $mime.contains('powerpoint') || $mime.contains('opendocument')) 24 - {{office attachment="$attName"/}} 25 - #else 26 - [[$attName>>attach:$attName]] 27 - #end 10 + //Attachment not specified// 28 28 #end 12 +{{/velocity}} - Execution is isolated
-
... ... @@ -1,0 +1,1 @@ 1 +No
- XWiki.WikiMacroParameterClass[1]
-
- Parameter description
-
... ... @@ -1,1 +1,1 @@ 1 - Nomedell'allegatodamostrare.1 +Attachment name - Parameter mandatory
-
... ... @@ -1,1 +1,1 @@ 1 - Yes1 +No
- XWiki.WikiMacroParameterClass[2]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Pagina che contiene l'allegato (default: pagina corrente). - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,1 @@ 1 - page1 +att--filename
- XWiki.WikiMacroParameterClass[3]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Larghezza (default 100%). - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -width
- XWiki.WikiMacroParameterClass[4]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Altezza (default 600px). - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -height