45@phan-var-force FormSetup $formSetup
48if ($action ==
'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) {
49 $formSetup->saveConfFromPost();
55if ($action ==
'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) {
58 foreach ($arrayofparameters as $key => $val) {
60 if (GETPOSTISSET($key)) {
61 if (!empty($val[
'type']) && preg_match(
'/category:/', $val[
'type'])) {
67 } elseif ($val[
'type'] ==
'html') {
68 $val_const =
GETPOST($key,
'restricthtml');
70 $val_const =
GETPOST($key,
'alpha');
83 if (empty($nomessageinupdate)) {
88 if (empty($nomessageinupdate)) {
94if ($action ==
'deletefile' && $modulepart ==
'doctemplates' && !empty($user->admin)) {
95 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
96 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
97 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
99 foreach ($listofdir as $key => $tmpdir) {
100 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
102 unset($listofdir[$key]);
105 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
106 if (!is_dir($tmpdir)) {
107 if (empty($nomessageinsetmoduleoptions)) {
108 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
111 $upload_dir = $tmpdir;
116 $filetodelete = $tmpdir.
'/'.
GETPOST(
'file');
124if ($action ==
'setModuleOptions' && !empty($user->admin)) {
128 if (is_array($_POST)) {
129 foreach ($_POST as $key => $val) {
131 if (preg_match(
'/^param(\d*)$/', $key, $reg)) {
132 $param =
GETPOST(
"param".$reg[1],
'aZ09');
133 $value =
GETPOST(
"value".$reg[1],
'alpha');
141 if (preg_match(
'/_ADDON_PDF_ODT_PATH$/', $param) && preg_match(
'/^DOL_DATA_ROOT/', $value)) {
142 $tmpdir = preg_replace(
'/^DOL_DATA_ROOT/', DOL_DATA_ROOT, $value);
151 if (
GETPOST(
'upload',
'alpha') &&
GETPOST(
'keyforuploaddir',
'aZ09')) {
152 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
153 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
154 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
156 foreach ($listofdir as $key => $tmpdir) {
157 $tmpdir = trim($tmpdir);
158 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
160 unset($listofdir[$key]);
163 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
164 if (!is_dir($tmpdir)) {
165 if (empty($nomessageinsetmoduleoptions)) {
166 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
169 $upload_dir = $tmpdir;
184 if (empty($nomessageinsetmoduleoptions)) {
189 if (empty($nomessageinsetmoduleoptions)) {
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).
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_add_file_process($upload_dir, $allowoverwrite=0, $updatesessionordb=0, $varfiles='addedfile', $savingdocmask='', $link=null, $trackid='', $generatethumbs=1, $object=null, $forceFullTestIndexation='')
Get and save an upload file (for example after submitting a new file a mail form).
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...