mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Bootstrap navigation now support sub-links of sublinks.
This commit is contained in:
parent
73028d2e2e
commit
d8fb520e40
@ -54,7 +54,7 @@ $NAVIGATION_TEMPLATE['main']['end'] = '</ul>';
|
||||
|
||||
// Sub menu
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_start'] = '
|
||||
<ul class="dropdown-menu" role="menu" >
|
||||
<ul class="dropdown-menu submenu-start submenu-level-{LINK_DEPTH}" role="menu" >
|
||||
';
|
||||
|
||||
// Sub menu Link
|
||||
@ -70,12 +70,17 @@ $NAVIGATION_TEMPLATE['main']['submenu_item_active'] = '
|
||||
<a href="{LINK_URL}"{LINK_OPEN}>{LINK_ICON}{LINK_NAME}</a>
|
||||
</li>
|
||||
';
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_end'] = '</ul>';
|
||||
|
||||
// Sub menu
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_lowerstart'] = '
|
||||
<ul class="dropdown-menu submenu-start lower submenu-level-{LINK_DEPTH}" role="menu" >
|
||||
';
|
||||
|
||||
// Sub Menu Link which has a sub menu.
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_loweritem'] = '
|
||||
<li role="menuitem" class="dropdown-submenu">
|
||||
<li role="menuitem" class="dropdown-submenu lower">
|
||||
<a href="{LINK_URL}"{LINK_OPEN}>{LINK_ICON}{LINK_NAME}</a>
|
||||
<span class="caret"></span>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
@ -83,13 +88,12 @@ $NAVIGATION_TEMPLATE['main']['submenu_loweritem'] = '
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_loweritem_active'] = '
|
||||
<li role="menuitem" class="dropdown-submenu active">
|
||||
<a href="{LINK_URL}"{LINK_OPEN}>{LINK_ICON}{LINK_NAME}</a>
|
||||
<span class="caret"></span>
|
||||
{LINK_SUB}
|
||||
</li>
|
||||
';
|
||||
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_lowerend'] = '</ul>';
|
||||
|
||||
$NAVIGATION_TEMPLATE['main']['submenu_end'] = '</ul>';
|
||||
|
||||
|
||||
// TEMPLATE FOR {NAVIGATION=side}
|
||||
|
@ -1468,10 +1468,10 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
foreach ($data as $_data)
|
||||
{
|
||||
$active = ($this->isActive($_data, $this->activeMainFound)) ? "_active" : "";
|
||||
|
||||
$sc->setDepth(0);
|
||||
$sc->setVars($_data); // isActive is allowed to alter data
|
||||
$itemTmpl = count($_data['link_sub']) > 0 ? $template['item_submenu'.$active] : $template['item'.$active];
|
||||
$ret .= e107::getParser()->parseTemplate($itemTmpl, TRUE, $sc);
|
||||
$ret .= e107::getParser()->parseTemplate($itemTmpl, true, $sc);
|
||||
$sc->active = ($active) ? true : false;
|
||||
if($sc->active)
|
||||
{
|
||||
@ -1498,7 +1498,9 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
$data = $sql->retrieve($query,true);
|
||||
|
||||
|
||||
return $this->compile($data, $outArray);
|
||||
$ret = $this->compile($data, $outArray);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
@ -1510,8 +1512,8 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
if(!is_array($inArray) || !is_array($outArray)){ return null; }
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
foreach($inArray as $key => $val)
|
||||
|
||||
foreach($inArray as $key => $val)
|
||||
{
|
||||
if($val['link_parent'] == $pid)
|
||||
{
|
||||
@ -1556,8 +1558,10 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
if(include_once(e_PLUGIN.$path."/e_sitelink.php"))
|
||||
{
|
||||
$class = $path."_sitelink";
|
||||
if($sublinkArray = e107::callMethod($class,$method,$parm)) //TODO Cache it.
|
||||
if($sublinkArray = e107::callMethod($class,$method,$parm,$row)) //TODO Cache it.
|
||||
{
|
||||
|
||||
|
||||
return $sublinkArray;
|
||||
}
|
||||
}
|
||||
@ -1665,6 +1669,7 @@ class navigation_shortcodes extends e_shortcode
|
||||
public $template;
|
||||
public $counter;
|
||||
public $active;
|
||||
public $depth = 0;
|
||||
|
||||
|
||||
/**
|
||||
@ -1693,7 +1698,18 @@ class navigation_shortcodes extends e_shortcode
|
||||
return intval($this->var['link_id']);
|
||||
}
|
||||
|
||||
|
||||
function sc_link_depth($parm='')
|
||||
{
|
||||
return $this->depth;
|
||||
}
|
||||
|
||||
|
||||
function setDepth($val)
|
||||
{
|
||||
$this->depth = intval($val);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the name of the current link
|
||||
* @return string
|
||||
@ -1864,9 +1880,13 @@ class navigation_shortcodes extends e_shortcode
|
||||
return $this->var['link_sub'];
|
||||
}
|
||||
|
||||
$this->depth++;
|
||||
// Assume it's an array.
|
||||
|
||||
$text = e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $this->template['submenu_start']), true, $this);
|
||||
|
||||
$startTemplate = !empty($this->var['link_sub'][0]['link_sub']) && isset($this->template['submenu_lowerstart']) ? $this->template['submenu_lowerstart'] : $this->template['submenu_start'];
|
||||
$endTemplate = !empty($this->var['link_sub'][0]['link_sub']) && isset($this->template['submenu_lowerstart']) ? $this->template['submenu_lowerend'] : $this->template['submenu_end'];
|
||||
|
||||
$text = e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $startTemplate), true, $this);
|
||||
|
||||
foreach($this->var['link_sub'] as $val)
|
||||
{
|
||||
@ -1877,7 +1897,7 @@ class navigation_shortcodes extends e_shortcode
|
||||
if($active) $this->activeSubFound = true;
|
||||
}
|
||||
|
||||
$text .= e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $this->template['submenu_end']), true, $this);
|
||||
$text .= e107::getParser()->parseTemplate(str_replace('{LINK_SUB}', '', $endTemplate), true, $this);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
@ -146,8 +146,14 @@ table label.checkbox {
|
||||
li.dropdown-avatar > a.dropdown-toggle { padding:9px 15px 10px 0; }
|
||||
|
||||
|
||||
|
||||
|
||||
/* Navigation sub-sub menu - Mega Menu */
|
||||
ul.submenu-start.lower { list-style:none; width:500px; margin-left:-200px;} /* Adjust to one's needs */
|
||||
ul.submenu-start.lower li.dropdown-submenu { display:inline-block; }
|
||||
li.dropdown-submenu.lower ul.submenu-start { list-style-type:initial; list-style-position:inside; border:0; position:relative; display:block; width:auto; padding:0; box-shadow:none; -webkit-box-shadow:none; }
|
||||
li.dropdown-submenu.lower ul.submenu-start li { padding-left:20px; margin-left:0; text-indent:0}
|
||||
li.dropdown-submenu.lower ul.submenu-start li a { display:inline-block; padding-left:0; margin-left:0}
|
||||
li.dropdown-submenu.lower ul.submenu-start li a:hover { background:none}
|
||||
li.dropdown-submenu.lower ul.submenu-start li:hover { background-color:#f5f5f5; }
|
||||
|
||||
|
||||
|
||||
|
4
news.php
4
news.php
@ -27,6 +27,10 @@ if(!deftrue('e_LEGACY_NEWS')) // subject to removal at any time.
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
// --------------------- everything below this point will be removed in future --------------------------
|
||||
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
|
||||
require_once(e_HANDLER."news_class.php");
|
||||
|
Loading…
x
Reference in New Issue
Block a user