Skip to content

Commit

Permalink
In map viz, strip media path on data icon so it doesn't get prepended…
Browse files Browse the repository at this point in the history
… twice
  • Loading branch information
cheesegrits committed Mar 15, 2014
1 parent c83adbb commit 2835a45
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions plugins/fabrik_visualization/googlemap/models/googlemap.php
Expand Up @@ -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 != '')
Expand All @@ -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
{
Expand Down

0 comments on commit 2835a45

Please sign in to comment.