32if ($action ==
'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) {
33 $formSetup->saveConfFromPost();
38if ($action ==
'update' && !empty($arrayofparameters) && is_array($arrayofparameters) && !empty($user->admin)) {
41 foreach ($arrayofparameters as $key => $val) {
43 if (GETPOSTISSET($key)) {
44 if (!empty($val[
'type']) && preg_match(
'/category:/', $val[
'type'])) {
50 } elseif ($val[
'type'] ==
'html') {
51 $val_const =
GETPOST($key,
'restricthtml');
53 $val_const =
GETPOST($key,
'alpha');
66 if (empty($nomessageinupdate)) {
71 if (empty($nomessageinupdate)) {
77if ($action ==
'deletefile' && $modulepart ==
'doctemplates' && !empty($user->admin)) {
78 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
79 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
80 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
82 foreach ($listofdir as $key => $tmpdir) {
83 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
85 unset($listofdir[$key]);
88 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
89 if (!is_dir($tmpdir)) {
90 if (empty($nomessageinsetmoduleoptions)) {
91 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
94 $upload_dir = $tmpdir;
99 $filetodelete = $tmpdir.
'/'.
GETPOST(
'file');
107if ($action ==
'setModuleOptions' && !empty($user->admin)) {
111 if (is_array($_POST)) {
112 foreach ($_POST as $key => $val) {
114 if (preg_match(
'/^param(\d*)$/', $key, $reg)) {
115 $param =
GETPOST(
"param".$reg[1],
'alpha');
116 $value =
GETPOST(
"value".$reg[1],
'alpha');
128 if (
GETPOST(
'upload',
'alpha') &&
GETPOST(
'keyforuploaddir',
'aZ09')) {
129 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
130 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
131 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
133 foreach ($listofdir as $key => $tmpdir) {
134 $tmpdir = trim($tmpdir);
135 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
137 unset($listofdir[$key]);
140 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
141 if (!is_dir($tmpdir)) {
142 if (empty($nomessageinsetmoduleoptions)) {
143 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
146 $upload_dir = $tmpdir;
161 if (empty($nomessageinsetmoduleoptions)) {
166 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).
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.