commit 46be913b9d2d5689ce9d9d3ab5d39ac80cc3b25d
parent fb5c182a488e77bfa3873041d08bed51a8ab3242
Author: Jan Dankert <develop@jandankert.de>
Date: Sat, 18 May 2019 00:42:41 +0200
New: Preview für URLs.
Diffstat:
4 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/modules/cms-core/action/UrlAction.class.php b/modules/cms-core/action/UrlAction.class.php
@@ -210,4 +210,16 @@ class UrlAction extends ObjectAction
exit;
}
+
+
+
+ /**
+ * Vorschau anzeigen
+ */
+ function previewView()
+ {
+ $this->setTemplateVar('preview_url',$this->url->url );
+ }
+
+
}
\ No newline at end of file
diff --git a/modules/cms-ui/UI.class.php b/modules/cms-ui/UI.class.php
@@ -186,11 +186,14 @@ class UI
'script-src \'self\'',
// No <object>, <embed> or <applet>.
'object-src \'none\'',
+ // no external CSS
'style-src \'self\'',
+ // no external images.
'img-src \'self\'',
// No <audio>, <video> elements
'media-src \'none\'',
- 'frame-src \'self\'',
+ // For preview of urls we need to show every url in an iframe.
+ 'frame-src *',
'worker-src \'self\'',
'form-action \'self\'',
'font-src \'self\'',
diff --git a/modules/cms-ui/themes/default/html/views/url/preview.php b/modules/cms-ui/themes/default/html/views/url/preview.php
@@ -0,0 +1,9 @@
+
+
+ <div class="toolbar-icon">
+ <i class="image-icon image-icon--menu-refresh"></i>
+
+ </div>
+ <iframe name="preview" src="<?php echo $preview_url ?>"></iframe>
+
+ +
\ No newline at end of file
diff --git a/modules/cms-ui/themes/default/html/views/url/preview.tpl.src.xml b/modules/cms-ui/themes/default/html/views/url/preview.tpl.src.xml
@@ -0,0 +1,20 @@
+<output xmlns="http://www.openrat.de/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.openrat.de/template ../../../../../../template-engine/components/template.xsd">
+
+ <part class="toolbar-icon">
+ <image menu="refresh" />
+ </part>
+
+ <!--
+ <part class="toolbar-icon clickable">
+ <link type="popup" class="action" url="var:preview_url">
+ <image menu="open_in_new"></image>
+
+ <text key="link_open_in_new_window"></text>
+ </link>
+ </part>
+ -->
+
+ <insert url="var:preview_url" name="preview"></insert>
+
+</output>+
\ No newline at end of file