1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Fixes #5345 Oversized navigation icon fix.

This commit is contained in:
camer0n
2025-04-29 07:09:19 -07:00
parent 8949d2a3ce
commit 6be27f381f
2 changed files with 11 additions and 13 deletions

View File

@@ -2537,7 +2537,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$tmp[$c]['text'] = $sc->sc_nav_link_name();
$tmp[$c]['description'] = $tp->toHTML($lk['link_description'], '', 'defs');
$tmp[$c]['link'] = $sc->sc_nav_link_url(); // $tp->replaceConstants($link,'full');
$tmp[$c]['image'] = $sc->sc_nav_link_icon(); // vartrue($lk['link_button']) ? "<img class='icon S16' src='".$tp->replaceConstants($lk['link_button'])."' alt='".$tp->toAttribute($lk['link_description'],'','defs')."' />": '';
$tmp[$c]['image'] = $sc->sc_nav_link_icon(['class'=>'icon S16']); // vartrue($lk['link_button']) ? "<img class='icon S16' src='".$tp->replaceConstants($lk['link_button'])."' alt='".$tp->toAttribute($lk['link_description'],'','defs')."' />": '';
$tmp[$c]['image_large'] = '';
$tmp[$c]['image_src'] = vartrue($lk['link_button']);
$tmp[$c]['image_large_src'] = '';

View File

@@ -77,7 +77,7 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
/**
* Return the name of the current link
*
* @return string
* @return string|null
* @example {NAV_LINK_NAME}
*/
function sc_nav_link_name($parm = null)
@@ -256,16 +256,14 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
return '';
}
// if($icon = $tp->toGlyph($this->var['link_button']))
// {
// return $icon;
// }
// else
$opts = array('fw' => true, 'space' => ' ', 'legacy' => "{e_IMAGE}icons/");
if(!empty($parm) && is_array($parm))
{
//$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE);
return $tp->toIcon($this->var['link_button'], array('fw' => true, 'space' => ' ', 'legacy' => "{e_IMAGE}icons/"));
// return "<img class='icon' src='".$path."' alt='' />";
$opts = array_merge($opts, $parm);
}
return $tp->toIcon($this->var['link_button'], $opts);
}
@@ -273,7 +271,7 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
/**
* Return the link description of the current link
* @example {NAV_LINK_DESCRIPTION}
* @return string
* @return string|null
*/
function sc_nav_link_description($parm = null)
{
@@ -293,14 +291,14 @@ require_once(__DIR__.'/navigation_shortcodes_legacy.php');
/**
* Return the parsed sublinks of the current link
* @example {NAV_LINK_SUB}
* @return string
* @return string|null
*/
function sc_nav_link_sub($parm = null)
{
if(empty($this->var['link_sub']))
{
return false;
return null;
}
if(is_string($this->var['link_sub'])) // html override option.