[TYPO3-project-formidable] UPLOAD or FILE renderlet

Jerome Schneider typo3dev at ameos.com
Thu Oct 25 11:05:27 CEST 2007


Hi Manuel,

It's actually the best way to link upload and lister; but If you update 
to latest revision 145, you'll be able to use the deleteFile() method on 
renderlet:UPLOAD, in an onclick event on the "Delete" button to handle 
the delete action.

I placed a fonctional XML example at:
http://www.ameos.com/fileadmin/formidable/helps/simplesample-up+list.xml


Best regards,
Jerome Schneider

PS: get latest T3X at:
http://www.ameos.com/fileadmin/formidable/builds/t3x/T3X_ameos_formidable-0_7_145.t3x


Manuel Rego Casasnovas a écrit :
> Hi Jerome,
> 
> Jerome Schneider escribió:
>> If multiple, it can be combined with a renderlet:LISTER via a 
>> datasource:PHPARRAY to handle file list ( delete, view, ... )
>>   
> 
> I have used a "renderlet:UPLOAD" with the option "multiple".
>         <renderlet:UPLOAD name="images" label="Images">
>             <data>
>                 <targetdir>typo3temp/</targetdir>
>                 <multiple>true</multiple>
>             </data>
>         </renderlet:UPLOAD>
> 
> And a "renderlet:LISTER" like:
>         <renderlet:LISTER name="images_list" label="Images list">
>             <datasource use="images" />
>             <columns>
>                 <column name="file" type="renderlet:TEXT" label="File" />
>                 <column name="delete" type="renderlet:TEXT" />
>             </columns>
>         </renderlet:LISTER>
> 
> Moreover, I've defined a "datasource:PHPARRAY" which call to my function
> "_getImages":
> function _getImages($aData, $oForm) {
>         $images = $oForm->oDataHandler->_getThisFormData('images');
>         if (!$images) {
>             return array();
>         }
>         $images = explode(',', $images);
> 
>         foreach ($images as $image) {
>             $toReturn[] = array(
>                 'file' => $image,
>                 'delete' => '<a href="#?file=' . $image .
> '">Delete</a>', // A link with get params to delete the image
>                 // This link is only an example
>             );
>         }
> 
>         return $toReturn;
>     }
> 
> 
> Is this the best way to do it?
> 
> 
> Best regards,
>    Rego
> 


More information about the TYPO3-project-formidable mailing list