From 99af352647a8e6b64e127eebc7d3dfeed389c85e Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 22 Jan 2014 06:10:44 -0800 Subject: [PATCH] Corrected outdated icon paths --- e107_admin/plugin.php | 4 +- e107_admin/theme.php | 5 +- .../shortcodes/batch/admin_shortcodes.php | 4 +- e107_handlers/e107_class.php | 2 +- e107_handlers/e_parse_class.php | 70 ++++++++++--------- e107_handlers/plugin_class.php | 15 ++-- e107_handlers/sitelinks_class.php | 46 ++++++++---- e107_handlers/theme_handler.php | 9 +-- 8 files changed, 93 insertions(+), 62 deletions(-) diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index f2aef9f3c..43381fd57 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -445,7 +445,7 @@ class pluginManager{ $data[] = array( 'plugin_id' => $row['params']['id'], 'plugin_mode' => $row['params']['mode'], - 'plugin_icon' => vartrue($row['icon'],e_IMAGE."admin_images/plugins_32.png"), + 'plugin_icon' => vartrue($row['icon'],'e-plugins-32'), 'plugin_name' => stripslashes($row['name']), 'plugin_featured' => $featured, 'plugin_folder' => $row['folder'], @@ -1164,7 +1164,7 @@ class pluginManager{ if(!file_exists($plugin_icon)) { - $plugin_icon = e_IMAGE."admin_images/cat_plugins_32.png"; + $plugin_icon = 'e-cat_plugins-32'; // e_IMAGE."admin_images/cat_plugins_32.png"; } diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 75cab95a4..19bc5b2b7 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -41,7 +41,10 @@ e107::css("inline"," display:block;position:relative; text-align:center; vertical-align:middle; top:-141px;} .admin-theme-options:hover { opacity:0.8; } - +.admin-theme-options button { background: none; color: white; border: none; padding:0px; margin:3px; } +.admin-theme-options a {color: inherit; display:inline-block } +.admin-theme-options a span { color: inherit; padding-right: 5px; padding-left:0px; padding-top: 3px; margin-left:3px } +.admin-theme-options .fa-check { color: #FAA732 } .admin-theme-title { line-height: 18px; overflow:hidden; padding-left:5px; white-space:no-wrap; width:200px; position:relative; top:-132px; } .admin-theme-select {border:1px dotted silver;background-color:#DDDDDD;float:left } diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 20bedf1a0..c89d9b46d 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -180,6 +180,8 @@ class admin_shortcodes function sc_admin_icon() { + $tp = e107::getParser(); + if (ADMIN) { global $e_sub_cat, $e_icon_array, $PLUGINS_DIRECTORY; @@ -221,7 +223,7 @@ class admin_shortcodes } else { - $icon = E_32_CAT_PLUG; + $icon = $tp->toGlyph('e-cat_plugins-32'); return $icon; } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 563bc63f1..803cbc44d 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -1750,7 +1750,7 @@ class e107 } /** - * Retrieves config() from a specific plugin for addons such as e_url.php, e_cron.php, e_sitelink.php + * Retrieves class Object for specific plugin's addon such as e_url.php, e_cron.php, e_sitelink.php * FIXME override from e.g. core/override/addons/ * * @param string $pluginName e.g. faq, page diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 8c9dc3c24..3b92c6319 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2687,7 +2687,8 @@ class e_parser /** * Parse xxxxx.glyph file to bootstrap glyph format. - * @return FALSE if not a glyph file or if bootstrap is not found. + * @param string $text + * @param array */ public function toGlyph($text, $space=" ") { @@ -2706,7 +2707,12 @@ class e_parser $parm = array(); } - + if(substr($text,0,2) == 'e-') // e107 admin icon. + { + $size = (substr($text,-3) == '-32') ? 'S32' : 'S16'; + return ""; + } + // Bootstrap 3 Glyph names. $bs3 = e107::getMedia()->getGlyphs('bs3',''); @@ -2715,37 +2721,32 @@ class e_parser $text = 'icon-'.$text.'.glyph'; } -// if(substr($text,-6) == '.glyph' || strpos($text,".")==false) // Bootstrap or Font-Awesome. - { - list($cls,$tmp) = explode('.glyph',$text); - list($type, $tmp2) = explode("-",$text,2); - - $id = str_replace("icon-","",$cls); - - if(deftrue('FONTAWESOME') == 4 && !in_array($id ,$bs3)) // Convert FontAwesome 3 to 4. - { - $cls = str_replace('icon-', 'fa fa-', $cls); - } - elseif(defset("BOOTSTRAP")===3) - { - $cls = str_replace('icon-', 'glyphicon glyphicon-', $cls); - } - - if($type == 'fa') - { - $cls = str_replace('fa-', 'fa fa-', $cls); - $cls .= (vartrue($parm['size'])) ? ' fa-'.$parm['size'] : ''; - } - - // $text = (deftrue('BOOTSTRAP') === 3) ? "" : ""; // retain space. - - $text = "" ; - $text .= ($space !== false) ? $space : ""; - - return $text; - } + list($cls,$tmp) = explode('.glyph',$text); + list($type, $tmp2) = explode("-",$text,2); - return false; + $id = str_replace("icon-","",$cls); + + if(deftrue('FONTAWESOME') == 4 && !in_array($id ,$bs3)) // Convert FontAwesome 3 to 4. + { + $cls = str_replace('icon-', 'fa fa-', $cls); + } + elseif(defset("BOOTSTRAP")===3) + { + $cls = str_replace('icon-', 'glyphicon glyphicon-', $cls); + } + + if($type == 'fa') + { + $cls = str_replace('fa-', 'fa fa-', $cls); + $cls .= (vartrue($parm['size'])) ? ' fa-'.$parm['size'] : ''; + } + // $text = (deftrue('BOOTSTRAP') === 3) ? "" : ""; // retain space. + + $text = "" ; + $text .= ($space !== false) ? $space : ""; + + return $text; + //$text = preg_replace('/\[(i_[\w]*)\]/',"", $text); // return $text; @@ -2762,14 +2763,15 @@ class e_parser */ public function toIcon($icon='',$parm = array()) { - if(!vartrue($icon)) { return; } - if(substr($icon,-6) == '.glyph') // Bootstrap or Font-Awesome. + $ext = pathinfo($icon, PATHINFO_EXTENSION); + + if(!$ext || $ext == '.glyph') // Bootstrap or Font-Awesome. { return $this->toGlyph($icon,$parm); } diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 1f455db5f..b6ed315c9 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -27,11 +27,12 @@ class e107plugin { // Reserved Addon names. var $plugin_addons = array( - 'e_rss', + 'e_bb', + 'e_cron', 'e_notify', 'e_linkgen', 'e_list', - 'e_bb', + 'e_meta', 'e_emailprint', 'e_frontpage', @@ -48,11 +49,13 @@ class e107plugin 'e_userinfo', 'e_tagwords', 'e_url', - 'e_cron', + 'e_mailout', 'e_sitelink', 'e_tohtml', - 'e_featurebox' + 'e_featurebox', + 'e_related', + 'e_rss', ); @@ -2770,6 +2773,8 @@ class e107plugin { if(!$plugName) return; + $tp = e107::getParser(); + if(!isset($this->parsed_plugin[$plugName])) { $plug_vars = $this->parse_plugin($plugName); @@ -2782,7 +2787,7 @@ class e107plugin //return print_r($plug_vars,TRUE); $sizeArray = array(32=>'icon', 16=>'iconSmall'); - $default = ($size == 32) ? E_32_CAT_PLUG : ""; + $default = ($size == 32) ? $tp->toGlyph('e-cat_plugins-32') : ""; $sz = $sizeArray[$size]; $icon_src = e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz]; diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 7b24cb018..092095779 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -666,46 +666,64 @@ class e_navigation //FIXME array structure - see $this->admin(); function adminCats() { - if(count($this->admin_cat)) return $this->admin_cat; + $tp = e107::getParser(); + + if(count($this->admin_cat)) + { + return $this->admin_cat; + } + $pref = e107::getPref(); $this->admin_cat['title'][1] = ADLAN_CL_1; $this->admin_cat['id'][1] = 'setMenu'; - $this->admin_cat['img'][1] = ''; // E_16_CAT_SETT; - $this->admin_cat['lrg_img'][1] = ''; // E_32_CAT_SETT; + $this->admin_cat['img'][1] = $tp->toGlyph('e-settings-16'); + $this->admin_cat['lrg_img'][1] = $tp->toGlyph('e-settings-32'); $this->admin_cat['sort'][1] = true; + +/* + * i.e-cat_content-32{ background-position: -370px 0; width: 32px; height: 32px; } +i.e-cat_files-32{ background-position: -407px 0; width: 32px; height: 32px; } +i.e-cat_plugins-32{ background-position: -444px 0; width: 32px; height: 32px; } +i.e-cat_settings-32{ background-position: -481px 0; width: 32px; height: 32px; } +i.e-cat_tools-32{ background-position: -518px 0; width: 32px; height: 32px; } +i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } + * e-manage-32 + */ + + $this->admin_cat['title'][2] = ADLAN_CL_2; $this->admin_cat['id'][2] = 'userMenu'; - $this->admin_cat['img'][2] = ''; // E_16_CAT_USER; - $this->admin_cat['lrg_img'][2] = ''; // E_32_CAT_USER; + $this->admin_cat['img'][2] = $tp->toGlyph('e-cat_users-16'); + $this->admin_cat['lrg_img'][2] = $tp->toGlyph('e-cat_users-32'); $this->admin_cat['sort'][2] = true; $this->admin_cat['title'][3] = ADLAN_CL_3; $this->admin_cat['id'][3] = 'contMenu'; - $this->admin_cat['img'][3] = ''; // E_16_CAT_CONT; - $this->admin_cat['lrg_img'][3] = ''; // E_32_CAT_CONT; + $this->admin_cat['img'][3] = $tp->toGlyph('e-cat_content-16'); + $this->admin_cat['lrg_img'][3] = $tp->toGlyph('e-cat_content-32'); $this->admin_cat['sort'][3] = true; $this->admin_cat['title'][4] = ADLAN_CL_6; $this->admin_cat['id'][4] = 'toolMenu'; - $this->admin_cat['img'][4] = ''; // E_16_CAT_TOOL; - $this->admin_cat['lrg_img'][4] = ''; // E_32_CAT_TOOL; + $this->admin_cat['img'][4] = $tp->toGlyph('e-cat_tools-16'); + $this->admin_cat['lrg_img'][4] = $tp->toGlyph('e-cat_tools-32'); $this->admin_cat['sort'][4] = true; // Manage $this->admin_cat['title'][5] = LAN_MANAGE; $this->admin_cat['id'][5] = 'managMenu'; - $this->admin_cat['img'][5] = ''; // E_16_CAT_MANAGE; - $this->admin_cat['lrg_img'][5] = ''; // E_32_CAT_MANAGE; + $this->admin_cat['img'][5] = $tp->toGlyph('e-manage-16'); + $this->admin_cat['lrg_img'][5] = $tp->toGlyph('e-manage-32'); $this->admin_cat['sort'][5] = TRUE; if(vartrue($pref['admin_separate_plugins'])) { $this->admin_cat['title'][6] = ADLAN_CL_7; - $this->admin_cat['id'][6] = 'plugMenu'; - $this->admin_cat['img'][6] = ''; // E_16_CAT_PLUG; - $this->admin_cat['lrg_img'][6] = ''; // E_32_CAT_PLUG; + $this->admin_cat['id'][6] = 'plugMenu'; + $this->admin_cat['img'][6] = $tp->toGlyph('e-cat_plugins-16'); + $this->admin_cat['lrg_img'][6] = $tp->toGlyph('e-cat_plugins-32'); $this->admin_cat['sort'][6] = false; } else diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 2ff533d90..4cbbe0eac 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -989,15 +989,16 @@ class themeHandler $ns = e107::getRender(); $pref = e107::getPref(); $frm = e107::getForm(); + $tp = e107::getParser(); $author = ($theme['email'] ? "".$theme['author']."" : $theme['author']); $website = ($theme['website'] ? "".$theme['website']."" : ""); // $preview = "".($theme['preview'] ? "" : "").""; - $main_icon = ($pref['sitetheme'] != $theme['path']) ? "" : E_32_TRUE; + $main_icon = ($pref['sitetheme'] != $theme['path']) ? "" : $tp->toGlyph('fa-check',array('size'=>'2x')); // $info_icon = ""; - $info_icon = "".E_32_CAT_ABOUT.""; + $info_icon = "".$tp->toGlyph('fa-info-circle',array('size'=>'2x')).""; // $preview_icon = "".E_32_SEARCH.""; - $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "\n" : E_32_TRUE; + $admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "\n" : $tp->toGlyph('fa-check',array('size'=>'2x')); $price = ''; if(substr($theme['thumbnail'],0,4) == 'http') @@ -1056,7 +1057,7 @@ class themeHandler } - $preview_icon = "".E_32_SEARCH.""; + $preview_icon = "".$tp->toGlyph('fa-search',array('size'=>'2x')).""; if(!in_array($theme['path'], $this->approvedAdminThemes))