dolibarr  7.0.0-beta
bookmark.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.org>
4  * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
27 
28 $langs->load("admin");
29 
30 if (!$user->admin)
32 
33 $action=GETPOST('action','alpha');
34 
35 if ($action == 'setvalue')
36 {
37  $showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU','alpha');
38  $res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$showmenu,'chaine',0,'',$conf->entity);
39 
40  if (! $res > 0) $error++;
41 
42  if (! $error)
43  {
44  $db->commit();
45  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
46  }
47  else
48  {
49  $db->rollback();
50  setEventMessages($langs->trans("Error"), null, 'errors');
51  }
52 }
53 
54 
55 /*
56  * View
57  */
58 
59 llxHeader();
60 
61 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
62 print load_fiche_titre($langs->trans("BookmarkSetup"),$linkback,'title_setup');
63 
64 print $langs->trans("BookmarkDesc")."<br>\n";
65 
66 print '<br>';
67 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
68 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
69 print '<input type="hidden" name="action" value="setvalue">';
70 
71 $var=true;
72 
73 print '<table summary="bookmarklist" class="noborder" width="100%">';
74 print '<tr class="liste_titre">';
75 print '<td>'.$langs->trans("Name").'</td>';
76 print '<td>'.$langs->trans("Value").'</td>';
77 print "</tr>\n";
78 
79 print '<tr class="oddeven"><td>';
80 print $langs->trans("NbOfBoomarkToShow").'</td><td>';
81 print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="'.$conf->global->BOOKMARKS_SHOW_IN_MENU.'">';
82 print '</td></tr>';
83 print '</table><br><div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div></form>';
84 
85 llxFooter();
86 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
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 ...
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