[TYPO3-project-formidable] Added the userobj option to property targetdir in FILE renderlet
Manuel Rego Casasnovas
mrego at igalia.com
Fri Jun 8 11:36:08 CEST 2007
Hello everyone!
I need use an userobj for the property targetdir in a FILE renderlet, my
XML configuration is the next:
<renderlet:FILE name="my_file">
<data>
<targetdir>
<userobj>
<extension>this</extension>
<method>_getFilePath</method>
</userobj>
</targetdir>
</data>
</renderlet:FILE>
The changes needed for this new option are the next, all this changes in
the class tx_rdtdate:
- Modified two functions:
function getFullServerPath($filename) {
return t3lib_div::fixWindowsFilePath(
t3lib_div::resolveBackPath(
t3lib_basicFileFunctions::slashPath(PATH_site) .
t3lib_basicFileFunctions::slashPath($this->_getTargetDir()) . $filename
)
);
}
function getRelWebPath($filename) {
return t3lib_div::resolveBackPath(
t3lib_basicFileFunctions::slashPath($this->_getTargetDir()) .
$filename
);
}
- Added a new funcition:
function _getTargetDir() {
$mTargetDir = $this->oForm->_navConf("/data/targetdir/",
$this->aElement);
if(is_array($mTargetDir) && array_key_exists("userobj",
$mTargetDir)) {
$mTargetDir = $this->oForm->_callUserObj($mTargetDir);
}
return $mTargetDir;
}
You can add this new option to the future new FORMidable release ;-)
Best regards,
Rego
--
http://www.igalia.com
More information about the TYPO3-project-formidable
mailing list