1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Admin menu icons for collapsed menu.

This commit is contained in:
Cameron
2021-02-01 18:18:30 -08:00
parent 4aae483790
commit 9890615761
17 changed files with 1762 additions and 1646 deletions

View File

@@ -1615,7 +1615,6 @@ class e_admin_dispatcher
break;
}
// Access check done above
// if($val['perm']!= null) // check perms
@@ -1632,7 +1631,12 @@ class e_admin_dispatcher
}
}
// guess an icon.
if(!isset($var[$key]['image_src']))
{
$var[$key]['image_src'] = $this->guessMenuIcon($key);
}
// TODO slide down menu options?
@@ -1696,6 +1700,50 @@ class e_admin_dispatcher
}
/**
* Guess the admin menu item icon based on the path
* @param $key
* @return string
*/
private function guessMenuIcon($key)
{
list($mode, $action) = explode('/',$key);
switch($action)
{
case 'list':
$ret = $ret = ($mode === 'cat') ? 'fa-folder.glyph' : 'fa-list.glyph';
break;
case 'options':
case 'prefs':
$ret = 'fa-cog.glyph';
break;
case 'create':
$ret = ($mode === 'cat') ? 'fa-folder-plus.glyph' : 'fa-plus.glyph';
break;
case 'tools':
case 'maint':
$ret = 'fas-toolbox.glyph';
break;
case 'import':
case 'upload':
$ret = 'fa-upload.glyph';
break;
default:
$ret = 'fa-question.glyph';
// code to be executed if n is different from all labels;
}
return $ret;
}
/**
* Render Help Text in <ul> format. XXX TODO
*/