1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

AdminUI: Menu icon added.

This commit is contained in:
Cameron
2016-11-01 16:42:47 -07:00
parent c911ded19b
commit a3312a24a6
6 changed files with 49 additions and 12 deletions

View File

@@ -69,6 +69,8 @@ class page_admin extends e_admin_dispatcher
'page/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '0') 'page/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '0')
); );
protected $adminMenuIcon = 'e-custom-24';
protected $adminMenuAliases = array( protected $adminMenuAliases = array(
'page/edit' => 'page/list', 'page/edit' => 'page/list',

View File

@@ -88,6 +88,7 @@ class news_admin extends e_admin_dispatcher
// 'main/maint' => array('caption'=> LAN_NEWS_55, 'perm' => '0') // Maintenance // 'main/maint' => array('caption'=> LAN_NEWS_55, 'perm' => '0') // Maintenance
); );
protected $adminMenuIcon = 'e-news-24';
protected $adminMenuAliases = array( protected $adminMenuAliases = array(

View File

@@ -1001,6 +1001,7 @@ class e_admin_dispatcher
protected $adminMenu = array(); protected $adminMenu = array();
protected $adminMenuIcon = null;
/** /**
* Optional (set by child class). * Optional (set by child class).
* Page titles for pages not in adminMenu (e.g. main/edit) * Page titles for pages not in adminMenu (e.g. main/edit)
@@ -1573,7 +1574,10 @@ class e_admin_dispatcher
$request = $this->getRequest(); $request = $this->getRequest();
if(!$selected) $selected = $request->getMode().'/'.$request->getAction(); if(!$selected) $selected = $request->getMode().'/'.$request->getAction();
$selected = vartrue($this->adminMenuAliases[$selected], $selected); $selected = vartrue($this->adminMenuAliases[$selected], $selected);
return e107::getNav()->admin($this->menuTitle, $selected, $var);
$icon = (deftrue('e_CURRENT_PLUGIN')) ? e107::getPlugin()->getIcon(e_CURRENT_PLUGIN, 32, '') : e107::getParser()->toIcon($this->adminMenuIcon);
return e107::getNav()->admin($icon."<span>".$this->menuTitle."</span>", $selected, $var);
} }

View File

@@ -3498,6 +3498,12 @@ class e_parser
if(substr($text,0,2) == 'e-') // e107 admin icon. if(substr($text,0,2) == 'e-') // e107 admin icon.
{ {
$size = (substr($text,-3) == '-32') ? 'S32' : 'S16'; $size = (substr($text,-3) == '-32') ? 'S32' : 'S16';
if(substr($text,-3) == '-24')
{
$size = 'S24';
}
return "<i class='".$size." ".$text."'></i>"; return "<i class='".$size." ".$text."'></i>";
} }

View File

@@ -3264,23 +3264,24 @@ class e107plugin
} }
// return the Icon of the // return the Icon of the
function getIcon($plugName='',$size=32) function getIcon($plugName='',$size=32, $defaultOverride=false)
{ {
if(!$plugName) return; if(!$plugName) return false;
$tp = e107::getParser(); $tp = e107::getParser();
if(!isset($this->parsed_plugin[$plugName])) if(!isset($this->parsed_plugin[$plugName]))
{ {
$plug_vars = $this->parse_plugin($plugName); $this->parse_plugin($plugName,true);
}
else
{
$plug_vars = $this->parsed_plugin[$plugName];
} }
$plug_vars = $this->parsed_plugin[$plugName];
//return print_r($plug_vars,TRUE); //return print_r($plug_vars,TRUE);
$sizeArray = array(32=>'icon', 16=>'iconSmall'); $sizeArray = array(32=>'icon', 16=>'iconSmall');
$default = ($size == 32) ? $tp->toGlyph('e-cat_plugins-32') : "<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]; $sz = $sizeArray[$size];
@@ -3288,6 +3289,12 @@ class e107plugin
$icon_src = e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz]; $icon_src = e_PLUGIN.$plugName."/".$plug_vars['administration'][$sz];
$plugin_icon = $plug_vars['administration'][$sz] ? "<img src='{$icon_src}' alt='' class='icon S".intval($size)."' />" : $default; $plugin_icon = $plug_vars['administration'][$sz] ? "<img src='{$icon_src}' alt='' class='icon S".intval($size)."' />" : $default;
if($defaultOverride !== false && $default === $plugin_icon)
{
return $defaultOverride;
}
if(!$plugin_icon) if(!$plugin_icon)
{ {
// //

View File

@@ -593,6 +593,8 @@ i.S16, li.plupload_done a {
line-height: 14px; line-height: 14px;
vertical-align: text-top; vertical-align: text-top;
} }
i.e-add-16{ background-position: 0 0; width: 16px; height: 16px; } i.e-add-16{ background-position: 0 0; width: 16px; height: 16px; }
i.e-adminlogs-16{ background-position: -21px 0; width: 16px; height: 16px; } i.e-adminlogs-16{ background-position: -21px 0; width: 16px; height: 16px; }
i.e-adminpass-16{ background-position: -42px 0; width: 16px; height: 16px; } i.e-adminpass-16{ background-position: -42px 0; width: 16px; height: 16px; }
@@ -686,6 +688,17 @@ i.S32 {
height:32px; height:32px;
} }
i.S24 {
background: url(images/adminicons_32.png) no-repeat top left;
display: inline-block;
background-size: 1522px;
width:24px;
height:24px;
}
i.e-news-24{ background-position: -1442px 0; }
i.e-custom-24{ background-position: -639px 0; }
i.e-add-32{ background-position: 0 0; width: 32px; height: 32px; } i.e-add-32{ background-position: 0 0; width: 32px; height: 32px; }
i.e-adminlogs-32{ background-position: -37px 0; width: 32px; height: 32px; } i.e-adminlogs-32{ background-position: -37px 0; width: 32px; height: 32px; }
i.e-adminpass-32{ background-position: -74px 0; width: 32px; height: 32px; } i.e-adminpass-32{ background-position: -74px 0; width: 32px; height: 32px; }
@@ -1265,6 +1278,10 @@ li.after-submit:hover { background-color: #337AB7; color:white }
.plugin-manager .fa-refresh { padding-top: 4px } .plugin-manager .fa-refresh { padding-top: 4px }
#left-panel .panel-title span { display: inline-block; vertical-align: middle; color:white;text-shadow:0 1px 1px #000}
#left-panel .panel-title .S24, #left-panel .panel-title img { margin-right:6px; width:24px; height:24px; vertical-align:middle}
/* /*
body { background-color: rgb(68, 68, 68); } body { background-color: rgb(68, 68, 68); }