From 27c47f77e345f650c4f4ffc4d07734028f8ce72d Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 31 May 2014 16:10:54 -0700 Subject: [PATCH] Better BC fix for sitelink images. --- e107_handlers/e_parse_class.php | 16 +++++++++++----- e107_handlers/sitelinks_class.php | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 0051b4d58..0070c4d0e 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2782,9 +2782,9 @@ class e_parser { return; } - + $ext = pathinfo($icon, PATHINFO_EXTENSION); - + if(!$ext || $ext == 'glyph') // Bootstrap or Font-Awesome. { return $this->toGlyph($icon,$parm); @@ -2800,14 +2800,18 @@ class e_parser } elseif(vartrue($parm['legacy'])) { - if(is_readable($parm['legacy'].$icon)) + + $legacyPath = $parm['legacy'].$icon; + $filePath = $this->replaceConstants($legacyPath,'rel'); + + if(is_readable($filePath)) { - $path = $parm['legacy'].$icon; + $path = $this->replaceConstants($legacyPath,'full'); } else { $log = e107::getAdminLog(); - $log->addDebug('Broken Icon Path: '.$icon, false)->save('IMALAN_00'); + $log->addDebug('Broken Icon Path: '.$legacyPath, false)->save('IMALAN_00'); } } @@ -2815,6 +2819,8 @@ class e_parser { $path = $icon; } + + return "".basename($path).""; } diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index bab83d401..969f07960 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -1768,7 +1768,7 @@ class navigation_shortcodes extends e_shortcode // else { //$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE); - return $tp->toIcon($this->var['link_button'],array('space'=>' ', 'legacy'=>e_IMAGE_ABS."icons/")); + return $tp->toIcon($this->var['link_button'],array('space'=>' ', 'legacy'=>"{e_IMAGE}icons/")); // return ""; }