From 9d4d0b81764b5865515e1ba6ec65d00d349f68f7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 19 Nov 2017 07:29:10 -0800 Subject: [PATCH] Fix for large amount of submenu items in admin menu. --- e107_handlers/sitelinks_class.php | 26 ++++++++++++++++++++--- e107_themes/bootstrap3/admin_template.php | 2 +- e107_themes/bootstrap3/css/kadmin.css | 10 +++++++-- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index c8335e2b0..ef755e93c 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -1347,7 +1347,9 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $search[7] = '/\{LINK_CLASS\}(.*?)/si'; $search[8] = '/\{SUB_CLASS\}(.*?)/si'; $search[9] = '/\{LINK_IMAGE\}(.*?)/si'; - $search[10] = '/\{LINK_DATA\}/si'; + $search[10] = '/\{LINK_SUB_OVERSIZED\}/si'; + $search[11] = '/\{LINK_DATA\}/si'; + foreach (array_keys($e107_vars) as $act) { @@ -1446,6 +1448,8 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $replace[9] = varset($e107_vars[$act]['image']); } + $replace[10] = count($e107_vars[$act]['sub']) > 20 ? 'oversized' : ''; + if(!empty($e107_vars[$act]['link_data'])) { @@ -1455,10 +1459,12 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $dataTmp[] = $k.'="'.$v.'"'; } - $replace[10] = implode(" ", $dataTmp); // $e107_vars[$act]['link_data'] + $replace[11] = implode(" ", $dataTmp); // $e107_vars[$act]['link_data'] } - + + + if($rid == 'logout' || $rid == 'home' || $rid == 'language') { @@ -2011,6 +2017,20 @@ class navigation_shortcodes extends e_shortcode return $url; } +/* + function sc_link_sub_oversized($parm='') + { + $count = count($this->var['link_sub']); + + if(!empty($parm) && $count > $parm) + { + return 'oversized'; + } + + return $count; + + } +*/ /** * Returns only the anchor target in the URL if one is found. diff --git a/e107_themes/bootstrap3/admin_template.php b/e107_themes/bootstrap3/admin_template.php index 6999a70a4..42288183f 100644 --- a/e107_themes/bootstrap3/admin_template.php +++ b/e107_themes/bootstrap3/admin_template.php @@ -128,7 +128,7 @@ $E_ADMIN_NAVIGATION['button_other'] = ' '; $E_ADMIN_NAVIGATION['start_sub'] = ' -