dolibarr/htdocs/admin/menus/other.php

146 lines
3.7 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;
}
2012-07-09 18:09:44 +02:00
if ($action == 'activate_layoutmenu')
{
dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity);
2012-08-31 05:58:38 +02:00
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
2012-07-09 18:09:44 +02:00
else if ($action == 'disable_layoutmenu')
{
dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity);
2012-08-31 05:58:38 +02:00
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
2010-10-28 12:22:06 +02:00
/*
* View
*/
llxHeader('',$langs->trans("Setup"));
print_fiche_titre($langs->trans("Menus"),'','setup');
$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"));
// Other Options
$var=true;
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
2010-10-28 12:22:06 +02:00
$var=!$var;
print "<tr ".$bc[$var].">";
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
2011-08-31 23:24:14 +02:00
// Use a flip-hide menu
2012-07-09 18:09:44 +02:00
if (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0)
{
2010-11-09 14:43:27 +01:00
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td colspan="3">'.$langs->trans("MenuUseLayout").'</td>';
print '<td align="center">';
2012-07-09 18:09:44 +02:00
if (empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))
2010-11-09 14:43:27 +01:00
{
2011-09-02 18:33:11 +02:00
print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_layoutmenu">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
2010-11-09 14:43:27 +01:00
}
2012-07-09 18:09:44 +02:00
else
2010-11-09 14:43:27 +01:00
{
2011-09-02 18:33:11 +02:00
print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_layoutmenu">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
2010-11-09 14:43:27 +01: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();
?>