Wiki-Quellcode von OfficeImporter
Zuletzt geändert von MACH formsolutions am 30.01.2025
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 | #ckeditor_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', "#ckeditor_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 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.filePath')) | ||
| 32 | <span class="xRequired"> | ||
| 33 | ($escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.required'))) | ||
| 34 | </span> | ||
| 35 | </label> | ||
| 36 | <span class="xHint"> | ||
| 37 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.filePath.hint')) | ||
| 38 | </span> | ||
| 39 | </dt> | ||
| 40 | <dd> | ||
| 41 | <input type="file" name="filePath" /> | ||
| 42 | </dd> | ||
| 43 | <dt> | ||
| 44 | <label> | ||
| 45 | <input type="checkbox" name="filterStyles" value="true" checked="checked" /> | ||
| 46 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.filterStyles')) | ||
| 47 | </label> | ||
| 48 | <span class="xHint"> | ||
| 49 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.filterStyles.hint')) | ||
| 50 | </span> | ||
| 51 | </dt> | ||
| 52 | <dd></dd> | ||
| 53 | <dt> | ||
| 54 | <label> | ||
| 55 | <input type="checkbox" name="useOfficeViewer" value="true" /> | ||
| 56 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.useOfficeViewer')) | ||
| 57 | </label> | ||
| 58 | <span class="xHint"> | ||
| 59 | $escapetool.xml($services.localization.render('ckeditor.plugin.office.importer.useOfficeViewer.hint')) | ||
| 60 | </span> | ||
| 61 | </dt> | ||
| 62 | <dd></dd> | ||
| 63 | </dl> | ||
| 64 | </form> | ||
| 65 | {{/html}} | ||
| 66 | #end | ||
| 67 | {{/velocity}} |