32if ($action ==
'update' && !empty($formSetup) && is_object($formSetup) && !empty($user->admin)) {
33 $formSetup->saveConfFromPost();
38if ($action ==
'update' && is_array($arrayofparameters) && !empty($user->admin)) {
41 foreach ($arrayofparameters as $key => $val) {
43 if (GETPOSTISSET($key)) {
44 if (preg_match(
'/category:/', $val[
'type'])) {
45 if (
GETPOST($key,
'int') ==
'-1') {
48 $val_const =
GETPOST($key,
'int');
51 $val_const =
GETPOST($key,
'alpha');
64 if (empty($nomessageinupdate)) {
69 if (empty($nomessageinupdate)) {
75if ($action ==
'deletefile' && $modulepart ==
'doctemplates' && !empty($user->admin)) {
76 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
77 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
79 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
80 foreach ($listofdir as $key => $tmpdir) {
81 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
83 unset($listofdir[$key]);
86 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
87 if (!is_dir($tmpdir)) {
88 if (empty($nomessageinsetmoduleoptions)) {
89 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
92 $upload_dir = $tmpdir;
97 $filetodelete = $tmpdir.
'/'.
GETPOST(
'file');
105if ($action ==
'setModuleOptions' && !empty($user->admin)) {
109 if (is_array($_POST)) {
110 foreach ($_POST as $key => $val) {
112 if (preg_match(
'/^param(\d*)$/', $key, $reg)) {
113 $param =
GETPOST(
"param".$reg[1],
'alpha');
114 $value =
GETPOST(
"value".$reg[1],
'alpha');
126 if (
GETPOST(
'upload',
'alpha') &&
GETPOST(
'keyforuploaddir',
'aZ09')) {
127 include_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
128 $keyforuploaddir =
GETPOST(
'keyforuploaddir',
'aZ09');
129 $listofdir = explode(
',', preg_replace(
'/[\r\n]+/',
',', trim(
getDolGlobalString($keyforuploaddir))));
131 foreach ($listofdir as $key => $tmpdir) {
132 $tmpdir = trim($tmpdir);
133 $tmpdir = preg_replace(
'/DOL_DATA_ROOT\/*/',
'', $tmpdir);
135 unset($listofdir[$key]);
138 $tmpdir = DOL_DATA_ROOT.
'/'.$tmpdir;
139 if (!is_dir($tmpdir)) {
140 if (empty($nomessageinsetmoduleoptions)) {
141 setEventMessages($langs->trans(
"ErrorDirNotFound", $tmpdir),
null,
'warnings');
144 $upload_dir = $tmpdir;
160 if (empty($nomessageinsetmoduleoptions)) {
165 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, $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).
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.