1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

Fix for conflict between theme layouts called 'home' and menu-manager navigation.

This commit is contained in:
Cameron 2017-01-24 15:19:40 -08:00
parent eaebab16f5
commit 57c41f5ae9
7 changed files with 67 additions and 45 deletions

10
.editorconfig Normal file
View File

@ -0,0 +1,10 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*.php]
indent_style = tab
indent_size = 4

View File

@ -780,6 +780,9 @@ class e_menu_layout
$theme = e107::pref('core','sitetheme');
}
$sql = e107::getDb();
$tp = e107::getParser();
$HEADER = null;
$FOOTER = null;
$LAYOUT = null;

View File

@ -15,6 +15,10 @@ if (!defined('e107_INIT')) { exit; }
class admin_shortcodes
{
const ADMIN_NAV_HOME = 'enav_home'; // Must match with admin_template. ie. {ADMIN_NAVIGATION=enav_home} and $E_ADMIN_NAVIGATION['button_enav_home']
const ADMIN_NAV_LANGUAGE = 'enav_language';
const ADMIN_NAV_LOGOUT = 'enav_logout';
function cronUpdateRender($parm,$cacheData)
{
@ -1418,7 +1422,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
global $$tmpl;
if($parm == 'home' || $parm == 'logout' || $parm == 'language' || $parm == 'pm')
if($parm == self::ADMIN_NAV_HOME || $parm == self::ADMIN_NAV_LOGOUT || $parm == self::ADMIN_NAV_LANGUAGE || $parm == 'pm')
{
$template = $$tmpl;
@ -1480,6 +1484,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$tmp['sub_class'] = '';
$tmp['sort'] = false;
if(vartrue($pref['admin_slidedown_subs']) && vartrue($array_sub_functions[$key]))
{
$tmp['sub_class'] = 'sub';
@ -1649,15 +1654,16 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$tp = e107::getParser();
$frm = e107::getForm();
if($type == 'home')
if($type === self::ADMIN_NAV_HOME)
{
$menu_vars['home']['text'] = ""; // ADLAN_53;
$menu_vars['home']['link'] = e_HTTP.'index.php';
$menu_vars['home']['image'] = $tp->toGlyph('fa-home'); // "<i class='fa fa-home'></i>" ; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />";
$menu_vars['home']['image_src'] = ADLAN_151;
$menu_vars['home']['sort'] = 1;
$menu_vars['home']['sub_class'] = 'sub';
$menu_vars[$type]['text'] = ""; // ADLAN_53;
$menu_vars[$type]['link'] = e_HTTP.'index.php';
$menu_vars[$type]['image'] = $tp->toGlyph('fa-home'); // "<i class='fa fa-home'></i>" ; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />";
$menu_vars[$type]['image_src'] = ADLAN_151;
$menu_vars[$type]['sort'] = 1;
$menu_vars[$type]['sub_class'] = 'sub';
$menu_vars[$type]['template'] = $type;
// Sub Links for 'home'.
require_once(e_HANDLER."sitelinks_class.php");
@ -1682,10 +1688,10 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$c++;
}
$menu_vars['home']['sub'] = $tmp;
$menu_vars[$type]['sub'] = $tmp;
// --------------------
}
elseif($type == 'logout')
elseif($type == self::ADMIN_NAV_LOGOUT)
{
$tmp = array();
@ -1774,14 +1780,15 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$tmp[8]['image_large_src'] = '';
$tmp[8]['link_class'] = '';
$menu_vars['logout']['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;
$menu_vars['logout']['link'] = '#';
$menu_vars['logout']['image'] = $tp->toAvatar(null, array('w'=>30,'h'=>30,'crop'=>1, 'shape'=>'circle')); // $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$menu_vars['logout']['image_src'] = LAN_LOGOUT;
$menu_vars['logout']['sub'] = $tmp;
$menu_vars[$type]['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;
$menu_vars[$type]['link'] = '#';
$menu_vars[$type]['image'] = $tp->toAvatar(null, array('w'=>30,'h'=>30,'crop'=>1, 'shape'=>'circle')); // $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
$menu_vars[$type]['image_src'] = LAN_LOGOUT;
$menu_vars[$type]['sub'] = $tmp;
$menu_vars[$type]['template'] = $type;
}
if($type == 'language')
if($type == self::ADMIN_NAV_LANGUAGE)
{
$slng = e107::getLanguage();
$languages = $slng->installed();//array('English','French');
@ -1839,11 +1846,12 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$c++;
}
$menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE;
$menu_vars['language']['link'] = '#';
$menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
$menu_vars['language']['image_src'] = null;
$menu_vars['language']['sub'] = $tmp;
$menu_vars[$type]['text'] = strtoupper(e_LAN); // e_LANGUAGE;
$menu_vars[$type]['link'] = '#';
$menu_vars[$type]['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
$menu_vars[$type]['image_src'] = null;
$menu_vars[$type]['sub'] = $tmp;
$menu_vars[$type]['template'] = $type;
}
}
@ -1877,6 +1885,8 @@ Inverse 10 <span class="badge badge-inverse">10</span>
$var = array();
foreach($pref['sitetheme_layouts'] as $key=>$val)
{
$layoutName = str_replace($search,$replace,$key);
@ -1902,6 +1912,8 @@ Inverse 10 <span class="badge badge-inverse">10</span>
e107::setRegistry('core/e107/menu-manager/curLayout',$action);
return e107::getNav()->admin(ADLAN_6,$action, $var);

View File

@ -155,7 +155,7 @@ class sitelinks
$render_link[$key] .= $this->subLink($main_linkid,$aSubStyle,$css_class);
}
}
if(!empty($style['linkseparator']))
{
$text .= implode($style['linkseparator'], $render_link);
@ -1243,27 +1243,24 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
// $temp = $tmpl['button'.$kpost];
// echo "ap = ".$active_page;
// echo " act = ".$act."<br /><br />";
if($rid == 'adminhome')
{
$temp = $tmpl['button_other'.$kpost];
}
if(!empty($e107_vars[$act]['template']))
{
$tmplateKey = 'button_'.$e107_vars[$act]['template'].$kpost;
$temp = $tmpl[$tmplateKey];
// e107::getDebug()->log($tmplateKey);
}
if($rid == 'home')
{
$temp = $tmpl['button_home'.$kpost];
}
if($rid == 'language')
{
$temp = $tmpl['button_language'.$kpost];
}
if($rid == 'logout')
{
$temp = $tmpl['button_logout'.$kpost];
}
$replace[0] = str_replace(" ", "&nbsp;", $e107_vars[$act]['text']);
// valid URLs
$replace[1] = str_replace(array('&amp;', '&'), array('&', '&amp;'), vartrue($e107_vars[$act]['link'], "#{$act}"));

View File

@ -329,7 +329,7 @@ class e_theme
$vars['path'] = $path;
$vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
$vars['preview'] = varset($vars['screenshots']['image']);
$vars['thumbnail'] = varset($vars['preview'][0]);
$vars['thumbnail'] = isset($vars['preview'][0]) ? $vars['preview'][0] : '';
if(!empty($vars['themePrefs']))

View File

@ -1305,7 +1305,7 @@ td.forumheader { background-image: linear-gradient(#303030,#212121 60%,#171717);
.navbar-nav > li > a.admin-icon-avatar { padding-top:9px; padding-bottom:5px}
.navbar-nav > li > a.admin-icon-avatar { padding-top: 11px; padding-bottom: 10px;}

View File

@ -48,7 +48,7 @@ $E_ADMIN_NAVIGATION['button_active'] = '
// Leave Admin Area.
$E_ADMIN_NAVIGATION['button_home'] = '
$E_ADMIN_NAVIGATION['button_enav_home'] = '
<li class="dropdown">
<a class="dropdown-toggle" style="display:inline-block; margin-right:0;" title="'.ADLAN_53.'" href="'.e_HTTP.'" >
{LINK_IMAGE} {LINK_TEXT}
@ -60,7 +60,7 @@ $E_ADMIN_NAVIGATION['button_home'] = '
';
// Change Language
$E_ADMIN_NAVIGATION['button_language'] = '
$E_ADMIN_NAVIGATION['button_enav_language'] = '
<li class="dropdown">
<a class="dropdown-toggle" title="'.LAN_CHANGE_LANGUAGE.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
{LINK_IMAGE} {LINK_TEXT}
@ -83,7 +83,7 @@ $E_ADMIN_NAVIGATION['button_language'] = '
// Logout / Settings / Personalize
$E_ADMIN_NAVIGATION['button_logout'] = '
$E_ADMIN_NAVIGATION['button_enav_logout'] = '
<li class="dropdown">
<a class="dropdown-toggle admin-icon-avatar " title="'.$label.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
{LINK_IMAGE} {LINK_TEXT}
@ -244,9 +244,9 @@ $ADMIN_HEADER = $ADMIN_MODAL . '
<div class="navbar-collapse collapse">
{ADMIN_NAVIGATION=no-main}
<div>
{ADMIN_NAVIGATION=logout}
{ADMIN_NAVIGATION=language}
{ADMIN_NAVIGATION=home}
{ADMIN_NAVIGATION=enav_logout}
{ADMIN_NAVIGATION=enav_language}
{ADMIN_NAVIGATION=enav_home}
{ADMIN_PM}
{ADMIN_DEBUG}
{ADMIN_UPDATE}