Changes for page Attachments

Last modified by Leonardo Fonseca on 09/07/2025

From version 3.1
edited by Leonardo Fonseca
on 15/10/2020
Change comment: Install extension [org.xwiki.platform:xwiki-platform-attachment-ui/12.8]
To version 2.1
edited by Leonardo Fonseca
on 30/01/2020
Change comment: Install extension [org.xwiki.platform:xwiki-platform-attachment-ui/12.0]

Summary

Details

Page properties
Content
... ... @@ -10,7 +10,7 @@
10 10   #set ($docAction = $request.get('docAction'))
11 11   #set ($attachmentList = $targetAttachDocument.getAttachmentList())
12 12   #if ($attachmentList && $attachmentList.size() > 0)
13 - #set ($sortedAttachments = $collectiontool.sort($attachmentList, 'date:desc'))
13 + #set ($sortedAttachments = $collectionstool.sort($attachmentList, 'date:desc'))
14 14   #set ($lastAttachment = $sortedAttachments.get(0))
15 15   #end
16 16   $response.sendRedirect($targetDocument.getURL($docAction, $escapetool.url({
... ... @@ -49,7 +49,7 @@
49 49   #attachmentPicker_displayUploadForm($targetDocument, $targetAttachDocument, $options)
50 50   #end
51 51   #attachmentPicker_displayAttachmentGalleryEmptyValue($targetDocument, $targetAttachDocument, $options, $currentValue)
52 - #set ($sortedAttachments = $collectiontool.sort($targetAttachDocument.getAttachmentList(), "${options.sortAttachmentsBy}") )
52 + #set ($sortedAttachments = $collectionstool.sort($targetAttachDocument.getAttachmentList(), "${options.sortAttachmentsBy}") )
53 53   #foreach ($attachment in $sortedAttachments)
54 54   #set ($extension = $attachment.getFilename())
55 55   #set ($extension = $extension.substring($mathtool.add($extension.lastIndexOf('.'), 1)).toLowerCase())
XWiki.WikiMacroClass[0]
Macro code
... ... @@ -3,6 +3,7 @@
3 3  $xwiki.ssfx.use('js/xwiki/widgets/modalPopup.css', true)##
4 4  $xwiki.jsx.use($xcontext.macro.doc.fullName)##
5 5  $xwiki.ssx.use($xcontext.macro.doc.fullName)##
6 +$xwiki.jsfx.use('js/scriptaculous/builder.js')##
6 6  ## Integrates the optional Lightbox widget (from http://extensions.xwiki.org/xwiki/bin/view/Extension/Lightbox+Application )
7 7  #if ($xwiki.exists('XWiki.Lightbox'))
8 8   $xwiki.jsx.use('XWiki.Lightbox')