mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Fix for conflict between theme layouts called 'home' and menu-manager navigation.
This commit is contained in:
parent
eaebab16f5
commit
57c41f5ae9
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# EditorConfig is awesome: http://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*.php]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
@ -780,6 +780,9 @@ class e_menu_layout
|
|||||||
$theme = e107::pref('core','sitetheme');
|
$theme = e107::pref('core','sitetheme');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
$HEADER = null;
|
$HEADER = null;
|
||||||
$FOOTER = null;
|
$FOOTER = null;
|
||||||
$LAYOUT = null;
|
$LAYOUT = null;
|
||||||
|
@ -16,6 +16,10 @@ if (!defined('e107_INIT')) { exit; }
|
|||||||
class admin_shortcodes
|
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)
|
function cronUpdateRender($parm,$cacheData)
|
||||||
{
|
{
|
||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
@ -1418,7 +1422,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
|
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
|
||||||
global $$tmpl;
|
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;
|
$template = $$tmpl;
|
||||||
|
|
||||||
@ -1480,6 +1484,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$tmp['sub_class'] = '';
|
$tmp['sub_class'] = '';
|
||||||
$tmp['sort'] = false;
|
$tmp['sort'] = false;
|
||||||
|
|
||||||
|
|
||||||
if(vartrue($pref['admin_slidedown_subs']) && vartrue($array_sub_functions[$key]))
|
if(vartrue($pref['admin_slidedown_subs']) && vartrue($array_sub_functions[$key]))
|
||||||
{
|
{
|
||||||
$tmp['sub_class'] = 'sub';
|
$tmp['sub_class'] = 'sub';
|
||||||
@ -1649,15 +1654,16 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
|
|
||||||
if($type == 'home')
|
if($type === self::ADMIN_NAV_HOME)
|
||||||
{
|
{
|
||||||
|
|
||||||
$menu_vars['home']['text'] = ""; // ADLAN_53;
|
$menu_vars[$type]['text'] = ""; // ADLAN_53;
|
||||||
$menu_vars['home']['link'] = e_HTTP.'index.php';
|
$menu_vars[$type]['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[$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['home']['image_src'] = ADLAN_151;
|
$menu_vars[$type]['image_src'] = ADLAN_151;
|
||||||
$menu_vars['home']['sort'] = 1;
|
$menu_vars[$type]['sort'] = 1;
|
||||||
$menu_vars['home']['sub_class'] = 'sub';
|
$menu_vars[$type]['sub_class'] = 'sub';
|
||||||
|
$menu_vars[$type]['template'] = $type;
|
||||||
|
|
||||||
// Sub Links for 'home'.
|
// Sub Links for 'home'.
|
||||||
require_once(e_HANDLER."sitelinks_class.php");
|
require_once(e_HANDLER."sitelinks_class.php");
|
||||||
@ -1682,10 +1688,10 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu_vars['home']['sub'] = $tmp;
|
$menu_vars[$type]['sub'] = $tmp;
|
||||||
// --------------------
|
// --------------------
|
||||||
}
|
}
|
||||||
elseif($type == 'logout')
|
elseif($type == self::ADMIN_NAV_LOGOUT)
|
||||||
{
|
{
|
||||||
$tmp = array();
|
$tmp = array();
|
||||||
|
|
||||||
@ -1774,14 +1780,15 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$tmp[8]['image_large_src'] = '';
|
$tmp[8]['image_large_src'] = '';
|
||||||
$tmp[8]['link_class'] = '';
|
$tmp[8]['link_class'] = '';
|
||||||
|
|
||||||
$menu_vars['logout']['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;
|
$menu_vars[$type]['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;
|
||||||
$menu_vars['logout']['link'] = '#';
|
$menu_vars[$type]['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[$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['logout']['image_src'] = LAN_LOGOUT;
|
$menu_vars[$type]['image_src'] = LAN_LOGOUT;
|
||||||
$menu_vars['logout']['sub'] = $tmp;
|
$menu_vars[$type]['sub'] = $tmp;
|
||||||
|
$menu_vars[$type]['template'] = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($type == 'language')
|
if($type == self::ADMIN_NAV_LANGUAGE)
|
||||||
{
|
{
|
||||||
$slng = e107::getLanguage();
|
$slng = e107::getLanguage();
|
||||||
$languages = $slng->installed();//array('English','French');
|
$languages = $slng->installed();//array('English','French');
|
||||||
@ -1839,11 +1846,12 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
$menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE;
|
$menu_vars[$type]['text'] = strtoupper(e_LAN); // e_LANGUAGE;
|
||||||
$menu_vars['language']['link'] = '#';
|
$menu_vars[$type]['link'] = '#';
|
||||||
$menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
|
$menu_vars[$type]['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
|
||||||
$menu_vars['language']['image_src'] = null;
|
$menu_vars[$type]['image_src'] = null;
|
||||||
$menu_vars['language']['sub'] = $tmp;
|
$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();
|
$var = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($pref['sitetheme_layouts'] as $key=>$val)
|
foreach($pref['sitetheme_layouts'] as $key=>$val)
|
||||||
{
|
{
|
||||||
$layoutName = str_replace($search,$replace,$key);
|
$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);
|
e107::setRegistry('core/e107/menu-manager/curLayout',$action);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return e107::getNav()->admin(ADLAN_6,$action, $var);
|
return e107::getNav()->admin(ADLAN_6,$action, $var);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1244,25 +1244,22 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
|||||||
// echo "ap = ".$active_page;
|
// echo "ap = ".$active_page;
|
||||||
// echo " act = ".$act."<br /><br />";
|
// echo " act = ".$act."<br /><br />";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($rid == 'adminhome')
|
if($rid == 'adminhome')
|
||||||
{
|
{
|
||||||
$temp = $tmpl['button_other'.$kpost];
|
$temp = $tmpl['button_other'.$kpost];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($rid == 'home')
|
if(!empty($e107_vars[$act]['template']))
|
||||||
{
|
{
|
||||||
$temp = $tmpl['button_home'.$kpost];
|
$tmplateKey = 'button_'.$e107_vars[$act]['template'].$kpost;
|
||||||
|
$temp = $tmpl[$tmplateKey];
|
||||||
|
|
||||||
|
// e107::getDebug()->log($tmplateKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($rid == 'language')
|
|
||||||
{
|
|
||||||
$temp = $tmpl['button_language'.$kpost];
|
|
||||||
}
|
|
||||||
|
|
||||||
if($rid == 'logout')
|
|
||||||
{
|
|
||||||
$temp = $tmpl['button_logout'.$kpost];
|
|
||||||
}
|
|
||||||
|
|
||||||
$replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']);
|
$replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']);
|
||||||
// valid URLs
|
// valid URLs
|
||||||
|
@ -329,7 +329,7 @@ class e_theme
|
|||||||
$vars['path'] = $path;
|
$vars['path'] = $path;
|
||||||
$vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
|
$vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
|
||||||
$vars['preview'] = varset($vars['screenshots']['image']);
|
$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']))
|
if(!empty($vars['themePrefs']))
|
||||||
|
@ -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;}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ $E_ADMIN_NAVIGATION['button_active'] = '
|
|||||||
|
|
||||||
|
|
||||||
// Leave Admin Area.
|
// Leave Admin Area.
|
||||||
$E_ADMIN_NAVIGATION['button_home'] = '
|
$E_ADMIN_NAVIGATION['button_enav_home'] = '
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a class="dropdown-toggle" style="display:inline-block; margin-right:0;" title="'.ADLAN_53.'" href="'.e_HTTP.'" >
|
<a class="dropdown-toggle" style="display:inline-block; margin-right:0;" title="'.ADLAN_53.'" href="'.e_HTTP.'" >
|
||||||
{LINK_IMAGE} {LINK_TEXT}
|
{LINK_IMAGE} {LINK_TEXT}
|
||||||
@ -60,7 +60,7 @@ $E_ADMIN_NAVIGATION['button_home'] = '
|
|||||||
';
|
';
|
||||||
|
|
||||||
// Change Language
|
// Change Language
|
||||||
$E_ADMIN_NAVIGATION['button_language'] = '
|
$E_ADMIN_NAVIGATION['button_enav_language'] = '
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a class="dropdown-toggle" title="'.LAN_CHANGE_LANGUAGE.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
|
<a class="dropdown-toggle" title="'.LAN_CHANGE_LANGUAGE.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
|
||||||
{LINK_IMAGE} {LINK_TEXT}
|
{LINK_IMAGE} {LINK_TEXT}
|
||||||
@ -83,7 +83,7 @@ $E_ADMIN_NAVIGATION['button_language'] = '
|
|||||||
|
|
||||||
|
|
||||||
// Logout / Settings / Personalize
|
// Logout / Settings / Personalize
|
||||||
$E_ADMIN_NAVIGATION['button_logout'] = '
|
$E_ADMIN_NAVIGATION['button_enav_logout'] = '
|
||||||
<li class="dropdown">
|
<li class="dropdown">
|
||||||
<a class="dropdown-toggle admin-icon-avatar " title="'.$label.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
|
<a class="dropdown-toggle admin-icon-avatar " title="'.$label.'" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" >
|
||||||
{LINK_IMAGE} {LINK_TEXT}
|
{LINK_IMAGE} {LINK_TEXT}
|
||||||
@ -244,9 +244,9 @@ $ADMIN_HEADER = $ADMIN_MODAL . '
|
|||||||
<div class="navbar-collapse collapse">
|
<div class="navbar-collapse collapse">
|
||||||
{ADMIN_NAVIGATION=no-main}
|
{ADMIN_NAVIGATION=no-main}
|
||||||
<div>
|
<div>
|
||||||
{ADMIN_NAVIGATION=logout}
|
{ADMIN_NAVIGATION=enav_logout}
|
||||||
{ADMIN_NAVIGATION=language}
|
{ADMIN_NAVIGATION=enav_language}
|
||||||
{ADMIN_NAVIGATION=home}
|
{ADMIN_NAVIGATION=enav_home}
|
||||||
{ADMIN_PM}
|
{ADMIN_PM}
|
||||||
{ADMIN_DEBUG}
|
{ADMIN_DEBUG}
|
||||||
{ADMIN_UPDATE}
|
{ADMIN_UPDATE}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user