mirror of
https://github.com/e107inc/e107.git
synced 2025-04-14 01:22:13 +02:00
Admin menu icons for collapsed menu.
This commit is contained in:
parent
4aae483790
commit
9890615761
@ -344,16 +344,22 @@ if (!function_exists('show_admin_menu'))
|
||||
* @deprecated Use admin-ui instead.
|
||||
* @param $title
|
||||
* @param $active_page
|
||||
* @param $e107_vars
|
||||
* @param $vars
|
||||
* @param false $js
|
||||
* @param false $sub_link
|
||||
* @param false $sortlist
|
||||
* @return string|null
|
||||
*/
|
||||
function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE)
|
||||
function show_admin_menu($title, $active_page, $var, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE)
|
||||
{
|
||||
unset($js,$sub_link);
|
||||
return e107::getNav()->admin($title, $active_page, $e107_vars, false, false, $sortlist);
|
||||
|
||||
if(!isset($var['_extras_']['icon']) && deftrue('e_CURRENT_PLUGIN'))
|
||||
{
|
||||
$var['_extras_'] = array('icon'=> e107::getPlug()->load(e_CURRENT_PLUGIN)->getIcon(24), 'return'=>false);
|
||||
}
|
||||
|
||||
return e107::getNav()->admin($title, $active_page, $var, false, false, $sortlist);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ class cron_admin extends e_admin_dispatcher
|
||||
|
||||
protected $adminMenu = array(
|
||||
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => '0'),
|
||||
'main/refresh' => array('caption'=> LAN_CRON_M_02, 'perm' => '0','url'=>'cron.php'),
|
||||
'main/refresh' => array('caption'=> LAN_CRON_M_02, 'perm' => '0','url'=>'cron.php', 'icon'=>'fa-sync'),
|
||||
// 'main/prefs' => array('caption'=> 'Settings', 'perm' => '0'),
|
||||
// 'main/custom' => array('caption'=> 'Custom Page', 'perm' => '0')
|
||||
);
|
||||
|
@ -178,13 +178,13 @@ class system_tools
|
||||
'sc_override_scan' => array('diz'=>DBLAN_55, 'label'=> DBLAN_56),
|
||||
'convert_to_utf8' => array('diz'=>DBLAN_64,'label'=>DBLAN_65),
|
||||
'correct_perms' => array('diz'=>DBLAN_66,'label'=>DBLAN_67),
|
||||
'backup' => array('diz'=>DBLAN_68,'label'=>DBLAN_69)
|
||||
'backup' => array('diz'=>DBLAN_68,'label'=>DBLAN_69, 'icon'=>'fas-archive.glyph')
|
||||
);
|
||||
|
||||
if(deftrue('e_DEVELOPER'))
|
||||
{
|
||||
$this->_options['multisite'] = array('diz'=>"<span class='label label-warning'>".DBLAN_114."</span>", 'label'=> 'Multi-Site' );
|
||||
$this->_options['github'] = array('diz'=>"<span class='label label-warning'>".DBLAN_114."</span> ".DBLAN_115."", 'label'=> DBLAN_112 );
|
||||
$this->_options['github'] = array('diz'=>"<span class='label label-warning'>".DBLAN_114."</span> ".DBLAN_115."", 'label'=> DBLAN_112, 'icon'=>'fab-github.glyph' );
|
||||
}
|
||||
|
||||
|
||||
@ -1675,10 +1675,12 @@ function db_adminmenu() //FIXME - has problems when navigation is on the LEFT in
|
||||
{
|
||||
$var[$key]['text'] = $val['label'];
|
||||
$var[$key]['link'] = e_SELF."?mode=".$key;
|
||||
$var[$key]['image_src'] = $val['icon'];
|
||||
}
|
||||
|
||||
$icon = e107::getParser()->toIcon('e-database-24');
|
||||
$caption = $icon."<span>".DBLAN_10."</span>";
|
||||
$caption = "<span>".DBLAN_10."</span>";
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon('e-database-24');
|
||||
|
||||
e107::getNav()->admin($caption, $_GET['mode'], $var);
|
||||
}
|
||||
|
@ -734,11 +734,16 @@ function frontpage_adminmenu()
|
||||
$var['create']['text'] = LAN_CREATE;
|
||||
$var['create']['link'] = e_SELF."?mode=create";
|
||||
|
||||
$icon = e107::getParser()->toIcon('e-frontpage-24');
|
||||
$caption = $icon."<span>".FRTLAN_PAGE_TITLE."</span>";
|
||||
$icon = e107::getParser()->toIcon('e-frontpage-24');
|
||||
$caption = "<span>".FRTLAN_PAGE_TITLE."</span>";
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon('e-frontpage-24');
|
||||
|
||||
return e107::getNav()->admin($caption, $action, $var);
|
||||
|
||||
|
||||
show_admin_menu($caption, $action, $var);
|
||||
|
||||
// show_admin_menu($caption, $action, $var);
|
||||
}
|
||||
|
||||
|
||||
|
@ -318,7 +318,7 @@ $pref['membersonly_exceptions'] = implode("\n",$pref['membersonly_exceptions']);
|
||||
|
||||
$text = "
|
||||
<div id='core-prefs'>
|
||||
<form class='admin-menu' method='post' action='".e_SELF."' autocomplete='off'>
|
||||
<form method='post' action='".e_SELF."' autocomplete='off'>
|
||||
<input type='hidden' name='e-token' value='".defset('e_TOKEN')."' />
|
||||
<fieldset id='core-prefs-main'>
|
||||
<legend>".PRFLAN_1."</legend>
|
||||
@ -1100,7 +1100,13 @@ $text .= "
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td><label for='old_np'>".PRFLAN_124.":</label></td>
|
||||
<td>
|
||||
".$frm->radio_switch('old_np', $pref['old_np'])."
|
||||
<div class='smalltext field-help'>".PRFLAN_125."</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
";
|
||||
@ -1282,13 +1288,7 @@ if ($savePrefs) $core_pref->setPref($pref)->save(false, true);
|
||||
<div class='smalltext field-help'>".PRFLAN_123."</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for='old_np'>".PRFLAN_124.":</label></td>
|
||||
<td>
|
||||
".$frm->radio_switch('old_np', $pref['old_np'])."
|
||||
<div class='smalltext field-help'>".PRFLAN_125."</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
";
|
||||
|
||||
@ -2099,29 +2099,55 @@ function pref_submit($post_id = '')
|
||||
|
||||
function prefs_adminmenu()
|
||||
{
|
||||
$var['core-prefs-header1']['header'] = LAN_BASIC_OPTIONS;
|
||||
$var['core-prefs-header1']['header'] = LAN_BASIC_OPTIONS;
|
||||
|
||||
$var['core-prefs-main']['text'] = PRFLAN_1;
|
||||
$var['core-prefs-main']['image_src'] = 'fa-home.glyph';
|
||||
|
||||
$var['core-prefs-email']['text'] = PRFLAN_254;
|
||||
$var['core-prefs-email']['image_src'] = 'fa-envelope.glyph';
|
||||
|
||||
$var['core-prefs-gdpr']['text'] = PRFLAN_277;
|
||||
$var['core-prefs-gdpr']['image_src'] = 'fa-cookie.glyph';
|
||||
|
||||
$var['core-prefs-registration']['text'] = PRFLAN_28;
|
||||
$var['core-prefs-registration']['image_src'] = 'fas-user-plus.glyph';
|
||||
|
||||
$var['core-prefs-signup']['text'] = PRFLAN_19;
|
||||
// $var['core-prefs-sociallogin']['text'] = "Social Options"; // Moved into plugin.
|
||||
$var['core-prefs-signup']['image_src'] = 'fas-clipboard-list.glyph';
|
||||
|
||||
$var['core-prefs-comments']['text'] = PRFLAN_210;
|
||||
$var['core-prefs-uploads']['text'] = PRFLAN_255;
|
||||
|
||||
$var['core-prefs-header2']['header'] = PRFLAN_256;
|
||||
|
||||
$var['core-prefs-display']['text'] = PRFLAN_13;
|
||||
$var['core-prefs-admindisp']['text'] = PRFLAN_77;
|
||||
$var['core-prefs-textpost']['text'] = PRFLAN_101;
|
||||
$var['core-prefs-security']['text'] = PRFLAN_47;
|
||||
$var['core-prefs-date']['text'] = PRFLAN_21;
|
||||
$var['core-prefs-javascript']['text'] = PRFLAN_257;
|
||||
$var['core-prefs-advanced']['text'] = PRFLAN_149;
|
||||
$var['core-prefs-comments']['image_src'] = 'fa-comments.glyph';
|
||||
|
||||
$icon = e107::getParser()->toIcon('e-prefs-24');
|
||||
$caption = $icon."<span>".LAN_PREFS."</span>";
|
||||
$var['core-prefs-uploads']['text'] = PRFLAN_255;
|
||||
$var['core-prefs-uploads']['image_src'] = 'file-upload.glyph';
|
||||
|
||||
$var['core-prefs-header2']['header'] = PRFLAN_256;
|
||||
|
||||
$var['core-prefs-display']['text'] = PRFLAN_13;
|
||||
$var['core-prefs-display']['image_src'] = 'fas-info-circle.glyph';
|
||||
|
||||
$var['core-prefs-admindisp']['text'] = PRFLAN_77;
|
||||
$var['core-prefs-admindisp']['image_src'] = 'fa-dashboard.glyph';
|
||||
|
||||
$var['core-prefs-textpost']['text'] = PRFLAN_101;
|
||||
$var['core-prefs-textpost']['image_src'] = 'fa-filter.glyph';
|
||||
|
||||
$var['core-prefs-security']['text'] = PRFLAN_47;
|
||||
$var['core-prefs-security']['image_src'] = 'fas-shield-alt.glyph';
|
||||
|
||||
$var['core-prefs-date']['text'] = PRFLAN_21;
|
||||
$var['core-prefs-date']['image_src'] = 'fa-calendar.glyph';
|
||||
|
||||
$var['core-prefs-javascript']['text'] = PRFLAN_257;
|
||||
$var['core-prefs-javascript']['image_src'] = 'fab-js.glyph';
|
||||
|
||||
$var['core-prefs-advanced']['text'] = PRFLAN_149;
|
||||
$var['core-prefs-advanced']['image_src'] = 'fa-cogs.glyph';
|
||||
|
||||
$caption = "<span>".LAN_PREFS."</span>";
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon('e-prefs-24');
|
||||
|
||||
e107::getNav()->admin($caption.'--id--prev_nav', 'core-prefs-main', $var);
|
||||
}
|
||||
|
@ -544,8 +544,10 @@ function search_adminmenu()
|
||||
$var['settings']['text'] = LAN_PREFS;
|
||||
$var['settings']['link'] = e_SELF."?settings";
|
||||
|
||||
$icon = e107::getParser()->toIcon('e-search-24');
|
||||
$caption = $icon."<span>".SEALAN_40."</span>";
|
||||
|
||||
$caption ="<span>".SEALAN_40."</span>";
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon('e-search-24');
|
||||
|
||||
e107::getNav()->admin($caption, $action, $var);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ if (isset($_POST['update_settings']))
|
||||
$check = $sql->update('user',$userData);
|
||||
if ($check)
|
||||
{
|
||||
e107::getLog()->add('ADMINPW_01', '', E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('ADMINPW_01', '');
|
||||
$userMethods->makeUserCookie(array('user_id' => USERID,'user_password' => $userData['data']['user_password']), FALSE); // Can't handle autologin ATM
|
||||
$mes->addSuccess(UDALAN_3." ".ADMINNAME);
|
||||
|
||||
@ -124,4 +124,3 @@ else
|
||||
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
|
||||
?>
|
@ -63,10 +63,10 @@ class users_admin extends e_admin_dispatcher
|
||||
|
||||
protected $adminMenu = array(
|
||||
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => '0|4'),
|
||||
'main/add' => array('caption'=> LAN_USER_QUICKADD, 'perm' => '4|U0|U1'),
|
||||
'main/add' => array('caption'=> LAN_USER_QUICKADD, 'perm' => '4|U0|U1', 'icon'=>'fas-user-plus'),
|
||||
'main/prefs' => array('caption'=> LAN_OPTIONS, 'perm' => '4|U2'),
|
||||
'ranks/list' => array('caption'=> LAN_USER_RANKS, 'perm' => '4|U3'),
|
||||
'main/maintenance' => array('caption'=> LAN_MAINTENANCE, 'perm' => '4')
|
||||
'ranks/list' => array('caption'=> LAN_USER_RANKS, 'perm' => '4|U3', 'icon'=>'fas-user-tie'),
|
||||
'main/maintenance' => array('caption'=> LAN_MAINTENANCE, 'perm' => '4', 'icon'=>'fas-toolbox')
|
||||
// 'ranks/list' => array('caption'=> LAN_USER_RANKS, 'perm' => '4|U3')
|
||||
);
|
||||
|
||||
|
@ -61,20 +61,19 @@ class admin_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
public function sc_admin_rightpanel_toggle($parm=null)
|
||||
{
|
||||
if(varset($_COOKIE['e107_adminLeftPanel']) === 'closed')
|
||||
{
|
||||
return 'col-md-12 col-lg-12';
|
||||
}
|
||||
|
||||
return 'col-md-9 col-lg-10';
|
||||
|
||||
}*/
|
||||
|
||||
public function sc_admin_leftpanel_toggle($parm=null)
|
||||
{
|
||||
$exclude = array('menus.php', 'phpinfo.php', 'credits.php', 'docs.php');
|
||||
|
||||
if(in_array(e_PAGE, $exclude))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(varset($_COOKIE['e107_adminLeftPanel']) === 'closed')
|
||||
{
|
||||
return 'admin-left-panel-collapsed';
|
||||
|
@ -325,6 +325,8 @@ $ADMIN_TEMPLATE['menu']['end'] = '
|
||||
</div>
|
||||
';
|
||||
|
||||
$ADMIN_TEMPLATE['menu']['heading'] = '<li class="nav-header sidebar-toggle-panel">{HEADING}</li>';
|
||||
|
||||
$ADMIN_TEMPLATE['menu']['divider'] = '<li role="separator" class="divider"><!-- --></li>';
|
||||
|
||||
$ADMIN_TEMPLATE['menu']['caption'] = '<span class="e-toggle-sidebar e-tip" data-placement="right" title="Toggle" style="cursor:pointer">{ICON}</span><span class="sidebar-toggle-panel">{CAPTION}</span><span class="close e-toggle-sidebar sidebar-toggle-panel sidebar-toggle-switch"><!-- --></span>';
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -1261,7 +1261,9 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
|
||||
if (isset($e107_vars[$act]['header']))
|
||||
{
|
||||
$text .= "<li class='nav-header'>".$e107_vars[$act]['header']."</li>"; //TODO add to Template.
|
||||
$text .= str_replace('{HEADING}', $e107_vars[$act]['header'], $tmpl['heading']);
|
||||
|
||||
// $text .= "<li class='nav-header'>".$e107_vars[$act]['header']."</li>"; //TODO add to Template.
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -572,8 +572,8 @@ function alt_auth_adminmenu()
|
||||
$var['main']['link'] = e_PLUGIN . 'alt_auth/alt_auth_conf.php';
|
||||
|
||||
|
||||
$icon = e107::getParser()->toIcon(e_PLUGIN . 'alt_auth/images/alt_auth_32.png');
|
||||
$caption = $icon . "<span>alt auth</span>";
|
||||
// $icon = e107::getParser()->toIcon(e_PLUGIN . 'alt_auth/images/alt_auth_32.png');
|
||||
$caption = "<span>alt auth</span>";
|
||||
|
||||
show_admin_menu($caption, ALT_AUTH_ACTION, $var);
|
||||
|
||||
|
@ -148,8 +148,9 @@ function admin_chatbox_adminmenu()
|
||||
$var['main']['text'] = LAN_PREFS;
|
||||
$var['main']['link'] = e_SELF;
|
||||
|
||||
$icon = e107::getParser()->toIcon(e_PLUGIN."chatbox_menu/images/chatbox_32.png");
|
||||
$caption = $icon."<span>".LAN_PLUGIN_CHATBOX_MENU_NAME."</span>";
|
||||
$caption = "<span>".LAN_PLUGIN_CHATBOX_MENU_NAME."</span>";
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon(e_PLUGIN."chatbox_menu/images/chatbox_32.png");
|
||||
|
||||
e107::getNav()->admin($caption, $mode, $var);
|
||||
}
|
||||
|
@ -73,14 +73,15 @@ e107::getRender()->tablerender(LAN_PLUGIN_LIST_NEW_NAME, $mes->render(). $text);
|
||||
*/
|
||||
function admin_list_config_adminmenu()
|
||||
{
|
||||
|
||||
unset($var);
|
||||
$var=array();
|
||||
$var = [];
|
||||
//$var['general']['text'] = LIST_ADMIN_OPT_1;
|
||||
$var['list-new-recent-page']['text'] = LIST_ADMIN_OPT_2;
|
||||
$var['list-new-recent-menu']['text'] = LIST_ADMIN_OPT_3;
|
||||
$var['list-new-new-page']['text'] = LIST_ADMIN_OPT_4;
|
||||
$var['list-new-new-menu']['text'] = LIST_ADMIN_OPT_5;
|
||||
|
||||
$var['_extras_']['icon'] = e107::getParser()->toIcon(e_PLUGIN."list_new/icon/list_32.png");
|
||||
|
||||
e107::getNav()->admin(LAN_OPTIONS.'--id--list_new', 'list-new-recent-page', $var);
|
||||
|
||||
return null;
|
||||
|
@ -240,8 +240,8 @@ function admin_config_adminmenu()
|
||||
$var['import']['link'] = e_SELF."?import";
|
||||
$var['import']['perm'] = "0";*/
|
||||
|
||||
$icon = e107::getParser()->toIcon(e_PLUGIN.'poll/images/polls_32.png');
|
||||
$caption = $icon."<span>".LAN_PLUGIN_POLL_NAME."</span>";
|
||||
//$icon = e107::getParser()->toIcon(e_PLUGIN.'poll/images/polls_32.png');
|
||||
$caption = "<span>".LAN_PLUGIN_POLL_NAME."</span>";
|
||||
|
||||
show_admin_menu($caption, $action, $var);
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user