dolibarr 21.0.0-alpha
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 <https://www.gnu.org/licenses/>.
18 */
19
25// Load Dolibarr environment
26require '../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
28
29// Load translation files required by the page
30$langs->load("admin");
31
32if (!$user->admin) {
34}
35
36$action = GETPOST('action', 'aZ09');
37
38if ($action == 'setvalue') {
39 $showmenu = GETPOST('BOOKMARKS_SHOW_IN_MENU', 'alpha');
40 $res = dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU", $showmenu, 'chaine', 0, '', $conf->entity);
41
42 if (!($res > 0)) {
43 $error++;
44 }
45
46 if (!$error) {
47 $db->commit();
48 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
49 } else {
50 $db->rollback();
51 setEventMessages($langs->trans("Error"), null, 'errors');
52 }
53}
54
55
56/*
57 * View
58 */
59
60llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-bookmarks page-admin_bookmark');
61
62$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
63print load_fiche_titre($langs->trans("BookmarkSetup"), $linkback, 'title_setup');
64
65print $langs->trans("BookmarkDesc")."<br>\n";
66
67print '<br>';
68print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
69print '<input type="hidden" name="token" value="'.newToken().'">';
70print '<input type="hidden" name="action" value="setvalue">';
71
72print '<table summary="bookmarklist" class="noborder centpercent">';
73print '<tr class="liste_titre">';
74print '<td>'.$langs->trans("Name").'</td>';
75print '<td>'.$langs->trans("Value").'</td>';
76print "</tr>\n";
77
78print '<tr class="oddeven"><td>';
79print $langs->trans("NbOfBoomarkToShow").'</td><td>';
80print '<input size="3" type="text" name="BOOKMARKS_SHOW_IN_MENU" value="' . getDolGlobalString('BOOKMARKS_SHOW_IN_MENU').'">';
81print '</td></tr>';
82print '</table><br><div class="center"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></div></form>';
83
84// End of page
85llxFooter();
86$db->close();
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).
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.