30 if ($action ==
'update' && is_array($arrayofparameters))
34 foreach ($arrayofparameters as $key => $val)
51 if (empty($nomessageinupdate))
setEventMessages($langs->trans(
"SetupSaved"), null,
'mesgs');
54 if (empty($nomessageinupdate))
setEventMessages($langs->trans(
"SetupNotSaved"), null,
'errors');
59 if ($action ==
'setModuleOptions')
66 foreach ($_POST as $key => $val)
69 if (preg_match(
'/^param(\d*)$/', $key, $reg))
71 $param =
GETPOST(
"param".$reg[1],
'alpha');
72 $value =
GETPOST(
"value".$reg[1],
'alpha');
76 if (!($res > 0)) $error++;
83 if (
GETPOST(
'upload',
'alpha') &&
GETPOST(
'keyforuploaddir',
'aZ09'))
85 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
86 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
87 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim($conf->global->$keyforuploaddir)));
88 foreach ($listofdir as $key=>$tmpdir)
90 $tmpdir = trim($tmpdir);
91 $tmpdir = preg_replace(
'/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
93 unset($listofdir[$key]);
continue;
95 if (!is_dir($tmpdir)) {
96 if (empty($nomessageinsetmoduleoptions)) {
97 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir), null,
'warnings');
101 $upload_dir = $tmpdir;
107 if ($result <= 0) $error++;
114 if (empty($nomessageinsetmoduleoptions))
setEventMessages($langs->trans(
"SetupSaved"), null,
'mesgs');
117 if (empty($nomessageinsetmoduleoptions))
setEventMessages($langs->trans(
"SetupNotSaved"), null,
'errors');
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesession=0, $varfiles= 'addedfile', $savingdocmask= '', $link=null, $trackid= '', $generatethumbs=1, $object=null)
Get and save an upload file (for example after submitting a new file a mail form).