Project

General

Profile

Feature #25936 ยป individualUploadFolder2.patch

Feature Patch applying to master - Steffen Ritter, 2011-04-13 10:36

View differences:

t3lib/class.t3lib_tceforms.php
$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);
......
$rowCopy = array();
$rowCopy[$field] = $imgPath;
$imgs[] = '<span class="nobr">' . t3lib_BEfunc::thumbCode($rowCopy, $table, $field, $this->backPath, 'thumbs.php', $config['uploadfolder'], 0, ' align="middle"') .
$imgs[] = '<span class="nobr">' . t3lib_BEfunc::thumbCode($rowCopy, $table, $field, $this->backPath, 'thumbs.php', $uploadFolder, 0, ' align="middle"') .
$imgPath .
'</span>';
}
......
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 .= '<div id="' . $PA['itemFormElID_file'] . '"><input type="file" name="' . $PA['itemFormElName_file'] . '" size="35" onchange="' . implode('', $PA['fieldChangeFunc']) . '" /></div>';
}
}
t3lib/class.t3lib_tcemain.php
// 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') {
    (1-1/1)