--- dam/modfunc_file_upload/class.tx_dam_file_upload.php 2010-06-16 11:19:40.000000000 +0200 +++ dam.new/modfunc_file_upload/class.tx_dam_file_upload.php 2010-06-11 15:46:30.000000000 +0200 @@ -97,11 +97,11 @@ */ class tx_dam_file_upload extends t3lib_extobjbase { + public $enableBatchProcessing = true; + + protected $hookObjectsArray = array(); - - var $enableBatchProcessing = true; - - + /** * Configures the module for use in element Browser * @@ -288,10 +288,13 @@ $content = ''; $header = ''; - - - - + $this->hookObjectsArray = array(); + if (is_array ($TYPO3_CONF_VARS['EXTCONF']['dam']['fileUpload'])) { + foreach ($TYPO3_CONF_VARS['EXTCONF']['dam']['fileUpload'] as $classRef) { + $this->hookObjectsArray[] = &t3lib_div::getUserObj($classRef); + } + } + $uidList = $GLOBALS['TYPO3_DB']->cleanIntList(t3lib_div::_POST('batch_items')); if ((t3lib_div::_GP('batch') OR t3lib_div::_GP('process')) AND ($uidList)) { @@ -461,6 +464,7 @@ function uploadForm($path, $uploadFields=5) { global $BACK_PATH, $LANG, $FILEMOUNTS; + $code = array(); // number of max upload fields $maxUploads = 15; @@ -481,9 +485,17 @@ $content .= $select; - + if (is_array($this->hookObjectsArray)) { + foreach($this->hookObjectsArray as $hookObj) { + if (method_exists ($hookObj, 'uploadForm_addCode')) { + $code[] = $hookObj->uploadForm_addCode($this, $code); + } + } + } + + // Make checkbox for "overwrite" - $code .=' + $code[] =' pObj->MOD_SETTINGS['tx_dam_file_upload_overwrite']?' checked="checked"':'').' /> @@ -491,13 +503,14 @@ '; + // Produce the number of upload-fields needed: - $code .= ' + $code[] = '
'; for ($a=0; $a<$uploadFields; $a++) { // Adding 'size="50" ' for the sake of Mozilla! - $code .=' + $code[] =' pObj->doc->formWidth(35).' size="45" />
@@ -509,26 +522,26 @@ if ($upload_max_filesize = tx_dam_extFileFunctions::getMaxUploadSize()) { - $code .= ' + $code[] = '

'.sprintf($LANG->getLL('tx_dam_file_upload.maxSizeHint',1), t3lib_div::formatSize($upload_max_filesize)).'

'; } - $code .= ' + $code[] = '
'; // Submit button: - $code .= ' + $code[] = '
'; - $content .= $code; + $content .= implode('', $code); @@ -543,7 +556,7 @@ */ function uploadProcessing() { global $BACK_PATH, $LANG, $FILEMOUNTS, $TYPO3_CONF_VARS; - + $content = ''; // Processing uploads @@ -558,6 +571,13 @@ $indexData = $this->indexUploadedFiles($files); + if (is_array($this->hookObjectsArray)) { + foreach($this->hookObjectsArray as $hookObj) { + if (method_exists ($hookObj, 'uploadProcessing_afterIndexUploadedFiles')) { + $indexData = $hookObj->uploadProcessing_afterIndexUploadedFiles($this, $indexData); + } + } + } if ($indexData['files']) { $uidList = $this->getUIDsFromItemArray($indexData['files']);