2010-10-28 12:22:06 +02:00
|
|
|
<?php
|
2018-10-27 14:43:12 +02:00
|
|
|
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
2010-10-28 12:22:06 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2010-10-28 12:22:06 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2010-10-28 12:22:06 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-11-09 14:43:27 +01:00
|
|
|
* \file htdocs/admin/menus/other.php
|
2010-10-28 12:22:06 +02:00
|
|
|
* \ingroup core
|
|
|
|
|
* \brief Menus options setup
|
|
|
|
|
*/
|
|
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
2010-10-28 12:22:06 +02:00
|
|
|
|
2018-09-07 14:58:22 +02:00
|
|
|
// Load translation files required by the page
|
|
|
|
|
$langs->loadLangs(array("user","other","admin"));
|
2010-10-28 12:22:06 +02:00
|
|
|
|
2012-07-09 18:09:44 +02:00
|
|
|
if (! $user->admin) accessforbidden();
|
|
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
$action=GETPOST('action', 'alpha');
|
2010-10-28 12:22:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
|
|
|
|
|
2012-07-09 18:09:44 +02:00
|
|
|
if ($action == 'activate_hidemenu')
|
2010-10-28 12:22:06 +02:00
|
|
|
{
|
2019-01-27 11:55:16 +01:00
|
|
|
dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity);
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
2010-10-28 12:22:06 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
2019-01-27 10:49:34 +01:00
|
|
|
elseif ($action == 'disable_hidemenu')
|
2010-10-28 12:22:06 +02:00
|
|
|
{
|
2019-01-27 11:55:16 +01:00
|
|
|
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
2010-10-28 12:22:06 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
|
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
llxHeader('', $langs->trans("Setup"));
|
2010-10-28 12:22:06 +02:00
|
|
|
|
2019-01-27 11:55:16 +01:00
|
|
|
print load_fiche_titre($langs->trans("Menus"), '', 'title_setup');
|
2010-10-28 12:22:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
$h = 0;
|
|
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
|
|
|
|
|
$head[$h][1] = $langs->trans("MenuHandlers");
|
|
|
|
|
$head[$h][2] = 'handler';
|
|
|
|
|
$h++;
|
|
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
|
|
|
|
|
$head[$h][1] = $langs->trans("MenuAdmin");
|
|
|
|
|
$head[$h][2] = 'editor';
|
|
|
|
|
$h++;
|
|
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
|
2013-03-24 07:11:44 +01:00
|
|
|
$head[$h][1] = $langs->trans("Miscellaneous");
|
2010-10-28 12:22:06 +02:00
|
|
|
$head[$h][2] = 'misc';
|
|
|
|
|
$h++;
|
|
|
|
|
|
2017-03-29 21:36:50 +02:00
|
|
|
dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
|
2010-10-28 12:22:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Other Options
|
|
|
|
|
|
2019-11-05 21:24:41 +01:00
|
|
|
print '<table class="noborder centpercent">';
|
2010-10-28 12:22:06 +02:00
|
|
|
print '<tr class="liste_titre">';
|
|
|
|
|
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
|
2019-03-19 14:17:20 +01:00
|
|
|
print '<td class="center" width="80">'.$langs->trans("Status").'</td>';
|
2010-10-28 12:22:06 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
|
2011-08-31 23:24:14 +02:00
|
|
|
// Hide unauthorized menu
|
2017-04-12 17:44:01 +02:00
|
|
|
print '<tr class="oddeven">';
|
2010-10-28 12:22:06 +02:00
|
|
|
print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
|
2019-03-19 14:17:20 +01:00
|
|
|
print '<td class="center">';
|
2012-07-09 18:09:44 +02:00
|
|
|
if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
|
2010-10-28 12:22:06 +02:00
|
|
|
{
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
2010-10-28 12:22:06 +02:00
|
|
|
}
|
2012-07-09 18:09:44 +02:00
|
|
|
else
|
2010-10-28 12:22:06 +02:00
|
|
|
{
|
2019-01-27 11:55:16 +01:00
|
|
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
2010-10-28 12:22:06 +02:00
|
|
|
}
|
|
|
|
|
print "</td>";
|
2010-10-30 09:54:26 +02:00
|
|
|
print '</tr>';
|
2010-10-28 12:22:06 +02:00
|
|
|
|
|
|
|
|
print '</table>';
|
|
|
|
|
|
2018-07-28 14:29:28 +02:00
|
|
|
// End of page
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-07-09 18:09:44 +02:00
|
|
|
$db->close();
|