dolibarr  9.0.0
other.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
24 require '../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
26 
27 // Load translation files required by the page
28 $langs->loadLangs(array("user","other","admin"));
29 
30 if (! $user->admin) accessforbidden();
31 
32 $action=GETPOST('action','alpha');
33 
34 
35 /*
36  * Actions
37  */
38 
39 if ($action == 'activate_hidemenu')
40 {
41  dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity);
42  header("Location: ".$_SERVER["PHP_SELF"]);
43  exit;
44 }
45 else if ($action == 'disable_hidemenu')
46 {
47  dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
48  header("Location: ".$_SERVER["PHP_SELF"]);
49  exit;
50 }
51 
52 
53 /*
54  * View
55  */
56 
57 llxHeader('',$langs->trans("Setup"));
58 
59 print load_fiche_titre($langs->trans("Menus"),'','title_setup');
60 
61 
62 $h = 0;
63 
64 $head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
65 $head[$h][1] = $langs->trans("MenuHandlers");
66 $head[$h][2] = 'handler';
67 $h++;
68 
69 $head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
70 $head[$h][1] = $langs->trans("MenuAdmin");
71 $head[$h][2] = 'editor';
72 $h++;
73 
74 $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
75 $head[$h][1] = $langs->trans("Miscellaneous");
76 $head[$h][2] = 'misc';
77 $h++;
78 
79 dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
80 
81 
82 // Other Options
83 
84 print '<table class="noborder" width="100%">';
85 print '<tr class="liste_titre">';
86 print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
87 print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
88 print '</tr>';
89 
90 // Hide unauthorized menu
91 print '<tr class="oddeven">';
92 print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
93 print '<td align="center">';
94 if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
95 {
96  print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
97 }
98 else
99 {
100  print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
101 }
102 print "</td>";
103 print '</tr>';
104 
105 print '</table>';
106 
107 // End of page
108 llxFooter();
109 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:510
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:435
llxHeader()
Empty header.
Definition: wrapper.php:44
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it&#39;s its name (generic function)
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='')
Show tab header of a card.