diff --git a/t3lib/class.t3lib_tceforms.php b/t3lib/class.t3lib_tceforms.php index 16c5048..0380de2 100644 --- a/t3lib/class.t3lib_tceforms.php +++ b/t3lib/class.t3lib_tceforms.php @@ -2214,6 +2214,8 @@ class t3lib_TCEforms { $config['uploadfolder'] = ''; // Fall through case 'file': // If the element is of the internal type "file": + $uploadFolder = $config['uploadfolder']; + $uploadFolder = t3lib_parsehtml::substituteMarkerArray($uploadFolder, $row, '###REC_|###', TRUE); // Creating string showing allowed types: $tempFT = t3lib_div::trimExplode(',', $allowed, TRUE); @@ -2250,7 +2252,7 @@ class t3lib_TCEforms { $rowCopy = array(); $rowCopy[$field] = $imgPath; - $imgs[] = '' . t3lib_BEfunc::thumbCode($rowCopy, $table, $field, $this->backPath, 'thumbs.php', $config['uploadfolder'], 0, ' align="middle"') . + $imgs[] = '' . t3lib_BEfunc::thumbCode($rowCopy, $table, $field, $this->backPath, 'thumbs.php', $uploadFolder, 0, ' align="middle"') . $imgPath . ''; } @@ -2274,7 +2276,7 @@ class t3lib_TCEforms { if (!$disabled && !(isset($config['disable_controls']) && t3lib_div::inList($config['disable_controls'], 'upload'))) { // Adding the upload field: - if ($this->edit_docModuleUpload && $config['uploadfolder']) { + if ($this->edit_docModuleUpload && $uploadFolder) { $item .= '
'; } } diff --git a/t3lib/class.t3lib_tcemain.php b/t3lib/class.t3lib_tcemain.php index 3dee717..00fd3f9 100644 --- a/t3lib/class.t3lib_tcemain.php +++ b/t3lib/class.t3lib_tcemain.php @@ -1581,12 +1581,23 @@ class t3lib_TCEmain { // If there is an upload folder defined: if ($tcaFieldConf['uploadfolder'] && $tcaFieldConf['internal_type'] == 'file') { + if (strpos($tcaFieldConf['uploadfolder'], '###') !== FALSE) { + $record = t3lib_BEfunc::getRecord($table, $id, '*', '', FALSE); + $tcaFieldConf['uploadfolder'] = t3lib_parsehtml::substituteMarkerArray($tcaFieldConf['uploadfolder'], $record, '###REC_|###', TRUE); + $individualFolder = TRUE; + } else { + $individualFolder = FALSE; + } + if (!$this->bypassFileHandling) { // If filehandling should NOT be bypassed, do processing: // For logging.. $propArr = $this->getRecordProperties($table, $id); // Get destrination path: $dest = $this->destPathFromUploadFolder($tcaFieldConf['uploadfolder']); + if ($individualFolder && !@is_dir($dest)) { + t3lib_div::mkdir($dest); + } // If we are updating: if ($status == 'update') {