diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 0a749741152..0d35e4c1daf 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -1,9 +1,9 @@ * - * This program is free software; you can redistribute it and/or modify + * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -39,14 +39,6 @@ $action = GETPOST('action', 'alpha') ?GETPOST('action', 'alpha') : 'view'; $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$rowid = GETPOST('rowid', 'alpha'); - -if (!$user->admin) { - accessforbidden(); -} - -$status = 1; - // Load variable for pagination $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -64,6 +56,30 @@ $hookmanager->initHooks(array('admin')); $arrayofparameters = array('WEBSITE_USE_WEBSITE_ACCOUNTS'=>array('css'=>'minwidth200')); +$status = 1; +$rowid = GETPOST('rowid', 'alpha'); + +if (!$user->admin || !isModEnabled('website')) { + accessforbidden(); +} + +// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only +/* +$useFormSetup = 1; + +if (!class_exists('FormSetup')) { + // For retrocompatibility Dolibarr < 16.0 + if (floatval(DOL_VERSION) < 16.0 && !class_exists('FormSetup')) { + require_once __DIR__.'/../backport/v16/core/class/html.formsetup.class.php'; + } else { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; + } +} +$formSetup = new FormSetup($db); + +$item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); +*/ + /* * Actions @@ -102,46 +118,45 @@ $h++; print dol_get_fiche_head($head, 'options', '', -1); -if ($action == 'edit') { - print '