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