diff --git a/e107_admin/includes/flexpanel.php b/e107_admin/includes/flexpanel.php index 2540d3118..289b92e04 100644 --- a/e107_admin/includes/flexpanel.php +++ b/e107_admin/includes/flexpanel.php @@ -174,31 +174,16 @@ class adminstyle_flexpanel extends adminstyle_infopanel $myE107 = varset($user_pref['core-infopanel-mye107'], array()); if(empty($myE107)) // Set default icons. { - $defArray = array( - 0 => 'e-administrator', - 1 => 'e-cpage', - 2 => 'e-frontpage', - 3 => 'e-mailout', - 4 => 'e-image', - 5 => 'e-menus', - 6 => 'e-meta', - 7 => 'e-newspost', - 8 => 'e-plugin', - 9 => 'e-prefs', - 10 => 'e-links', - 11 => 'e-theme', - 12 => 'e-userclass2', - 13 => 'e-users', - 14 => 'e-wmessage' - ); - $user_pref['core-infopanel-mye107'] = $defArray; + $user_pref['core-infopanel-mye107'] = e107::getNav()->getDefaultAdminPanelArray(); } + + $ns->setStyle('flexpanel'); $mainPanel = "
"; $mainPanel .= "
"; foreach($this->iconlist as $key => $val) { - if(empty($myE107) || in_array($key, $user_pref['core-infopanel-mye107'])) + if(in_array($key, $user_pref['core-infopanel-mye107'])) { $mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div"); } diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 87d0aa1a4..c85dad49a 100755 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -229,28 +229,10 @@ class adminstyle_infopanel $myE107 = varset($user_pref['core-infopanel-mye107'], array()); if(empty($myE107)) // Set default icons. { - $defArray = array( - 0 => 'e-administrator', - 1 => 'e-cpage', - 2 => 'e-frontpage', - 3 => 'e-mailout', - 4 => 'e-image', - 5 => 'e-menus', - 6 => 'e-meta', - 7 => 'e-newspost', - 8 => 'e-plugin', - 9 => 'e-prefs', - 10 => 'e-links', - 11 => 'e-theme', - 12 => 'e-userclass2', - 13 => 'e-users', - 14 => 'e-wmessage' - ); - $user_pref['core-infopanel-mye107'] = $defArray; + $user_pref['core-infopanel-mye107'] = e107::getNav()->getDefaultAdminPanelArray(); } - - + // "
"; $tp->parseTemplate("{SETSTYLE=core-infopanel}"); @@ -266,7 +248,7 @@ class adminstyle_infopanel foreach ($this->iconlist as $key=>$val) { - if (empty($myE107) || in_array($key, $user_pref['core-infopanel-mye107'])) + if (in_array($key, $user_pref['core-infopanel-mye107'])) { $mainPanel .= e107::getNav()->renderAdminButton($val['link'], $val['title'], $val['caption'], $val['perms'], $val['icon_32'], "div"); } diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 064fe8495..7faa3b394 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -945,6 +945,59 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } } + /** + * Return the default array of icon identifiers for the admin "Control Panel". (infopanel and flexpanel) + * @return array + */ + public function getDefaultAdminPanelArray() + { + $iconlist = $this->adminLinks(); + + $defArray = array(); + + $exclude = array ( + 'e-administrator', + 'e-updateadmin', + 'e-banlist', + 'e-cache', + 'e-comment', + 'e-credits', + 'e-db', + 'e-docs', + 'e-emoticon', + 'e-users_extended', + 'e-fileinspector', + 'e-language', + 'e-ugflag', + 'e-notify', + 'e-phpinfo', + 'e-upload', + 'e-cron', + 'e-search', + 'e-admin_log', + 'e-eurl' + ); + + $count = 0; + + foreach($iconlist as $k=>$v) + { + if($count === 20) + { + break; + } + + if(!in_array($k,$exclude)) + { + $defArray[] = $k; + $count++; + } + } + + return $defArray; + } + + private function convert_core_icons($newarray) // Put core button array in the same format as plugin button array.