Wiki source code of FileManagerSheet
Last modified by Andrey Che on 2018/12/10 14:09
Hide last authors
![]() |
1.1 | 1 | {{velocity}} |
2 | #set($url = "$xwiki.getURL($doc.getDocument(), 'view', 'change=true')#Attachments") | ||
3 | #set($change = $request.change) | ||
4 | #if($request.description) | ||
5 | $doc.set('description', $request.description) | ||
6 | $doc.save() | ||
7 | #end | ||
8 | |||
9 | {{html wiki="true"}} | ||
10 | $xwiki.ssx.use('AppWithinMinutes.ClassSheetGenerator') | ||
11 | $xwiki.ssx.use('FileManager.SkinExtension') | ||
12 | |||
13 | #set($discard = $doc.use('FileManager.FileManagerClass')) | ||
14 | ## We don't have access to the form element to set the CSS class for the vertical form layout standard. | ||
15 | #if($context.action=="view" && !$change) ##For viewing the document | ||
16 | #if($!doc.display('description')!='') | ||
17 | ; <label for="FileManager.FileManagerClass_0_description">Description</label> | ||
18 | : $doc.display('description') | ||
19 | #else | ||
20 | //$msg.get('contrib.FM.noDescription')// | ||
21 | #end | ||
22 | #set($filename = "") | ||
23 | #set($pdf='') | ||
24 | #foreach($attach in $doc.getAttachmentList()) | ||
25 | <p><a href="$doc.getAttachmentURL($attach.filename)">${attach.filename}</a></p> | ||
26 | #if($attach.filename.endsWith(".ppt")||$attach.filename.endsWith(".odp")||$attach.filename.endsWith(".ods")||$attach.filename.endsWith(".pptx")||$attach.filename.endsWith(".xls") ||$attach.filename.endsWith(".xlsx")||$attach.filename.endsWith(".odt")||$attach.filename.endsWith(".doc")||$attach.filename.endsWith(".docx")) | ||
27 | #set($filename = $attach.filename) | ||
28 | #end | ||
29 | #if($attach.filename.endsWith('.pdf')) | ||
30 | #set($pdf = $attach.filename) | ||
31 | #end | ||
32 | #end | ||
33 | #if($filename!="") | ||
34 | |||
35 | {{office attachment="${filename}" filterStyles="false"/}} | ||
36 | |||
37 | #elseif($pdf!='') | ||
38 | |||
39 | {{pdfviewer file="$pdf" /}} | ||
40 | |||
41 | #elseif($doc.getAttachmentList().size() == 0) | ||
42 | <p>//$msg.get('contrib.FM.noAttachment')//</p> | ||
43 | #end | ||
44 | #elseif($change) | ||
45 | <form action='$doc.getURL('view')' method='post'> | ||
46 | <div> | ||
47 | <label for='description'>**$msg.get('contrib.FM.description')** : </label> <br> | ||
48 | <textarea name='description' rows='4' cols='60'>$!doc.getValue('description')</textarea> | ||
49 | </div> | ||
50 | <br> | ||
51 | <div id='bottom'> | ||
52 | <p><label>$msg.get('contrib.FM.change.explanations')</label></p> | ||
53 | <input type='submit' class='button' value="$msg.get('contrib.FM.editDescription')"> | ||
54 | </div> | ||
55 | </form> | ||
56 | #else | ||
57 | $doc.save() | ||
58 | $response.sendRedirect($url) | ||
59 | #end | ||
60 | {{/html}} | ||
61 | {{/velocity}} |