mirror of
https://github.com/e107inc/e107.git
synced 2025-06-05 18:35:01 +02:00
Allow Custom Menu-Images to be used in page-navigation template.
This commit is contained in:
parent
e0754faca9
commit
dd140d8e69
@ -51,7 +51,7 @@ $CHAPTER_TEMPLATE['nav']['listChapters']['item_submenu'] = '
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['item_submenu_active'] = '
|
||||
<li class="active">
|
||||
<a role="button" href="{LINK_URL}">
|
||||
{LINK_ICON}{LINK_NAME}
|
||||
{LINK_NAME}
|
||||
</a>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
@ -60,7 +60,7 @@ $CHAPTER_TEMPLATE['nav']['listChapters']['item_submenu_active'] = '
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['item_active'] = '
|
||||
<li class="active">
|
||||
<a crole="button" href="{LINK_URL}">
|
||||
{LINK_ICON}{LINK_NAME}
|
||||
{LINK_NAME}
|
||||
</a>
|
||||
</li>
|
||||
';
|
||||
@ -73,27 +73,27 @@ $CHAPTER_TEMPLATE['nav']['listChapters']['submenu_start'] = '<ul class="page-
|
||||
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_item'] = '
|
||||
<li role="menuitem" >
|
||||
<a href="{LINK_URL}">{LINK_ICON}{LINK_NAME}</a>
|
||||
<a href="{LINK_URL}">{LINK_NAME}</a>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_loweritem'] = '
|
||||
<li role="menuitem" >
|
||||
<a href="{LINK_URL}">{LINK_ICON}{LINK_NAME}</a>
|
||||
<a href="{LINK_URL}">{LINK_NAME}</a>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_loweritem_active'] = '
|
||||
<li role="menuitem" class="active">
|
||||
<a href="{LINK_URL}">{LINK_ICON}{LINK_NAME}</a>
|
||||
<a href="{LINK_URL}">{LINK_NAME}</a>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
|
||||
$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_item_active'] = '
|
||||
<li role="menuitem" class="active">
|
||||
<a href="{LINK_URL}">{LINK_ICON}{LINK_NAME}</a>
|
||||
<a href="{LINK_URL}">{LINK_NAME}</a>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
@ -105,4 +105,7 @@ $CHAPTER_TEMPLATE['nav']['listBooks'] = $CHAPTER_TEMPLATE['nav']['listChapters']
|
||||
$CHAPTER_TEMPLATE['nav']['listPages'] = $CHAPTER_TEMPLATE['nav']['listChapters'];
|
||||
$CHAPTER_TEMPLATE['nav']['showPage'] = $CHAPTER_TEMPLATE['nav']['listChapters'];
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@ -2721,6 +2721,8 @@ class e_parser
|
||||
*/
|
||||
public function toIcon($icon='',$legacyPath ='')
|
||||
{
|
||||
|
||||
|
||||
if(!vartrue($icon))
|
||||
{
|
||||
return;
|
||||
@ -2730,10 +2732,12 @@ class e_parser
|
||||
{
|
||||
return $this->toGlyph($icon);
|
||||
}
|
||||
|
||||
|
||||
if($icon[0] == '{')
|
||||
{
|
||||
$path = $this->replaceConstants($icon,'full');
|
||||
// $path = $this->replaceConstants($icon,'full');
|
||||
$path = $this->thumbUrl($icon);
|
||||
|
||||
}
|
||||
elseif($legacyPath)
|
||||
{
|
||||
|
@ -1400,8 +1400,8 @@ class e_navigation
|
||||
|
||||
$sc = e107::getScBatch('navigation');
|
||||
$sc->template = $template;
|
||||
$head = $template['start'];
|
||||
$foot = $template['end'];
|
||||
$head = e107::getParser()->parseTemplate($template['start'],true);
|
||||
$foot = e107::getParser()->parseTemplate($template['end'],true);
|
||||
$ret = "";
|
||||
|
||||
$sc->counter = 1;
|
||||
@ -1731,17 +1731,17 @@ class navigation_shortcodes extends e_shortcode
|
||||
function sc_link_icon($parm='')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
if (!vartrue($this->var['link_button'])) return '';
|
||||
|
||||
if($icon = $tp->toGlyph($this->var['link_button']))
|
||||
// if($icon = $tp->toGlyph($this->var['link_button']))
|
||||
// {
|
||||
// return $icon;
|
||||
// }
|
||||
// else
|
||||
{
|
||||
return $icon;
|
||||
}
|
||||
else
|
||||
{
|
||||
$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE);
|
||||
return $tp->toIcon($path);
|
||||
//$path = e107::getParser()->replaceConstants($this->var['link_button'], 'full', TRUE);
|
||||
return $tp->toIcon($this->var['link_button']);
|
||||
// return "<img class='icon' src='".$path."' alt='' />";
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class page_sitelink // include plugin-folder in the name.
|
||||
'link_name' => $tp->toHtml($row['chapter_name'],'','TITLE'),
|
||||
'link_url' => 'page.php?ch='.$row['chapter_id'], //TODO FIXME chapter_sef support
|
||||
'link_description' => '',
|
||||
'link_button' => '',
|
||||
'link_button' => $row['chapter_icon'],
|
||||
'link_category' => '',
|
||||
'link_order' => '',
|
||||
'link_parent' => $row['chapter_parent'],
|
||||
@ -155,7 +155,7 @@ class page_sitelink // include plugin-folder in the name.
|
||||
'link_name' => $row['page_title'] ? $row['page_title'] : 'No title', // FIXME lan
|
||||
'link_url' => e107::getUrl()->create('page/view', $row, array('allow' => 'page_sef,page_title,page_id')),
|
||||
'link_description' => '',
|
||||
'link_button' => '',
|
||||
'link_button' => $row['menu_image'],
|
||||
'link_category' => '',
|
||||
'link_order' => $row['page_order'],
|
||||
'link_parent' => $row['page_chapter'],
|
||||
@ -204,7 +204,7 @@ class page_sitelink // include plugin-folder in the name.
|
||||
// 'link_url' => vartrue($row['chapter_sef'],'#'),
|
||||
|
||||
'link_description' => '',
|
||||
'link_button' => '',
|
||||
'link_button' => $row['chapter_icon'],
|
||||
'link_category' => '',
|
||||
'link_order' => $row['chapter_order'],
|
||||
'link_parent' => $row['chapter_parent'],
|
||||
|
@ -17,7 +17,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$parm = eHelper::scParams($parm);
|
||||
|
||||
$tmpl = e107::getCoreTemplate('chapter','nav',false,true); // always merge
|
||||
$tmpl = e107::getCoreTemplate('chapter','nav',true,true); // always merge and allow override
|
||||
|
||||
$template = $tmpl['showPage'];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user