This commit is contained in:
Abdulrahman
2019-02-19 19:07:01 +03:00
parent e0c51b82bf
commit ed56fdb5b5
4 changed files with 36 additions and 8 deletions

View File

@@ -128,12 +128,10 @@ if(
is_array($plugin_run_result = Plugins::getInstance()->run('before_display_template_admin_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
//prevent indexing this page by bots
header('HTTP/1.0 401 Unauthorized');
if (ig('_ajax_') || ig('check_msgs'))
{
echo_ajax(401, 'Unauthorized');
echo_ajax(401, $lang['HV_NOT_PRVLG_ACCESS']);
}
else
{

View File

@@ -36,13 +36,14 @@ function toggleMenuItem(name, menu, hide, current) {
<!-- Breadcrumbs -->
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="./">{lang.R_CPINDEX}</a></li>
<li class="breadcrumb-item"><a href="./?cp=options">{lang.R_CONFIGS}</a></li>
<li class="breadcrumb-item active">{olang.R_MENUS_TOGGLE}</li>
</ol>
<div class="alert alert-light">{olang.MENU_TOGGLE_EXP}</div>
<div class="p-3">
<h4 class="mt-4">{olang.MENU_TOGGLE_TOP_MENU}</h4>
<ul class="list-group">

View File

@@ -125,13 +125,38 @@ $kleeja_plugin['menu_toggle']['uninstall'] = function ($plg_id) {
# Plugin functions
$kleeja_plugin['menu_toggle']['functions'] = array(
//add to admin menu
'require_admin_page_end_a_configs' => function($args) {
global $olang;
$go_menu = $args['go_menu'];
$last_item = $go_menu['all'];
unset($go_menu['all']);
$go_menu['menus_toggle'] = array(
'name' => $olang['R_MENUS_TOGGLE'],
'link' => './?cp=menus_toggle',
'goto' => 'menus_toggle',
'current' => g('cp') == 'menus_toggle'
);
$go_menu['all'] = $last_item;
return compact('go_menu');
},
'begin_admin_page' => function ($args) {
$adm_extensions = $args['adm_extensions'];
$ext_icons = $args['ext_icons'];
$ext_expt = $args['ext_expt'];
$adm_extensions[] = 'menus_toggle';
$ext_icons['menus_toggle'] = 'list';
return compact('adm_extensions', 'ext_icons');
$ext_expt[] = 'menus_toggle';
return compact('adm_extensions', 'ext_expt');
},
'endforeach_ext_admin_page' => function($args) {
if(g('cp') == 'menus_toggle')
{
$adm_extensions_menu = $args['adm_extensions_menu'];
$adm_extensions_menu[1]['current'] = true;
return compact('adm_extensions_menu');
}
},
//add as admin page to reach when click on admin menu item we added.

View File

@@ -38,6 +38,10 @@ $top_menu_items = array(
);
$go_menu = array(
array('name' => $olang['R_MENUS_TOGGLE'], 'link' => './?cp=menus_toggle', 'goto' => 'menus_toggle', 'current' => g('cp') == 'menus_toggle')
);
if(ig('toggle'))
{
if (! kleeja_check_form_key_get('adm_menus_toggle', 3600))