From 2835a452bf3b0a0355cea9472b521a0a50438d05 Mon Sep 17 00:00:00 2001 From: Hugh Messenger Date: Fri, 14 Mar 2014 20:08:19 -0500 Subject: [PATCH] In map viz, strip media path on data icon so it doesn't get prepended twice --- .../googlemap/models/googlemap.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/fabrik_visualization/googlemap/models/googlemap.php b/plugins/fabrik_visualization/googlemap/models/googlemap.php index 66d962de3ec..c34b2055916 100644 --- a/plugins/fabrik_visualization/googlemap/models/googlemap.php +++ b/plugins/fabrik_visualization/googlemap/models/googlemap.php @@ -426,21 +426,22 @@ public function getJSIcons() { $iconImg = JArrayHelper::getValue($rowdata, $iconImg, ''); - // Get the src + // If it's in a src tag, preg it out preg_match('/src=["|\'](.*?)["|\']/', $iconImg, $matches); if (array_key_exists(1, $matches)) { $iconImg = $matches[1]; + } - // Check file exists - $path = str_replace(COM_FABRIK_LIVESITE, '', $iconImg); + // Check file exists + $path = str_replace(COM_FABRIK_LIVESITE, '', $iconImg); - if (JFile::exists(JPATH_BASE . $path)) - { - $customimagefound = true; - } + if (JFile::exists(JPATH_BASE . $path)) + { + $customimagefound = true; } + } if ($iconImg != '') @@ -453,6 +454,10 @@ public function getJSIcons() $width = 20; $height = 34; } + + // $$$ hugh - if they use the media images folder for custom images, we need to strip path off + $iconImg = str_replace('/media/com_fabrik/images/', '', $iconImg); + } else {