1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 11:36:08 +02:00

Fix for font-awesome overlay issue. Renamed glyph() as toGlyph() for consistency.

This commit is contained in:
Cameron
2013-07-12 13:52:39 -07:00
parent 917bbef849
commit ddbbfef54f
7 changed files with 38 additions and 17 deletions

View File

@@ -2407,6 +2407,10 @@ class e_parse extends e_parser
}
/**
* Convert Text to a suitable format for use in emails. eg. relative links will be replaced with full links etc.
* @param string $text
@@ -2613,14 +2617,11 @@ class e_parser
/**
* Parse xxxxx.glyph file to bootstrap glyph format.
* @return FALSE if not a glyph file or if bootstrap is not found.
*/
public function glyph($text)
public function toGlyph($text)
{
if(!deftrue('BOOTSTRAP'))
{
@@ -2639,6 +2640,24 @@ class e_parser
// return $text;
}
/**
* Display an icon.
* @param string $icon
* @example $tp->toIcon("{e_IMAGES}icons/something.png");
*/
public function toIcon($icon='')
{
if(!vartrue($icon))
{
return;
}
$path = $this->replaceConstants($icon,'full');
return "<img class='icon' src='".$path."' alt='".basename($path)."' />";
}
/**
* Parse new <bbcode> tags into bbcode output.
* @param $retainTags : when you want to replace html and retain the <bbcode> tags wrapping it.

View File

@@ -522,13 +522,13 @@ class e_form
$thpath = isset($sc_parameters['nothumb']) || vartrue($hide) ? $default : $default_thumb;
$label = "<div id='{$name_id}_prev' class='text-center well well-small image-selector' >";
if($glyph = $tp->glyph($default_url))
if($glyph = $tp->toGlyph($default_url))
{
$label .= $glyph;
}
else
{
$label .= "<img src='{$default_url}' alt='{$default_url}' />";
$label .= $tp->toIcon($default_url);
}
$label .= "
@@ -2611,7 +2611,7 @@ class e_form
case 'icon':
if($glyph = $tp->glyph($value))
if($glyph = $tp->toGlyph($value))
{
$value = $glyph;
}

View File

@@ -1218,7 +1218,7 @@ class e_navigation
if(vartrue($e107_vars[$act]['image_src']) && strstr($e107_vars[$act]['image_src'],'.glyph'))
{
$replace[9] = $tp->glyph($e107_vars[$act]['image_src']);
$replace[9] = $tp->toGlyph($e107_vars[$act]['image_src']);
}
else
{
@@ -1629,14 +1629,15 @@ class navigation_shortcodes extends e_shortcode
if (!vartrue($this->var['link_button'])) return '';
if($icon = $tp->glyph($this->var['link_button']))
if($icon = $tp->toGlyph($this->var['link_button']))
{
return $icon;
}
else
{
$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE);
return "<img class='icon' src='".$path."' alt='' />";
return $tp->toIcon($path);
// return "<img class='icon' src='".$path."' alt='' />";
}
}