1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Corrected outdated icon paths

This commit is contained in:
Cameron 2014-01-22 06:10:44 -08:00
parent 3d04b8690a
commit 99af352647
8 changed files with 93 additions and 62 deletions

View File

@ -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";
}

View File

@ -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 }

View File

@ -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;
}

View File

@ -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

View File

@ -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,6 +2707,11 @@ class e_parser
$parm = array();
}
if(substr($text,0,2) == 'e-') // e107 admin icon.
{
$size = (substr($text,-3) == '-32') ? 'S32' : 'S16';
return "<i class='".$size." ".$text."'></i>";
}
// 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.
{
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) ? "<span class='".$cls."'></span>" : "<i class='".$cls."'></i>"; // retain space.
$text = "<span class='".$cls."'></span>" ;
$text .= ($space !== false) ? $space : "";
return $text;
$cls = str_replace('icon-', 'fa fa-', $cls);
}
elseif(defset("BOOTSTRAP")===3)
{
$cls = str_replace('icon-', 'glyphicon glyphicon-', $cls);
}
return false;
if($type == 'fa')
{
$cls = str_replace('fa-', 'fa fa-', $cls);
$cls .= (vartrue($parm['size'])) ? ' fa-'.$parm['size'] : '';
}
// $text = (deftrue('BOOTSTRAP') === 3) ? "<span class='".$cls."'></span>" : "<i class='".$cls."'></i>"; // retain space.
$text = "<span class='".$cls."'></span>" ;
$text .= ($space !== false) ? $space : "";
return $text;
//$text = preg_replace('/\[(i_[\w]*)\]/',"<i class='$1'></i>", $text);
// return $text;
@ -2763,13 +2764,14 @@ 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);
}

View File

@ -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 : "<img class='icon S16' src='".E_16_CAT_PLUG."' alt='' />";
$default = ($size == 32) ? $tp->toGlyph('e-cat_plugins-32') : "<img class='icon S16' src='".E_16_CAT_PLUG."' alt='' />";
$sz = $sizeArray[$size];
$icon_src = e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz];

View File

@ -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['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

View File

@ -989,15 +989,16 @@ class themeHandler
$ns = e107::getRender();
$pref = e107::getPref();
$frm = e107::getForm();
$tp = e107::getParser();
$author = ($theme['email'] ? "<a href='mailto:".$theme['email']."' title='".$theme['email']."'>".$theme['author']."</a>" : $theme['author']);
$website = ($theme['website'] ? "<a href='".$theme['website']."' rel='external'>".$theme['website']."</a>" : "");
// $preview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='border: 1px solid #000;width:200px' alt='' />" : "<img src='".e_IMAGE_ABS."admin_images/nopreview.png' title='".TPVLAN_12."' alt='' />")."</a>";
$main_icon = ($pref['sitetheme'] != $theme['path']) ? "<input class='top' type='image' src='".e_IMAGE_ABS."admin_images/main_32.png' name='selectmain[".$theme['id']."]' alt=\"".TPVLAN_10."\" title=\"".TPVLAN_10."\" />" : E_32_TRUE;
$main_icon = ($pref['sitetheme'] != $theme['path']) ? "<button class='top' type='submit' name='selectmain[".$theme['id']."]' alt=\"".TPVLAN_10."\" title=\"".TPVLAN_10."\" >".$tp->toGlyph('fa-home',array('size'=>'2x'))."</button>" : $tp->toGlyph('fa-check',array('size'=>'2x'));
// $info_icon = "<a data-toggle='modal' data-target='".e_SELF."' href='#themeInfo_".$theme['id']."' class='e-tip' title='".TPVLAN_7."'><img src='".e_IMAGE_ABS."admin_images/info_32.png' alt='' class='icon S32' /></a>";
$info_icon = "<a data-toggle='modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" href='".e_SELF."?id=".$theme['path']."' data-target='#uiModal' title='".TPVLAN_7."'>".E_32_CAT_ABOUT."</a>";
$info_icon = "<a data-toggle='modal' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" href='".e_SELF."?id=".$theme['path']."' data-target='#uiModal' title='".TPVLAN_7."'>".$tp->toGlyph('fa-info-circle',array('size'=>'2x'))."</a>";
// $preview_icon = "<a title='Preview : ".$theme['name']."' rel='external' class='e-dialog' href='".e_BASE."index.php?themepreview.".$theme['id']."'>".E_32_SEARCH."</a>";
$admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "<input class='top' type='image' src='".e_IMAGE_ABS."e107_icon_32.png' name='selectadmin[".$theme['id']."]' alt=\"".TPVLAN_32."\" title=\"".TPVLAN_32."\" />\n" : E_32_TRUE;
$admin_icon = ($pref['admintheme'] != $theme['path'] ) ? "<button class='top' type='submit' name='selectadmin[".$theme['id']."]' alt=\"".TPVLAN_32."\" title=\"".TPVLAN_32."\" >".$tp->toGlyph('fa-gears',array('size'=>'2x'))."</button>\n" : $tp->toGlyph('fa-check',array('size'=>'2x'));
$price = '';
if(substr($theme['thumbnail'],0,4) == 'http')
@ -1056,7 +1057,7 @@ class themeHandler
}
$preview_icon = "<a title='Preview/Live-Demo : ".$theme['name']."' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" rel='external' class='e-modal' href='".$previewPath."'>".E_32_SEARCH."</a>";
$preview_icon = "<a class='e-modal' title='Preview/Live-Demo : ".$theme['name']."' data-modal-caption=\"".$theme['name']." ".$theme['version']."\" rel='external' href='".$previewPath."'>".$tp->toGlyph('fa-search',array('size'=>'2x'))."</a>";
if(!in_array($theme['path'], $this->approvedAdminThemes))