[TYPO3-project-formidable] UPLOAD or FILE renderlet

Manuel Rego Casasnovas mrego at igalia.com
Thu Oct 25 09:21:00 CEST 2007


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

-- 
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