Wiki-Quellcode von OfficeImporter
Version 3.1 von MACH formsolutions am 01.10.2020
Zeige letzte Bearbeiter
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{include reference="CKEditor.VelocityMacros" /}} | ||
| 2 | |||
| 3 | {{velocity wiki="false"}} | ||
| 4 | #if ("$!request.fileName" != '') | ||
| 5 | #set ($attachmentReference = $services.model.createAttachmentReference($doc.documentReference, $request.fileName)) | ||
| 6 | #set ($parameters = { | ||
| 7 | 'filterStyles': $request.filterStyles, | ||
| 8 | 'useOfficeViewer': $request.useOfficeViewer | ||
| 9 | }) | ||
| 10 | #initRequiredSkinExtensions() | ||
| 11 | #set ($output = $services.wysiwyg.importOfficeAttachment($attachmentReference, $parameters)) | ||
| 12 | #if ($output != '' && "$!output" == '') | ||
| 13 | ## Null output means an error has occured. | ||
| 14 | $response.sendError(500) | ||
| 15 | #else | ||
| 16 | ## When importing presentations using the Office Viewer macro the slides are displayed using the gallery widget for | ||
| 17 | ## which we need to load the required CSS and JavaScript resources. | ||
| 18 | #set ($discard = $response.setHeader('X-XWIKI-HTML-HEAD', "#getRequiredSkinExtensions()")) | ||
| 19 | $output | ||
| 20 | #end | ||
| 21 | #end | ||
| 22 | {{/velocity}} | ||
| 23 | |||
| 24 | {{velocity}} | ||
| 25 | #if ("$!request.fileName" == '' && $xcontext.action == 'get') | ||
| 26 | {{html clean="false"}} | ||
| 27 | <form class="xform"> | ||
| 28 | <dl> | ||
| 29 | <dt> | ||
| 30 | <label> | ||
| 31 | $services.localization.render('ckeditor.plugin.office.importer.filePath') | ||
| 32 | <span class="xRequired">($services.localization.render('ckeditor.plugin.office.importer.required'))</span> | ||
| 33 | </label> | ||
| 34 | <span class="xHint">$services.localization.render('ckeditor.plugin.office.importer.filePath.hint')</span> | ||
| 35 | </dt> | ||
| 36 | <dd> | ||
| 37 | <input type="file" name="filePath" /> | ||
| 38 | </dd> | ||
| 39 | <dt> | ||
| 40 | <label> | ||
| 41 | <input type="checkbox" name="filterStyles" value="true" checked="checked" /> | ||
| 42 | $services.localization.render('ckeditor.plugin.office.importer.filterStyles') | ||
| 43 | </label> | ||
| 44 | <span class="xHint">$services.localization.render('ckeditor.plugin.office.importer.filterStyles.hint')</span> | ||
| 45 | </dt> | ||
| 46 | <dd></dd> | ||
| 47 | <dt> | ||
| 48 | <label> | ||
| 49 | <input type="checkbox" name="useOfficeViewer" value="true" /> | ||
| 50 | $services.localization.render('ckeditor.plugin.office.importer.useOfficeViewer') | ||
| 51 | </label> | ||
| 52 | <span class="xHint">$services.localization.render('ckeditor.plugin.office.importer.useOfficeViewer.hint')</span> | ||
| 53 | </dt> | ||
| 54 | <dd></dd> | ||
| 55 | </dl> | ||
| 56 | </form> | ||
| 57 | {{/html}} | ||
| 58 | #end | ||
| 59 | {{/velocity}} |