dolibarr/htdocs/admin/menus/other.php

111 lines
2.8 KiB
PHP
Raw Normal View History

2010-10-28 12:22:06 +02:00
<?php
2012-12-30 15:13:49 +01:00
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.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
* 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
2011-08-01 00:21:57 +02:00
* along with this program. If not, see <http://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
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
2010-10-28 12:22:06 +02:00
$langs->load("users");
$langs->load("admin");
$langs->load("other");
2012-07-09 18:09:44 +02:00
if (! $user->admin) accessforbidden();
$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
{
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;
}
2012-07-09 18:09:44 +02:00
else if ($action == 'disable_hidemenu')
2010-10-28 12:22:06 +02: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
*/
llxHeader('',$langs->trans("Setup"));
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++;
dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
2010-10-28 12:22:06 +02:00
// Other Options
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
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>';
print '<td align="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
{
2011-09-02 18:33:11 +02: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
{
2011-09-02 18:33:11 +02: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>";
print '</tr>';
2010-10-28 12:22:06 +02:00
print '</table>';
llxFooter();
2012-07-09 18:09:44 +02:00
$db->close();