dolibarr  7.0.0-beta
other.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.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 $langs->load("users");
28 $langs->load("admin");
29 $langs->load("other");
30 
31 if (! $user->admin) accessforbidden();
32 
33 $action=GETPOST('action','alpha');
34 
35 
36 /*
37  * Actions
38  */
39 
40 if ($action == 'activate_hidemenu')
41 {
42  dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity);
43  header("Location: ".$_SERVER["PHP_SELF"]);
44  exit;
45 }
46 else if ($action == 'disable_hidemenu')
47 {
48  dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity);
49  header("Location: ".$_SERVER["PHP_SELF"]);
50  exit;
51 }
52 
53 
54 /*
55  * View
56  */
57 
58 llxHeader('',$langs->trans("Setup"));
59 
60 print load_fiche_titre($langs->trans("Menus"),'','title_setup');
61 
62 
63 $h = 0;
64 
65 $head[$h][0] = DOL_URL_ROOT."/admin/menus.php";
66 $head[$h][1] = $langs->trans("MenuHandlers");
67 $head[$h][2] = 'handler';
68 $h++;
69 
70 $head[$h][0] = DOL_URL_ROOT."/admin/menus/index.php";
71 $head[$h][1] = $langs->trans("MenuAdmin");
72 $head[$h][2] = 'editor';
73 $h++;
74 
75 $head[$h][0] = DOL_URL_ROOT."/admin/menus/other.php";
76 $head[$h][1] = $langs->trans("Miscellaneous");
77 $head[$h][2] = 'misc';
78 $h++;
79 
80 dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1);
81 
82 
83 // Other Options
84 
85 print '<table class="noborder" width="100%">';
86 print '<tr class="liste_titre">';
87 print '<td colspan="3">'.$langs->trans("Parameters").'</td>';
88 print '<td align="center" width="80">'.$langs->trans("Status").'</td>';
89 print '</tr>';
90 
91 // Hide unauthorized menu
92 print '<tr class="oddeven">';
93 print '<td colspan="3">'.$langs->trans("HideUnauthorizedMenu").'</td>';
94 print '<td align="center">';
95 if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED))
96 {
97  print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_hidemenu">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
98 }
99 else
100 {
101  print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_hidemenu">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
102 }
103 print "</td>";
104 print '</tr>';
105 
106 print '</table>';
107 
108 
109 llxFooter();
110 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
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:485
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
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'une constante dans la base de donnees.
Definition: admin.lib.php:410
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
print
Draft customers invoices.
Definition: index.php:91