1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +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

@@ -83,7 +83,7 @@ function loadJSAddons()
// e107::js("core", "tags/jquery.tagit.js","jquery",3); // e107::js("core", "tags/jquery.tagit.js","jquery",3);
// e107::css('core', 'tags/jquery.tagit.css', 'jquery'); // e107::css('core', 'tags/jquery.tagit.css', 'jquery');
e107::css('core', 'core/admin.jquery.css', 'jquery'); e107::css('core', 'core/admin.jquery.css', 'jquery');
e107::js("core", "core/admin.jquery.js","jquery",4); // Load all default functions. e107::js("core", "core/admin.jquery.js","jquery",4); // Load all default functions.
e107::css('core', 'core/all.jquery.css', 'jquery'); e107::css('core', 'core/all.jquery.css', 'jquery');

View File

@@ -196,7 +196,7 @@ class cpage_shortcodes extends e_shortcode
function sc_cmenutitle($parm='') function sc_cmenutitle($parm='')
{ {
$tp = e107::getParser(); $tp = e107::getParser();
$title = $tp->glyph($this->page['menu_title']); // (preg_replace('/i_([\w]*)/',"<i class='i_$1'></i>",$this->page['menu_title']); $title = $tp->toGlyph($this->page['menu_title']); // (preg_replace('/i_([\w]*)/',"<i class='i_$1'></i>",$this->page['menu_title']);
return $tp->toHTML($title, true, 'TITLE'); return $tp->toHTML($title, true, 'TITLE');
} }

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. * Convert Text to a suitable format for use in emails. eg. relative links will be replaced with full links etc.
* @param string $text * @param string $text
@@ -2613,14 +2617,11 @@ class e_parser
/** /**
* Parse xxxxx.glyph file to bootstrap glyph format. * Parse xxxxx.glyph file to bootstrap glyph format.
* @return FALSE if not a glyph file or if bootstrap is not found. * @return FALSE if not a glyph file or if bootstrap is not found.
*/ */
public function glyph($text) public function toGlyph($text)
{ {
if(!deftrue('BOOTSTRAP')) if(!deftrue('BOOTSTRAP'))
{ {
@@ -2639,6 +2640,24 @@ class e_parser
// return $text; // 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. * Parse new <bbcode> tags into bbcode output.
* @param $retainTags : when you want to replace html and retain the <bbcode> tags wrapping it. * @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; $thpath = isset($sc_parameters['nothumb']) || vartrue($hide) ? $default : $default_thumb;
$label = "<div id='{$name_id}_prev' class='text-center well well-small image-selector' >"; $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; $label .= $glyph;
} }
else else
{ {
$label .= "<img src='{$default_url}' alt='{$default_url}' />"; $label .= $tp->toIcon($default_url);
} }
$label .= " $label .= "
@@ -2611,7 +2611,7 @@ class e_form
case 'icon': case 'icon':
if($glyph = $tp->glyph($value)) if($glyph = $tp->toGlyph($value))
{ {
$value = $glyph; $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')) 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 else
{ {
@@ -1629,14 +1629,15 @@ class navigation_shortcodes extends e_shortcode
if (!vartrue($this->var['link_button'])) return ''; 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; return $icon;
} }
else else
{ {
$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE); $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='' />";
} }
} }

View File

@@ -48,7 +48,10 @@ tr.highlight-even { background-color: #212121; }
color: #363636; color: #363636;
} }
/* Fix for font-awesome / darkstrap overlay issue. */
.icon-white, .nav-pills > .active > a > [class^="icon-"], .nav-pills > .active > a > [class*=" icon-"], .nav-list > .active > a > [class^="icon-"], .nav-list > .active > a > [class*=" icon-"], .navbar-inverse .nav > .active > a > [class^="icon-"], .navbar-inverse .nav > .active > a > [class*=" icon-"], .dropdown-menu > li > a:hover > [class^="icon-"], .dropdown-menu > li > a:hover > [class*=" icon-"], .dropdown-menu > .active > a > [class^="icon-"], .dropdown-menu > .active > a > [class*=" icon-"], .dropdown-submenu:hover > a > [class^="icon-"], .dropdown-submenu:hover > a > [class*=" icon-"], h1 > [class^="icon-"], h2 > [class^="icon-"], h3 > [class^="icon-"], h4 > [class^="icon-"], h5 > [class^="icon-"], .btn-primary > [class^="icon-"], .nav-tabs > li > a > [class^="icon-"] {
background-image: none;
}
/* /*
.bootstrap-select, bootstrap-select button .bootstrap-select, bootstrap-select button

View File

@@ -290,15 +290,13 @@ class pageClass
return; return;
} }
if($glyph = $tp->glyph($icon)) if($glyph = $tp->toGlyph($icon))
{ {
return $glyph; return $glyph;
} }
else else
{ {
$path = $tp->replaceConstants($icon,'full'); return $tp->toIcon($icon);
return "<img class='icon' src='".$path."' alt=\"icon\" />";
} }
} }