From ed7d5582de6eafc4dd8fc3eab5d15fc49b598edd Mon Sep 17 00:00:00 2001 From: Hadlee Lineham Date: Wed, 29 Jul 2020 09:21:29 +1200 Subject: [PATCH 1/3] Making wrap optional --- code/Icon.php | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/code/Icon.php b/code/Icon.php index 46b8d49..3b7d824 100755 --- a/code/Icon.php +++ b/code/Icon.php @@ -1,14 +1,22 @@ tableName, $this->name, 'Varchar(1024)'); } + + public function wrapSvg() { + return true; + } private static $casting = array( 'URL' => 'HTMLFragment', @@ -84,7 +92,16 @@ public function SVG(){ } $svg = file_get_contents($filePath); - return ''.$svg.''; + + + $wrapSVG = $this->wrapSvg(); + $this->extend('updateWrapSVG', $wrapSVG); + + if($wrapSVG){ + $svg =''.$svg.''; + } + + return $svg; } /** @@ -94,4 +111,4 @@ public function SVG(){ public function scaffoldFormField($title = null, $params = null) { return IconField::create($this->name, $title); } -} \ No newline at end of file +} From cb9230f5cd5bba0da1ff71fcc23697c2f3401715 Mon Sep 17 00:00:00 2001 From: Hadlee Lineham Date: Wed, 29 Jul 2020 09:22:50 +1200 Subject: [PATCH 2/3] removing test code --- code/Icon.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/Icon.php b/code/Icon.php index 3b7d824..fb84a02 100755 --- a/code/Icon.php +++ b/code/Icon.php @@ -1,12 +1,10 @@ Date: Wed, 29 Jul 2020 13:20:54 +1200 Subject: [PATCH 3/3] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 873e9d8..5e882ef 100755 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "jaedb/iconfield", + "name": "toastnz/iconfield", "type": "silverstripe-vendormodule", "description": "Icon field for SilverStripe", "homepage": "http://jamesbarnsley.co.nz",