1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-18 12:21:45 +02:00

Fixes #466 Download Category Icons path.

This commit is contained in:
Cameron
2013-12-30 03:56:27 -08:00
parent d34623a043
commit 470b043739
4 changed files with 30 additions and 7 deletions

View File

@@ -2696,14 +2696,35 @@ class e_parser
* @param string $icon
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
*/
public function toIcon($icon='')
public function toIcon($icon='',$legacyPath ='')
{
if(!vartrue($icon))
{
return;
}
$path = $this->replaceConstants($icon,'full');
if(substr($icon,-6) == '.glyph') // Bootstrap or Font-Awesome.
{
return $this->toGlyph($icon);
}
if($icon[0] == '{')
{
$path = $this->replaceConstants($icon,'full');
}
elseif($legacyPath)
{
if(is_readable($legacyPath.$icon))
{
$path = $legacyPath.$icon;
}
elseif(ADMIN)
{
return "Broken Image Path: ".$icon;
}
}
return "<img class='icon' src='".$path."' alt='".basename($path)."' />";
}