dolibarr 23.0.3
website_options.php
1<?php
2/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
25// Load Dolibarr environment
26require '../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
28require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
34require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
35
44// Load translation files required by the page
45$langs->loadLangs(array('errors', 'admin', 'companies', 'website'));
46
47$action = GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view';
48$confirm = GETPOST('confirm', 'alpha');
49$backtopage = GETPOST('backtopage', 'alpha');
50
51// Load variable for pagination
52$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
53$sortfield = GETPOST('sortfield', 'aZ09comma');
54$sortorder = GETPOST('sortorder', 'aZ09comma');
55$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
56if (empty($page) || $page == -1) {
57 $page = 0;
58} // If $page is not defined, or '' or -1
59$offset = $limit * $page;
60$pageprev = $page - 1;
61$pagenext = $page + 1;
62
63// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
64$hookmanager->initHooks(array('admin'));
65
66$arrayofparameters = array();
67
68$status = 1;
69$rowid = GETPOST('rowid', 'alpha');
70
71if (!$user->admin || !isModEnabled('website')) {
73}
74
75// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
76/*
77$useFormSetup = 1;
78
79if (!class_exists('FormSetup')) {
80 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
81}
82$formSetup = new FormSetup($db);
83
84$item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
85*/
86
87
88/*
89 * Actions
90 */
91
92include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
93
94
95/*
96 * View
97 */
98
99$form = new Form($db);
100$formadmin = new FormAdmin($db);
101
102llxHeader('', $langs->trans("WebsiteSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-website_options');
103
104$titre = $langs->trans("WebsiteSetup");
105
106$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
107
108print load_fiche_titre($titre, $linkback, 'title_setup');
109
110// Onglets
111$head = array();
112$h = 0;
113
114$head[$h][0] = DOL_URL_ROOT."/admin/website.php";
115$head[$h][1] = $langs->trans("WebSites");
116$head[$h][2] = 'website';
117$h++;
118
119/* disable, no option for the moment
120$head[$h][0] = DOL_URL_ROOT."/admin/website_options.php";
121$head[$h][1] = $langs->trans("Options");
122$head[$h][2] = 'options';
123$h++;
124*/
125
126print dol_get_fiche_head($head, 'options', '', -1);
127
128
129
130print '<div class="div-table-responsive-no-min">';
131print '<table class="noborder centpercent">';
132print '<tr class="liste_titre">';
133print '<td>'.$langs->trans("Parameter").'</td>';
134print '<td align="center" width="20">&nbsp;</td>';
135print '<td align="center" width="100"></td>'."\n";
136print '</tr>';
137
138// ...
139
140print '</table>';
141
142if (empty($conf->use_javascript_ajax)) {
143 print '<div class="tabsAction">';
144 print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
145 print '</div>';
146}
147
148print dol_get_fiche_end();
149
150// End of page
151llxFooter();
152$db->close();
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
Class to generate html code for admin pages.
Class to manage generation of HTML components Only common components must be here.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.