From ef543ee370f17a95ca8cb7eb5ac1bb3f06916a0a Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 31 Jan 2017 08:23:04 -0800 Subject: [PATCH] Start of support for SVG Icons. Issue #2338 --- e107_core/xml/default_install.xml | 11 +++++++++++ e107_handlers/media_class.php | 7 ++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index f7b840d0b..3a83bea22 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -761,6 +761,17 @@ City, State, Country 0 + + 13 + _icon + _icon_svg + Icons SVG + + Available where icons are used in admin. + 253 + + 0 + diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index 655867c2f..14d9fe0b3 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -169,6 +169,11 @@ class e_media $this->import('_icon_'.$size, $path, $types); } + + $types = '[a-zA-z0-9_-]\.(svg|SVG)$'; + + $this->import('_icon_svg', $path, $types); + return $this; } @@ -237,7 +242,7 @@ class e_media $path = $tp->createConstants($epath, 'rel'); - $status = ($sql->gen("SELECT * FROM `#core_media` WHERE `media_url` LIKE '".$path."%' AND media_category REGEXP '_icon_16|_icon_32|_icon_48|_icon_64' ")) ? TRUE : FALSE; + $status = ($sql->gen("SELECT * FROM `#core_media` WHERE `media_url` LIKE '".$path."%' AND media_category REGEXP '_icon_16|_icon_32|_icon_48|_icon_64,_icon_svg' ")) ? TRUE : FALSE; while ($row = $sql->fetch()) { $ret[] = $row['media_url'];