33if ($action ==
'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) {
34 $formSetup->saveConfFromPost();
39@phan-var-force FormSetup $formSetup
44if ($action ==
'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) {
47 foreach ($arrayofparameters as $key => $val) {
49 if (GETPOSTISSET($key)) {
50 if (!empty($val[
'type']) && preg_match(
'/category:/', $val[
'type'])) {
56 } elseif ($val[
'type'] ==
'html') {
57 $val_const =
GETPOST($key,
'restricthtml');
59 $val_const =
GETPOST($key,
'alpha');
72 if (empty($nomessageinupdate)) {
77 if (empty($nomessageinupdate)) {
83if ($action ==
'deletefile' && $modulepart ==
'doctemplates' && !empty($user->admin)) {
84 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
85 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
86 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
88 foreach ($listofdir as $key => $tmpdir) {
89 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
91 unset($listofdir[$key]);
94 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
95 if (!is_dir($tmpdir)) {
96 if (empty($nomessageinsetmoduleoptions)) {
97 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
100 $upload_dir = $tmpdir;
105 $filetodelete = $tmpdir.
'/'.
GETPOST(
'file');
113if ($action ==
'setModuleOptions' && !empty($user->admin)) {
117 if (is_array($_POST)) {
118 foreach ($_POST as $key => $val) {
120 if (preg_match(
'/^param(\d*)$/', $key, $reg)) {
121 $param =
GETPOST(
"param".$reg[1],
'alpha');
122 $value =
GETPOST(
"value".$reg[1],
'alpha');
134 if (
GETPOST(
'upload',
'alpha') &&
GETPOST(
'keyforuploaddir',
'aZ09')) {
135 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
136 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
137 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
139 foreach ($listofdir as $key => $tmpdir) {
140 $tmpdir = trim($tmpdir);
141 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
143 unset($listofdir[$key]);
146 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
147 if (!is_dir($tmpdir)) {
148 if (empty($nomessageinsetmoduleoptions)) {
149 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
152 $upload_dir = $tmpdir;
167 if (empty($nomessageinsetmoduleoptions)) {
172 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)
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.