[TYPO3-project-formidable] UPLOAD or FILE renderlet
Manuel Rego Casasnovas
mrego at igalia.com
Tue Oct 30 10:01:56 CET 2007
Jerome Schneider escribió:
> Hi Manuel,
> I think that it would be better with an optional parameter $bUpdateInDb
> default to FALSE, for the cases where no DB is involved.
>
> What do u think ?
>
I agree with you.
The result will be:
function deleteFile($sFile, $bUpdateInDb) {
$aValues = t3lib_div::trimExplode(",", $this->_getValue());
unset($aValues[array_search($sFile, $aValues)]);
@unlink($this->getFullServerPath($sFile));
$this->setValue(implode(",", $aValues));
if ($bUpdateInDb) {
$tablename =
$this->oForm->_navConf("/control/datahandler/tablename");
$keyname =
$this->oForm->_navConf("/control/datahandler/keyname");
$entryid =
$this->oForm->oDataHandler->_currentEntryId();
$fieldname = $this->_getName();
$value = $this->_getValue();
@$GLOBALS['TYPO3_DB']->exec_UPDATEquery($tablename, $keyname . '="' .
$entryid . '"', array($fieldname => $value));
}
}
I send you attached a patch if you like to apply this change.
Best regards,
Rego
--
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com
More information about the TYPO3-project-formidable
mailing list