commit 5a2772ec440b76564de79d670437f73b02c49ae2
parent e297a538694a9cbac82f43a8574449b1201b040e
Author: Jan Dankert <devnull@localhost>
Date: Fri, 24 Nov 2017 23:14:25 +0100
Komponente "image" umgestellt auf eine Klasse.
Diffstat:
6 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/themes/default/include/html/image/Image.class.php b/themes/default/include/html/image/Image.class.php
@@ -0,0 +1,70 @@
+<?php
+
+class ImageComponent extends Component
+{
+
+ public $config;
+ public $file;
+ public $url;
+ public $icon;
+ public $align='left';
+ public $type;
+ public $elementtype;
+ public $fileext;
+ public $tree;
+ public $notice;
+ public $size;
+ public $title;
+
+ protected function begin()
+ {
+ if ( !empty($this->elementtype) )
+ {
+ $file = OR_THEMES_DIR.'default/images/icon/element/'.$this->htmlvalue($this->elementtype).'.svg';
+ $styleClass = 'image-icon image-icon--element';
+ }
+ elseif ( !empty($this->type) )
+ {
+ $file = OR_THEMES_DIR.'default/images/icon_'.$this->htmlvalue($this->type).IMG_ICON_EXT;
+ $styleClass = '';
+ }
+ elseif ( !empty($this->icon) )
+ {
+ $file = OR_THEMES_DIR.'default/images/icon/'.$this->htmlvalue($this->icon).IMG_ICON_EXT;
+ $styleClass = '';
+ }
+ elseif ( !empty($this->notice) )
+ {
+ $file = OR_THEMES_DIR.'default/images/notice_'.$this->htmlvalue($this->notice).IMG_ICON_EXT;
+ $styleClass = '';
+ }
+ elseif ( !empty($this->tree) )
+ {
+ $file = OR_THEMES_DIR.'default/images/tree_'.$this->htmlvalue($this->tree).IMG_EXT;
+ $styleClass = '';
+ }
+ elseif ( !empty($this->url) )
+ {
+ $file = $this->htmlvalue($this->url);
+ $styleClass = '';
+ }
+ elseif ( !empty($this->fileext) )
+ {
+ $file = OR_THEMES_DIR.'default/images/icon/'.$this->htmlvalue($this->fileext);
+ $styleClass = '';
+ }
+ elseif ( !empty($this->file) )
+ {
+ $file = OR_THEMES_DIR.'default/images/icon/'.$this->htmlvalue($this->file).IMG_ICON_EXT;
+ $styleClass = '';
+ }
+
+ echo '<img class="'.$styleClass.'" title="'.$this->htmlvalue($this->title).'" src="'.$file.'" />';
+ }
+
+ protected function end()
+ {
+ }
+}
+
+?>+
\ No newline at end of file
diff --git a/themes/default/include/html/image/image.css b/themes/default/include/html/image/image.css
@@ -0,0 +1,2 @@
+
+/*# sourceMappingURL=data:application/json,%7B%22version%22%3A3%2C%22sources%22%3A%5B%5D%2C%22names%22%3A%5B%5D%2C%22mappings%22%3A%22%22%7D */+
\ No newline at end of file
diff --git a/themes/default/include/html/image/image.js b/themes/default/include/html/image/image.js
@@ -0,0 +1,5 @@
+$(document).on('orViewLoaded',function(event, data) {
+
+ // Convert linked SVG to an inline SVG, because we want to style it...
+ $(event.target).find('img.image-icon').svgToInline();
+}); +
\ No newline at end of file
diff --git a/themes/default/include/html/image/image.less b/themes/default/include/html/image/image.less
@@ -0,0 +1,3 @@
+img.image-icon {
+
+} +
\ No newline at end of file
diff --git a/themes/default/include/html/image/image.min.css b/themes/default/include/html/image/image.min.css
diff --git a/themes/default/include/html/image/image.min.js b/themes/default/include/html/image/image.min.js
@@ -0,0 +1 @@
+;$(document).on('orViewLoaded',function(n,i){$(n.target).find('img.image-icon').svgToInline()});+
\ No newline at end of file