[FEATURE] Make use of File Abstraction Layer in Frontend
authorTYPO3 FAL Team <typo3v4@typo3.org>
Fri, 20 Apr 2012 16:38:51 +0000 (18:38 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 28 Apr 2012 13:15:39 +0000 (15:15 +0200)
Change-Id: Ie2a8e10977b2363c75b5a78442460c606cd7b026
Resolves: #33752
Releases: 6.0
Reviewed-on: http://review.typo3.org/10658
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
14 files changed:
typo3/sysext/cms/ext_autoload.php
typo3/sysext/cms/ext_tables.sql
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/locallang_ttc.xlf
typo3/sysext/cms/tbl_cms.php
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/content/class.tslib_content_abstract.php
typo3/sysext/cms/tslib/content/class.tslib_content_content.php
typo3/sysext/cms/tslib/content/class.tslib_content_files.php [new file with mode: 0644]
typo3/sysext/cms/tslib/interfaces/interface.tslib_content_fileLinkHook.php [new file with mode: 0644]
typo3/sysext/cms/tslib/interfaces/interface.tslib_content_getPublicUrlForFileHook.php [new file with mode: 0644]
typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
typo3/sysext/css_styled_content/static/setup.txt

index 0196726..1cfbed1 100644 (file)
@@ -31,8 +31,10 @@ return array(
        'tslib_menu_filterMenuPagesHook' => PATH_tslib . 'interfaces/interface.tslib_menu_filterMenuPagesHook.php',
        'tslib_content_getdatahook' => PATH_tslib . 'interfaces/interface.tslib_content_getdatahook.php',
        'tslib_cobj_getimgresourcehook' => PATH_tslib . 'interfaces/interface.tslib_content_getimgresourcehook.php',
+       'tslib_content_getpublicurlforfilehook' => PATH_tslib . 'interfaces/interface.tslib_content_getPublicUrlForFileHook.php',
        'tslib_content_postinithook' => PATH_tslib . 'interfaces/interface.tslib_content_postinithook.php',
        'tslib_content_stdwraphook' => PATH_tslib . 'interfaces/interface.tslib_content_stdwraphook.php',
+       'tslib_content_filelinkhook' => PATH_tslib . 'interfaces/interface.tslib_content_filelinkhook.php',
        'tslib_adminpanelhook' => PATH_tslib . 'interfaces/interface.tslib_adminPanelHook.php',
        'user_various' => PATH_tslib . 'media/scripts/example_callfunction.php',
        'tslib_gmenu_foldout' => PATH_tslib . 'media/scripts/gmenu_foldout.php',
@@ -51,6 +53,7 @@ return array(
        'tslib_content_content' => PATH_tslib . 'content/class.tslib_content_content.php',
        'tslib_content_contenttable' => PATH_tslib . 'content/class.tslib_content_contenttable.php',
        'tslib_content_file' => PATH_tslib . 'content/class.tslib_content_file.php',
+       'tslib_content_files' => PATH_tslib . 'content/class.tslib_content_files.php',
        'tslib_content_fluidtemplate' => PATH_tslib . 'content/class.tslib_content_fluidtemplate.php',
        'tslib_content_form' => PATH_tslib . 'content/class.tslib_content_form.php',
        'tslib_content_hierarchicalmenu' => PATH_tslib . 'content/class.tslib_content_hierarchicalmenu.php',
@@ -75,4 +78,4 @@ return array(
        'tslib_content_user' => PATH_tslib . 'content/class.tslib_content_user.php',
        'tslib_content_editpanel' => PATH_tslib . 'content/class.tslib_content_editpanel.php',
 );
-?>
\ No newline at end of file
+?>
index 9d389f2..2db5407 100755 (executable)
@@ -283,7 +283,10 @@ CREATE TABLE tt_content (
   header varchar(255) DEFAULT '' NOT NULL,
   header_position varchar(6) DEFAULT '' NOT NULL,
   bodytext mediumtext,
+
+  # Even though we're using FAL and an IRRE field for images now, it needs to stay "text" for the migration to work
   image text,
+
   imagewidth mediumint(11) unsigned DEFAULT '0' NOT NULL,
   imageorient tinyint(4) unsigned DEFAULT '0' NOT NULL,
   imagecaption text,
@@ -327,7 +330,9 @@ CREATE TABLE tt_content (
   select_key varchar(80) DEFAULT '' NOT NULL,
   sectionIndex tinyint(3) unsigned DEFAULT '0' NOT NULL,
   linkToTop tinyint(3) unsigned DEFAULT '0' NOT NULL,
+  file_collections text,
   filelink_size tinyint(3) unsigned DEFAULT '0' NOT NULL,
+  filelink_sorting tinytext NOT NULL,
   target varchar(30) DEFAULT '' NOT NULL,
   section_frame tinyint(3) unsigned DEFAULT '0' NOT NULL,
   date int(10) unsigned DEFAULT '0' NOT NULL,
index 429699f..3e638ba 100755 (executable)
@@ -1403,7 +1403,7 @@ class tx_cms_layout extends recordList {
                                        break;
                                case 'uploads':
                                        if ($row['media']) {
-                                               $out .= $this->linkEditContent($this->renderText($row['bodytext']), $row) . '<br />';
+                                               $out .= $this->thumbCode($row, 'tt_content', 'media') . '<br />';
                                        }
                                        break;
                                case 'multimedia':
@@ -2231,4 +2231,4 @@ if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLA
        include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']);
 }
 
-?>
\ No newline at end of file
+?>
index a272dee..74a766d 100644 (file)
                        <trans-unit id="image_longdescURL" xml:space="preserve">
                                <source>Long Description URL:</source>
                        </trans-unit>
+                       <trans-unit id="images.addFileReference" xml:space="preserve">
+                               <source>Add image</source>
+                       </trans-unit>
                        <trans-unit id="longdescURL_formlabel" xml:space="preserve">
                                <source>Long Description URLs (one per line)</source>
                        </trans-unit>
                        <trans-unit id="media" xml:space="preserve">
                                <source>Files</source>
                        </trans-unit>
+                       <trans-unit id="media.dataAttributes" xml:space="preserve">
+                               <source>Additional data-* Attributes for HTML5 video tag</source>
+                       </trans-unit>
+                       <trans-unit id="media.dataAttributes.attributeName" xml:space="preserve">
+                               <source>Name of attribute (without data-)</source>
+                       </trans-unit>
+                       <trans-unit id="media.dataAttributes.content" xml:space="preserve">
+                               <source>Content</source>
+                       </trans-unit>
                        <trans-unit id="media.ALT.uploads_formlabel" xml:space="preserve">
-                               <source>Select Files</source>
+                               <source>Select single files</source>
+                       </trans-unit>
+                       <trans-unit id="media.addFileReference" xml:space="preserve">
+                               <source>Add file</source>
                        </trans-unit>
                        <trans-unit id="multimedia" xml:space="preserve">
                                <source>File:</source>
                        <trans-unit id="multimedia_formlabel" xml:space="preserve">
                                <source>Selected Media File</source>
                        </trans-unit>
+                       <trans-unit id="file_collections" xml:space="preserve">
+                               <source>File collections</source>
+                       </trans-unit>
+                       <trans-unit id="file_collections.ALT.uploads_formlabel" xml:space="preserve">
+                               <source>Select file collections</source>
+                       </trans-unit>
                        <trans-unit id="filelink_size" xml:space="preserve">
                                <source>Show File Size:</source>
                        </trans-unit>
+                       <trans-unit id="filelink_sorting" xml:space="preserve">
+                               <source>Sort Filelist:</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.none" xml:space="preserve">
+                                       <source>none</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.extension" xml:space="preserve">
+                                       <source>by Fileextension</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.name" xml:space="preserve">
+                                       <source>by Filename</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.type" xml:space="preserve">
+                                       <source>by Filetype</source>
+                       </trans-unit>
+                       <trans-unit id="filelink_sorting.size" xml:space="preserve">
+                                       <source>by Filesize</source>
+                       </trans-unit>
                        <trans-unit id="filelink_size_formlabel" xml:space="preserve">
                                <source>Display File Size Information</source>
                        </trans-unit>
                        <trans-unit id="media.fallbackUrl" xml:space="preserve">
                                <source>Path or URL to fallback video source (Flash or QuickTime)</source>
                        </trans-unit>
+                       <trans-unit id="media.previewImage" xml:space="preserve">
+                               <source>Preview-Image for the Video (HTML5 only)</source>
+                       </trans-unit>
                        <trans-unit id="media.sources" xml:space="preserve">
                                <source>Video sources for HTML5 &lt;video&gt; element</source>
                        </trans-unit>
index 81bfde7..523b118 100755 (executable)
@@ -632,17 +632,7 @@ $TCA['pages_language_overlay'] = array(
                'media' => array(
                        'exclude' => 1,
                        'label' => $TCA['pages']['columns']['media']['label'],
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => $TCA['pages']['columns']['media']['config']['allowed'],
-                               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
-                               'uploadfolder' => 'uploads/media',
-                               'show_thumbs' => '1',
-                               'size' => '3',
-                               'maxitems' => '100',
-                               'minitems' => '0'
-                       )
+                       'config' => t3lib_extMgm::getFileFieldTCAConfig('media'),
                ),
                'url' => array(
                        'exclude' => 1,
@@ -865,6 +855,28 @@ $TCA['pages_language_overlay'] = array(
 
 
 
+
+       // Keep old code (pre-FAL) for installations that haven't upgraded yet.
+       // @deprecated since TYPO3 6.0, please remove in TYPO3 7.0
+       // existing installation - and files are merged, nothing to do
+if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'pages_language_overlay:media')) && !t3lib_div::compat_version('6.0')) {
+       t3lib_div::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[pages_language_overlay][columns][media] yet. Please do so before TYPO3 v7.');
+               // existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
+       $TCA['pages_language_overlay']['columns']['media']['config'] = array(
+               'type' => 'group',
+               'internal_type' => 'file',
+               'allowed' => $TCA['pages']['columns']['media']['config']['allowed'],
+               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
+               'uploadfolder' => 'uploads/media',
+               'show_thumbs' => '1',
+               'size' => '3',
+               'maxitems' => '100',
+               'minitems' => '0'
+       );
+}
+
+
+
 // ******************************************************************
 // sys_template
 // ******************************************************************
index b858457..a0134ae 100755 (executable)
@@ -675,23 +675,62 @@ $TCA['tt_content'] = array(
                                                '',
                                        ),
                                ),
-                               'cols' => 4,                    ),
+                               'cols' => 4,
+                       ),
                ),
                'image' => array(
-#                      'l10n_mode' => 'mergeIfNotBlank',
+                       'l10n_mode' => 'mergeIfNotBlank',
                        'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.images',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
-                               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
-                               'uploadfolder' => 'uploads/pics',
-                               'show_thumbs' => '1',
-                               'size' => '3',
+                       'config' => t3lib_extMgm::getFileFieldTCAConfig('image', array(
+                               'appearance' => array(
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference',
+                               ),
+                                       // custom configuration for displaying fields in the overlay/reference table
+                                       // to use the imageoverlayPalette instead of the basicoverlayPalette
+                               'foreign_types' => array(
+                                       '0' => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                                       t3lib_file_File::FILETYPE_TEXT => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                                       t3lib_file_File::FILETYPE_IMAGE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                                       t3lib_file_File::FILETYPE_AUDIO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                                       t3lib_file_File::FILETYPE_VIDEO => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                                       t3lib_file_File::FILETYPE_SOFTWARE => array(
+                                               'showitem' => '
+                                                       --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                                       --palette--;;filePalette',
+                                       ),
+                               ),
+                               'foreign_selector_fieldTcaOverride' => array(
+                                        'config' => array(
+                                                'filter' => array(
+                                                        'fileType' =>  array(
+                                                                'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
+                                                        )
+                                                )
+                                       )
+                               ),
                                'maxitems' => '200',
                                'minitems' => '0',
-                               'autoSizeMax' => 40,
-                       ),
+                       )),
                ),
                'imagewidth' => array(
                        'exclude' => 1,
@@ -1411,18 +1450,28 @@ $TCA['tt_content'] = array(
                ),
                'media' => array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xml:media',
+                       'config' => t3lib_extMgm::getFileFieldTCAConfig('media', array(
+                               'appearance' => array(
+                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:media.addFileReference',
+                               ),
+                                'foreign_selector_fieldTcaOverride' => array(
+                                        'config' => array(
+                                                'filter' => array(
+                                                        'fileType' =>  array(
+                                                                'disallowed' => PHP_EXTENSIONS_DEFAULT
+                                                        )
+                                                )
+                                       )
+                               ),
+                       )),
+               ),
+               'file_collections' => array(
+                       'label' => 'LLL:EXT:cms/locallang_ttc.xlf:file_collections',
                        'config' => array(
                                'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => '',        // Must be empty for disallowed to work.
-                               'disallowed' => PHP_EXTENSIONS_DEFAULT,
-                               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
-                               'uploadfolder' => 'uploads/media',
-                               'show_thumbs' => '1',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'minitems' => '0',
-                       ),
+                               'internal_type' => 'db',
+                               'allowed' => 'sys_file_collection',
+                       )
                ),
                'multimedia' => array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xml:multimedia',
@@ -1448,6 +1497,19 @@ $TCA['tt_content'] = array(
                                ),
                        ),
                ),
+               'filelink_sorting' => array(
+                       'label' => 'LLL:EXT:cms/locallang_ttc.xml:filelink_sorting',
+                       'config' => array(
+                               'type' => 'select',
+                               'items' => array (
+                                       array('LLL:EXT:cms/locallang_ttc.xlf:filelink_sorting.none', ''),
+                                       array('LLL:EXT:cms/locallang_ttc.xlf:filelink_sorting.extension', 'extension'),
+                                       array('LLL:EXT:cms/locallang_ttc.xlf:filelink_sorting.name', 'name'),
+                                       array('LLL:EXT:cms/locallang_ttc.xlf:filelink_sorting.type', 'type'),
+                                       array('LLL:EXT:cms/locallang_ttc.xlf:filelink_sorting.size', 'size'),
+                               ),
+                       ),
+               ),
                'target' => array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xml:target',
                        'config' => array(
@@ -1744,12 +1806,11 @@ $TCA['tt_content'] = array(
                                        '--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.general;general,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.header;header,
                                        bodytext;Text;;richtext:rte_transform[flag=rte_enabled|mode=ts_css],
-                                       rte_enabled;LLL:EXT:cms/locallang_ttc.xml:rte_enabled_formlabel,
-                               --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.images,
+                                       rte_enabled;LLL:EXT:cms/locallang_ttc.xml:rte_enabled_formlabel,' // Only the following tab is relevant to be changed for FAL:
+                               .'--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.images,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imagefiles;imagefiles,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imagelinks;imagelinks,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.image_accessibility;image_accessibility,
-                               --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.appearance,
+                                       --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imagelinks;imagelinks,' // This palette will only have the clickEnlarge option in the future, as the real link field is moved to the sys_file_reference inline table. Maybe the clickEnlarge link should be moved to the appearance tab of the content element instead?
+                               .'--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.appearance,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.frames;frames,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.image_settings;image_settings,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imageblock;imageblock,
@@ -1765,7 +1826,6 @@ $TCA['tt_content'] = array(
                                --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.images,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imagefiles;imagefiles,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.imagelinks;imagelinks,
-                                       --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.image_accessibility;image_accessibility,
                                --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.appearance,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.frames;frames,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.image_settings;image_settings,
@@ -1814,7 +1874,8 @@ $TCA['tt_content'] = array(
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.access;access,
                                --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.extended',
                ),
-               'uploads' =>    array(
+                       // file list
+               'uploads' => array(
                        'showitem' =>
                                        '--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.general;general,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.header;header,
@@ -2036,7 +2097,7 @@ $TCA['tt_content'] = array(
                        'canNotCollapse' => 1,
                ),
                'imagefiles' => array(
-                       'showitem' => 'image;LLL:EXT:cms/locallang_ttc.xml:image_formlabel, imagecaption;LLL:EXT:cms/locallang_ttc.xml:imagecaption_formlabel',
+                       'showitem' => 'image;LLL:EXT:cms/locallang_ttc.xml:image_formlabel',
                        'canNotCollapse' => 1,
                ),
                'multimediafiles' => array(
@@ -2048,7 +2109,7 @@ $TCA['tt_content'] = array(
                        'canNotCollapse' => 1,
                ),
                'imagelinks' => array(
-                       'showitem' => 'image_zoom;LLL:EXT:cms/locallang_ttc.xml:image_zoom_formlabel, image_link;LLL:EXT:cms/locallang_ttc.xml:image_link_formlabel',
+                       'showitem' => 'image_zoom;LLL:EXT:cms/locallang_ttc.xml:image_zoom_formlabel',
                        'canNotCollapse' => 1,
                ),
                'image_accessibility' => array(
@@ -2064,7 +2125,7 @@ $TCA['tt_content'] = array(
                        'canNotCollapse' => 1,
                ),
                'uploads' => array(
-                       'showitem' => 'select_key;LLL:EXT:cms/locallang_ttc.xml:select_key.ALT.uploads_formlabel, --linebreak--, media;LLL:EXT:cms/locallang_ttc.xml:media.ALT.uploads_formlabel, --linebreak--, target, --linebreak--, imagecaption;LLL:EXT:cms/locallang_ttc.xml:imagecaption.ALT.uploads_formlabel, titleText;LLL:EXT:cms/locallang_ttc.xml:titleText_formlabel, --linebreak--, altText;LLL:EXT:cms/locallang_ttc.xml:altText_formlabel',
+                       'showitem' => 'media;LLL:EXT:cms/locallang_ttc.xml:media.ALT.uploads_formlabel, --linebreak--, file_collections;LLL:EXT:cms/locallang_ttc.xml:file_collections.ALT.uploads_formlabel, --linebreak--, filelink_sorting, target',
                        'canNotCollapse' => 1,
                ),
                'mailform' => array(
@@ -2110,5 +2171,42 @@ $TCA['tt_content'] = array(
        ),
 );
 
+       // keep old code (pre-FAL) for installations that haven't upgraded yet. please remove this code in TYPO3 7.0
+       // @deprecated since TYPO3 6.0, please remove in TYPO3 7.0
+       // existing installation - and files are merged, nothing to do
+if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'tt_content:image')) && !t3lib_div::compat_version('6.0')) {
+       t3lib_div::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[tt_content][columns][image] yet. Please do so before TYPO3 v7.');
+       // existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
+       $TCA['tt_content']['columns']['image']['config'] = array(
+               'type' => 'group',
+               'internal_type' => 'file',
+               'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
+               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
+               'uploadfolder' => 'uploads/pics',
+               'show_thumbs' => '1',
+               'size' => '3',
+               'maxitems' => '200',
+               'minitems' => '0',
+               'autoSizeMax' => 40
+       );
+}
+
+if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard']) || !t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Updates_File_TceformsUpdateWizard'], 'tt_content:media')) && !t3lib_div::compat_version('6.0')) {
+       t3lib_div::deprecationLog('This installation hasn\'t been migrated to FAL for the field $TCA[tt_content][columns][media] yet. Please do so before TYPO3 v7.');
+       // existing installation and no upgrade wizard was executed - and files haven't been merged: use the old code
+       $TCA['tt_content']['columns']['media']['config'] = array(
+               'type' => 'group',
+               'internal_type' => 'file',
+               'allowed' => '',        // Must be empty for disallowed to work.
+               'disallowed' => PHP_EXTENSIONS_DEFAULT,
+               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
+               'uploadfolder' => 'uploads/media',
+               'show_thumbs' => '1',
+               'size' => '3',
+               'maxitems' => '10',
+               'minitems' => '0',
+       );
+}
+
 
 ?>
index d303da9..9713d24 100644 (file)
@@ -348,6 +348,11 @@ class tslib_cObj {
        protected $contentObjects = array();
 
        /**
+        * @var t3lib_file_File Current file objects (during iterations over files)
+        */
+       protected $currentFile = NULL;
+
+       /**
         * Set to TRUE by doConvertToUserIntObject() if USER object wants to become USER_INT
         */
        public $doConvertToUserIntObject = FALSE;
@@ -427,6 +432,15 @@ class tslib_cObj {
        }
 
        /**
+        * Returns the current table
+        *
+        * @return string
+        */
+       public function getCurrentTable() {
+               return $this->table;
+       }
+
+       /**
         * Clone helper.
         *
         * Resets the references to the TypoScript Content Object implementation
@@ -636,6 +650,7 @@ class tslib_cObj {
                        'USER' => 'User',
                        'USER_INT' => 'UserInternal',
                        'FILE' => 'File',
+                       'FILES' => 'Files',
                        'IMAGE' => 'Image',
                        'IMG_RESOURCE' => 'ImageResource',
                        'IMGTEXT' => 'ImageText',
@@ -799,6 +814,16 @@ class tslib_cObj {
        }
 
        /**
+        * Rendering the cObject, FILES
+        *
+        * @param       array           array of TypoScript properties
+        * @return      string          Output
+        */
+       function FILES($conf) {
+               return $this->getContentObject('FILES')->render($conf);
+       }
+
+       /**
         * Rendering the cObject, IMAGE
         *
         * @param       array           array of TypoScript properties
@@ -1805,6 +1830,24 @@ class tslib_cObj {
                return $markContentArray;
        }
 
+       /**
+        * Sets the current file object during iterations over files.
+        *
+        * @param t3lib_file_File $fileObject The file object.
+        */
+       public function setCurrentFile($fileObject) {
+               $this->currentFile = $fileObject;
+       }
+
+       /**
+        * Gets the current file object during iterations over files.
+        *
+        * @return t3lib_file_File The current file object.
+        */
+       public function getCurrentFile() {
+               return $this->currentFile;
+       }
+
        /***********************************************
         *
         * "stdWrap" + sub functions
@@ -5061,7 +5104,7 @@ class tslib_cObj {
         *
         * @param       string          A "imgResource" TypoScript data type. Either a TypoScript file resource or the string GIFBUILDER. See description above.
         * @param       array           TypoScript properties for the imgResource type
-        * @return      array           Returns info-array. info[origFile] = original file.
+        * @return      array           Returns info-array. info[origFile] = original file. [0]/[1] is w/h, [2] is file extension and [3] is the filename.
         * @see IMG_RESOURCE(), cImage(), tslib_gifBuilder
         */
        function getImgResource($file, $fileArray) {
@@ -5077,190 +5120,97 @@ class tslib_cObj {
                                        }
                                        $imageResource = $gifCreator->getImageDimensions($theImage);
                                break;
-                               default :
-                                       if ($fileArray['import.']) {
-                                               $ifile = $this->stdWrap('', $fileArray['import.']);
-                                               if ($ifile) {
-                                                       $file = $fileArray['import'] . $ifile;
+                               default:
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($file)) {
+                                               $fileObject = t3lib_file_Factory::getInstance()->retrieveFileOrFolderObject($file);
+                                       } else {
+                                               if ($fileArray['import.']) {
+                                                       $ifile = $this->stdWrap('', $fileArray['import.']);
+                                                       if ($ifile) {
+                                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($ifile)) {
+                                                                       $file = $ifile;
+                                                               } else {
+                                                                       $file = $fileArray['import'] . $ifile;
+                                                               }
+                                                       }
                                                }
+
+                                                       // clean ../ sections of the path and resolve to proper string. This is necessary for the Tx_File_BackwardsCompatibility_TslibContentAdapter to work.
+                                               $file = t3lib_div::resolveBackPath($file);
+                                               $fileObject = t3lib_file_Factory::getInstance()->retrieveFileOrFolderObject($file);
                                        }
-                                       $theImage = $GLOBALS['TSFE']->tmpl->getFileName($file);
-                                       if ($theImage) {
-                                               $fileArray['width'] = isset($fileArray['width.'])
+
+                                       if ($fileObject instanceof t3lib_file_FileInterface) {
+                                               $processingConfiguration = array();
+                                               $processingConfiguration['width'] = isset($fileArray['width.'])
                                                        ? $this->stdWrap($fileArray['width'], $fileArray['width.'])
                                                        : $fileArray['width'];
-                                               $fileArray['height'] = isset($fileArray['height.'])
+                                               $processingConfiguration['height'] = isset($fileArray['height.'])
                                                        ? $this->stdWrap($fileArray['height'], $fileArray['height.'])
                                                        : $fileArray['height'];
-                                               $fileArray['ext'] = isset($fileArray['ext.'])
+                                               $processingConfiguration['fileExtension'] = isset($fileArray['ext.'])
                                                        ? $this->stdWrap($fileArray['ext'], $fileArray['ext.'])
                                                        : $fileArray['ext'];
-                                               $fileArray['maxW'] = isset($fileArray['maxW.'])
+                                               $processingConfiguration['maxWidth'] = isset($fileArray['maxW.'])
                                                        ? intval($this->stdWrap($fileArray['maxW'], $fileArray['maxW.']))
                                                        : intval($fileArray['maxW']);
-                                               $fileArray['maxH'] = isset($fileArray['maxH.'])
+                                               $processingConfiguration['maxHeight'] = isset($fileArray['maxH.'])
                                                        ? intval($this->stdWrap($fileArray['maxH'], $fileArray['maxH.']))
                                                        : intval($fileArray['maxH']);
-                                               $fileArray['minW'] = isset($fileArray['minW.'])
+                                               $processingConfiguration['minWidth'] = isset($fileArray['minW.'])
                                                        ? intval($this->stdWrap($fileArray['minW'], $fileArray['minW.']))
                                                        : intval($fileArray['minW']);
-                                               $fileArray['minH'] = isset($fileArray['minH.'])
+                                               $processingConfiguration['minHeight'] = isset($fileArray['minH.'])
                                                        ? intval($this->stdWrap($fileArray['minH'], $fileArray['minH.']))
                                                        : intval($fileArray['minH']);
-                                               $fileArray['noScale'] = isset($fileArray['noScale.'])
+                                               $processingConfiguration['noScale'] = isset($fileArray['noScale.'])
                                                        ? $this->stdWrap($fileArray['noScale'], $fileArray['noScale.'])
                                                        : $fileArray['noScale'];
-                                               $fileArray['params'] = isset($fileArray['params.'])
+                                               $processingConfiguration['additionalParameters'] = isset($fileArray['params.'])
                                                        ? $this->stdWrap($fileArray['params'], $fileArray['params.'])
                                                        : $fileArray['params'];
-                                               $maskArray = $fileArray['m.'];
-                                               $maskImages = array();
-                                               if (is_array($fileArray['m.'])) { // Must render mask images and include in hash-calculating - else we cannot be sure the filename is unique for the setup!
-                                                       $maskImages['m_mask'] = $this->getImgResource($maskArray['mask'], $maskArray['mask.']);
-                                                       $maskImages['m_bgImg'] = $this->getImgResource($maskArray['bgImg'], $maskArray['bgImg.']);
-                                                       $maskImages['m_bottomImg'] = $this->getImgResource($maskArray['bottomImg'], $maskArray['bottomImg.']);
-                                                       $maskImages['m_bottomImg_mask'] = $this->getImgResource($maskArray['bottomImg_mask'], $maskArray['bottomImg_mask.']);
-                                               }
-                                               $hash = t3lib_div::shortMD5($theImage . serialize($fileArray) . serialize($maskImages));
-                                               if (!isset($GLOBALS['TSFE']->tmpl->fileCache[$hash])) {
-                                                       $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
-                                                       $gifCreator->init();
-
-                                                       if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
-                                                               $filename = basename($theImage);
-                                                                       // remove extension
-                                                               $filename = substr($filename, 0, strrpos($filename, '.'));
-                                                               $tempFilePrefixLength = intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']);
-                                                               if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {
-                                                                               /** @var $t3libCsInstance t3lib_cs */
-                                                                       $t3libCsInstance = t3lib_div::makeInstance('t3lib_cs');
-                                                                       $filenamePrefix = $t3libCsInstance->substr('utf-8', $filename, 0, $tempFilePrefixLength);
-                                                               } else {
-                                                                               // strip everything non-ascii
-                                                                       $filename = preg_replace('/[^A-Za-z0-9_-]/', '', trim($filename));
-                                                                       $filenamePrefix = substr($filename, 0, $tempFilePrefixLength);
-                                                               }
-                                                               $gifCreator->filenamePrefix = $filenamePrefix . '_';
-                                                               unset($filename);
-                                                       }
 
-                                                       if ($fileArray['sample']) {
-                                                               $gifCreator->scalecmd = '-sample';
-                                                               $GLOBALS['TT']->setTSlogMessage('Sample option: Images are scaled with -sample.');
-                                                       }
-                                                       if ($fileArray['alternativeTempPath'] && t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['allowedTempPaths'], $fileArray['alternativeTempPath'])) {
-                                                               $gifCreator->tempPath = $fileArray['alternativeTempPath'];
-                                                               $GLOBALS['TT']->setTSlogMessage('Set alternativeTempPath: ' . $fileArray['alternativeTempPath']);
+                                                       // check if we can handle this type of file for editing
+                                               if (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {
+                                                       $maskArray = $fileArray['m.'];
+                                                               // Must render mask images and include in hash-calculating
+                                                               // - otherwise we cannot be sure the filename is unique for the setup!
+                                                       if (is_array($maskArray)) {
+                                                               $processingConfiguration['maskImages']['m_mask'] = $this->getImgResource($maskArray['mask'], $maskArray['mask.']);
+                                                               $processingConfiguration['maskImages']['m_bgImg'] = $this->getImgResource($maskArray['bgImg'], $maskArray['bgImg.']);
+                                                               $processingConfiguration['maskImages']['m_bottomImg'] = $this->getImgResource($maskArray['bottomImg'], $maskArray['bottomImg.']);
+                                                               $processingConfiguration['maskImages']['m_bottomImg_mask'] = $this->getImgResource($maskArray['bottomImg_mask'], $maskArray['bottomImg_mask.']);
                                                        }
 
-                                                       if (!trim($fileArray['ext'])) {
-                                                               $fileArray['ext'] = 'web';
-                                                       }
-                                                       $options = array();
-                                                       if ($fileArray['maxW']) {
-                                                               $options['maxW'] = $fileArray['maxW'];
-                                                       }
-                                                       if ($fileArray['maxH']) {
-                                                               $options['maxH'] = $fileArray['maxH'];
-                                                       }
-                                                       if ($fileArray['minW']) {
-                                                               $options['minW'] = $fileArray['minW'];
-                                                       }
-                                                       if ($fileArray['minH']) {
-                                                               $options['minH'] = $fileArray['minH'];
-                                                       }
-                                                       if ($fileArray['noScale']) {
-                                                               $options['noScale'] = $fileArray['noScale'];
+                                                       if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
+                                                               $processingConfiguration['useTargetFileNameAsPrefix'] = 1;
                                                        }
-
-                                                               // checks to see if m (the mask array) is defined
-                                                       if (is_array($maskArray) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
-                                                                       // Filename:
-                                                               $fI = t3lib_div::split_fileref($theImage);
-                                                               $imgExt = (strtolower($fI['fileext']) == $gifCreator->gifExtension ? $gifCreator->gifExtension : 'jpg');
-                                                               $dest = $gifCreator->tempPath . $hash . '.' . $imgExt;
-                                                               if (!file_exists($dest)) { // Generate!
-                                                                       $m_mask = $maskImages['m_mask'];
-                                                                       $m_bgImg = $maskImages['m_bgImg'];
-                                                                       if ($m_mask && $m_bgImg) {
-                                                                               $negate = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_negate_mask'] ? ' -negate' : '';
-
-                                                                               $temp_ext = 'png';
-                                                                               if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_mask_temp_ext_gif']) { // If ImageMagick version 5+
-                                                                                       $temp_ext = $gifCreator->gifExtension;
-                                                                               }
-
-                                                                               $tempFileInfo = $gifCreator->imageMagickConvert($theImage, $temp_ext, $fileArray['width'], $fileArray['height'], $fileArray['params'], $fileArray['frame'], $options);
-                                                                               if (is_array($tempFileInfo)) {
-                                                                                       $m_bottomImg = $maskImages['m_bottomImg'];
-                                                                                       if ($m_bottomImg) {
-                                                                                               $m_bottomImg_mask = $maskImages['m_bottomImg_mask'];
-                                                                                       }
-                                                                                               //      Scaling:        ****
-                                                                                       $tempScale = array();
-                                                                                       $command = '-geometry ' . $tempFileInfo[0] . 'x' . $tempFileInfo[1] . '!';
-                                                                                       $command = $this->modifyImageMagickStripProfileParameters($command, $fileArray);
-                                                                                       $tmpStr = $gifCreator->randomName();
-
-                                                                                               //      m_mask
-                                                                                       $tempScale['m_mask'] = $tmpStr . '_mask.' . $temp_ext;
-                                                                                       $gifCreator->imageMagickExec($m_mask[3], $tempScale['m_mask'], $command . $negate);
-                                                                                               //      m_bgImg
-                                                                                       $tempScale['m_bgImg'] = $tmpStr . '_bgImg.' . trim($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_mask_temp_ext_noloss']);
-                                                                                       $gifCreator->imageMagickExec($m_bgImg[3], $tempScale['m_bgImg'], $command);
-
-                                                                                               //      m_bottomImg / m_bottomImg_mask
-                                                                                       if ($m_bottomImg && $m_bottomImg_mask) {
-                                                                                               $tempScale['m_bottomImg'] = $tmpStr . '_bottomImg.' . $temp_ext;
-                                                                                               $gifCreator->imageMagickExec($m_bottomImg[3], $tempScale['m_bottomImg'], $command);
-                                                                                               $tempScale['m_bottomImg_mask'] = $tmpStr . '_bottomImg_mask.' . $temp_ext;
-                                                                                               $gifCreator->imageMagickExec($m_bottomImg_mask[3], $tempScale['m_bottomImg_mask'], $command . $negate);
-
-                                                                                                       // BEGIN combining:
-                                                                                                       // The image onto the background
-                                                                                               $gifCreator->combineExec($tempScale['m_bgImg'], $tempScale['m_bottomImg'], $tempScale['m_bottomImg_mask'], $tempScale['m_bgImg']);
-                                                                                       }
-                                                                                               // The image onto the background
-                                                                                       $gifCreator->combineExec($tempScale['m_bgImg'], $tempFileInfo[3], $tempScale['m_mask'], $dest);
-                                                                                               // Unlink the temp-images...
-                                                                                       foreach ($tempScale as $file) {
-                                                                                               if (@is_file($file)) {
-                                                                                                       unlink($file);
-                                                                                               }
-                                                                                       }
-                                                                               }
-                                                                       }
-                                                               }
-                                                                       // Finish off
-                                                               if (($fileArray['reduceColors'] || ($imgExt == 'png' && !$gifCreator->png_truecolor)) && is_file($dest)) {
-                                                                       $reduced = $gifCreator->IMreduceColors($dest, t3lib_utility_Math::forceIntegerInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
-                                                                       if (is_file($reduced)) {
-                                                                               unlink($dest);
-                                                                               rename($reduced, $dest);
-                                                                       }
-                                                               }
-                                                               $GLOBALS['TSFE']->tmpl->fileCache[$hash] = $gifCreator->getImageDimensions($dest);
-                                                       } else { // Normal situation:
-                                                               $fileArray['params'] = $this->modifyImageMagickStripProfileParameters($fileArray['params'], $fileArray);
-                                                               $GLOBALS['TSFE']->tmpl->fileCache[$hash] = $gifCreator->imageMagickConvert($theImage, $fileArray['ext'], $fileArray['width'], $fileArray['height'], $fileArray['params'], $fileArray['frame'], $options);
-                                                               if (($fileArray['reduceColors'] || ($fileArray['ext'] == 'png' && !$gifCreator->png_truecolor)) && is_file($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
-                                                                       $reduced = $gifCreator->IMreduceColors($GLOBALS['TSFE']->tmpl->fileCache[$hash][3], t3lib_utility_Math::forceIntegerInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
-                                                                       if (is_file($reduced)) {
-                                                                               unlink($GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);
-                                                                               rename($reduced, $GLOBALS['TSFE']->tmpl->fileCache[$hash][3]);
-                                                                       }
-                                                               }
+                                                       $processedFileObject = $fileObject->process(t3lib_file_ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $processingConfiguration);
+                                                       $hash = $processedFileObject->calculateChecksum();
+
+                                                               // store info in the TSFE template cache (kept for backwards compatibility)
+                                                       if ($processedFileObject->isProcessed() && !isset($GLOBALS['TSFE']->tmpl->fileCache[$hash])) {
+                                                               $GLOBALS['TSFE']->tmpl->fileCache[$hash] = array(
+                                                                       0 => $processedFileObject->getProperty('width'),
+                                                                       1 => $processedFileObject->getProperty('height'),
+                                                                       2 => $processedFileObject->getExtension(),
+                                                                       3 => $processedFileObject->getPublicUrl(),
+                                                                       'origFile' => $fileObject->getPublicUrl(),
+                                                                       'origFile_mtime' => $fileObject->getModificationTime(), // This is needed by tslib_gifbuilder, ln 100ff in order for the setup-array to create a unique filename hash.
+                                                                       'originalFile' => $fileObject,
+                                                                       'processedFile' => $processedFileObject,
+                                                                       'fileCacheHash' => $hash
+                                                               );
                                                        }
-                                                       $GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
-                                                       $GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile_mtime'] = @filemtime($theImage); // This is needed by tslib_gifbuilder, ln 100ff in order for the setup-array to create a unique filename hash.
-                                                       $GLOBALS['TSFE']->tmpl->fileCache[$hash]['fileCacheHash'] = $hash;
+                                                       $imageResource = $GLOBALS['TSFE']->tmpl->fileCache[$hash];
+                                               } else {
+                                                       $imageResource = NULL;
                                                }
-                                               $imageResource = $GLOBALS['TSFE']->tmpl->fileCache[$hash];
                                        }
-
                                break;
                        }
                }
+
                $theImage = $GLOBALS['TSFE']->tmpl->getFileName($file);
                        // If image was processed by GIFBUILDER:
                        // ($imageResource indicates that it was processed the regular way)
@@ -5369,6 +5319,9 @@ class tslib_cObj {
                                        case 'field' :
                                                $retVal = $fieldArray[$key];
                                        break;
+                                       case 'file' :
+                                               $retVal = $this->getFileDataKey($key);
+                                       break;
                                        case 'parameters' :
                                                $retVal = $this->parameters[$key];
                                        break;
@@ -5470,6 +5423,77 @@ class tslib_cObj {
        }
 
        /**
+        * Gets file information. This is a helper function for the getData() method above, which resolves e.g.
+        * page.10.data = file:current:title
+        * or
+        * page.10.data = file:17:title
+        *
+        * @param       string          A colon-separated key, e.g. 17:name or current:sha1, with the first part being a sys_file uid or the keyword "current" and the second part being the key of information to get from file (e.g. "title", "size", "description", etc.)
+        * @return  The value as retrieved from the file object.
+        */
+       protected function getFileDataKey($key) {
+               $parts = explode(':', $key);
+               $fileUidOrCurrentKeyword = $parts[0];
+               $requestedFileInformationKey = $parts[1];
+
+               if ($fileUidOrCurrentKeyword === 'current') {
+                       $fileObject = $this->getCurrentFile();
+               } elseif (t3lib_utility_Math::canBeInterpretedAsInteger($fileUidOrCurrentKeyword)) {
+                       /** @var t3lib_file_Factory $fileFactory */
+                       $fileFactory = t3lib_div::makeInstance('t3lib_file_Factory');
+                       $fileObject = $fileFactory->getFileObject($fileUidOrCurrentKeyword);
+               } else {
+                       $fileObject = NULL;
+               }
+
+               if ($fileObject instanceof t3lib_file_FileInterface) {
+                               // All properties of the t3lib_file_FileInterface are available here:
+                       switch ($requestedFileInformationKey) {
+                               case 'name':
+                                       return $fileObject->getName();
+                                       break;
+                               case 'uid':
+                                       return $fileObject->getUid();
+                                       break;
+                               case 'originalUid':
+                                       if($fileObject instanceof t3lib_file_FileReference) {
+                                               return $fileObject->getOriginalFile()->getUid();
+                                       } else {
+                                               return NULL;
+                                       }
+                                       break;
+                               case 'size':
+                                       return $fileObject->getSize();
+                                       break;
+                               case 'sha1':
+                                       return $fileObject->getSha1();
+                                       break;
+                               case 'extension':
+                                       return $fileObject->getExtension();
+                                       break;
+                               case 'mimetype':
+                                       return $fileObject->getMimeType();
+                                       break;
+                               case 'contents':
+                                       return $fileObject->getContents();
+                                       break;
+                               case 'publicUrl':
+                                       return $fileObject->getPublicUrl();
+                                       break;
+                               case 'localPath':
+                                       return $fileObject->getForLocalProcessing();
+                                       break;
+                               default:
+                                               // Generic alternative here
+                                       return $fileObject->getProperty($requestedFileInformationKey);
+                                       break;
+                       }
+               } else {
+                       return 'Error: no file object'; // TODO: fail silently as is common in tslib_content
+               }
+       }
+
+       /**
         * Returns a value from the current rootline (site) from $GLOBALS['TSFE']->tmpl->rootLine;
         *
         * @param       string          Which level in the root line
@@ -5604,6 +5628,8 @@ class tslib_cObj {
         * Generally the concept "typolink" should be used in your own applications as an API for making links to pages with parameters and more. The reason for this is that you will then automatically make links compatible with all the centralized functions for URL simulation and manipulation of parameters into hashes and more.
         * For many more details on the parameters and how they are intepreted, please see the link to TSref below.
         *
+        * the FAL API is handled with the namespace/prefix "file:..."
+        *
         * @param       string          The string (text) to link
         * @param       array           TypoScript configuration (see link below)
         * @return      string          A link-wrapped string.
@@ -5639,6 +5665,28 @@ class tslib_cObj {
                                }
                        }
 
+                               // Resolve FAL-api "file:UID-of-sys_file-record" and "file:combined-identifier"
+                       if ($linkHandlerKeyword === 'file') {
+                               try {
+                                       $fileOrFolderObject = t3lib_file_Factory::getInstance()->retrieveFileOrFolderObject($linkHandlerValue);
+
+                                               // Link to a folder or file
+                                       if ($fileOrFolderObject instanceof t3lib_file_ResourceInterface) {
+                                               $link_paramA[0] = $fileOrFolderObject->getPublicUrl();
+
+                                               // Not resolvable, although it started with file:...
+                                       } else {
+                                               $link_paramA[0] = NULL;
+                                       }
+
+                               } catch (RuntimeException $e) {
+                                       // element wasn't found
+                                       $link_paramA[0] = NULL;
+                               }
+
+                       }
+
+
                        $link_param = trim($link_paramA[0]); // Link parameter value
                        $linkClass = trim($link_paramA[2]); // Link class
                        if ($linkClass == '-')
index 215ff18..e81e29e 100644 (file)
@@ -46,6 +46,7 @@ abstract class tslib_content_Abstract {
         */
        public function __construct(tslib_cObj $cObj) {
                $this->cObj = $cObj;
+               $this->fileFactory = t3lib_file_Factory::getInstance();
        }
 
        /**
@@ -64,6 +65,11 @@ abstract class tslib_content_Abstract {
        public function getContentObject() {
                return $this->cObj;
        }
+
+       /**
+        * @var t3lib_file_Factory
+        */
+       protected $fileFactory = NULL;
 }
 
 ?>
index dcf33aa..baf9e1d 100644 (file)
@@ -104,6 +104,7 @@ class tslib_content_Content extends tslib_content_Abstract {
                                } else {
                                        $this->cObj->currentRecordTotal = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
                                        $GLOBALS['TT']->setTSlogMessage('NUMROWS: ' . $GLOBALS['TYPO3_DB']->sql_num_rows($res));
+                                       /** @var $cObj tslib_cObj */
                                        $cObj = t3lib_div::makeInstance('tslib_cObj');
                                        $cObj->setParent($this->cObj->data, $this->cObj->currentRecord);
                                        $this->cObj->currentRecordNumber = 0;
@@ -131,6 +132,8 @@ class tslib_content_Content extends tslib_content_Abstract {
                                                                }
                                                        }
 
+                                                       t3lib_file_Service_BackwardsCompatibility_TslibContentAdapterService::modifyDBRow($row, $conf['table']);
+
                                                        if (!$GLOBALS['TSFE']->recordRegister[$conf['table'] . ':' . $row['uid']]) {
                                                                $this->cObj->currentRecordNumber++;
                                                                $cObj->parentRecordNumber = $this->cObj->currentRecordNumber;
diff --git a/typo3/sysext/cms/tslib/content/class.tslib_content_files.php b/typo3/sysext/cms/tslib/content/class.tslib_content_files.php
new file mode 100644 (file)
index 0000000..1f0d7ec
--- /dev/null
@@ -0,0 +1,174 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Ingmar Schlecht <ingmar@typo3.org>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Contains FILES content object
+ *
+ * @author Ingmar Schlecht <ingmar@typo3.org>
+ */
+class tslib_content_Files extends tslib_content_Abstract {
+       /**
+        * Rendering the cObject FILES
+        *
+        * @param array Array of TypoScript properties
+        * @return string Output
+        */
+       public function render($conf = array()) {
+               /** @var t3lib_file_Repository_FileRepository $fileRepository */
+               $fileRepository = t3lib_div::makeInstance('t3lib_file_Repository_FileRepository');
+
+               $fileObjects = array();
+
+                       // Getting the files
+               if ($conf['references'] || $conf['references.']) {
+                       /*
+                       The TypoScript could look like this:
+
+                       # all items related to the page.media field:
+                       references {
+                               table = pages
+                               uid.data = page:uid
+                               fieldName = media
+                       }
+
+                       # or: sys_file_references with uid 27:
+                       references = 27
+                       */
+
+                       $referencesUid = $this->stdWrapValue('references', $conf);
+                       if ($referencesUid) {
+                               $this->addToArray($fileRepository->findFileReferenceByUid($referencesUid), $fileObjects);
+                       }
+
+                               // It's important that this always stays "fieldName" and not be renamed to "field" as it would otherwise collide with the stdWrap key of that name
+                       $referencesFieldName = $this->stdWrapValue('fieldName', $conf['references.']);
+                       if ($referencesFieldName) {
+                               $referencesForeignTable = $this->stdWrapValue('table', $conf['references.'], $this->cObj->getCurrentTable());
+                               $referencesForeignUid = $this->stdWrapValue('uid', $conf['references.'], $this->cObj->data['uid']);
+
+                               $this->addToArray($fileRepository->findByRelation($referencesForeignTable, $referencesFieldName, $referencesForeignUid), $fileObjects);
+                       }
+               }
+
+               if ($conf['files'] || $conf['files.']) {
+                       /*
+                       The TypoScript could look like this:
+                       # with sys_file UIDs:
+                       files = 12,14,15
+
+                       # using stdWrap:
+                       files.field = some_field
+                       */
+
+                       $fileUids = t3lib_div::trimExplode(',', $this->stdWrapValue('files', $conf), TRUE);
+                       foreach ($fileUids as $fileUid) {
+                               $this->addToArray($fileRepository->findByUid($fileUid), $fileObjects);
+                       }
+               }
+
+               if ($conf['collections'] || $conf['collections.']) {
+                       $collectionUids = t3lib_div::trimExplode(',', $this->stdWrapValue('collections', $conf), TRUE);
+
+                       /** @var t3lib_file_Repository_FileCollectionRepository $collectionRepository */
+                       $collectionRepository = t3lib_div::makeInstance('t3lib_file_Repository_FileCollectionRepository');
+
+                       foreach ($collectionUids as $collectionUid) {
+                               $fileCollection = $collectionRepository->findByUid($collectionUid);
+                               if ($fileCollection instanceof t3lib_file_Collection_AbstractFileCollection) {
+                                       $fileCollection->loadContents();
+                                       $this->addToArray($fileCollection->getItems(), $fileObjects);
+                               }
+                       }
+               }
+
+               if ($conf['folders'] || $conf['folders.']) {
+                       $folderIdentifiers = t3lib_div::trimExplode(',', $this->stdWrapValue('folders', $conf));
+
+                       /** @var t3lib_file_Factory $fileFactory */
+                       $fileFactory = t3lib_div::makeInstance('t3lib_file_Factory');
+
+                       foreach ($folderIdentifiers as $folderIdentifier) {
+                               if ($folderIdentifier) {
+                                       $folder = $fileFactory->getFolderObjectFromCombinedIdentifier($folderIdentifier);
+                                       if ($folder instanceof t3lib_file_Folder) {
+                                               $this->addToArray($folder->getFiles(), $fileObjects);
+                                       }
+                               }
+                       }
+               }
+
+                       // Rendering the files
+               $content = '';
+
+                       // optionSplit applied to conf to allow differnt settings per file
+               $splitConf = $GLOBALS['TSFE']->tmpl->splitConfArray($conf, count($fileObjects));
+
+               foreach ($fileObjects as $key => $fileObject) {
+                       $this->cObj->setCurrentFile($fileObject);
+                       $content .= $this->cObj->cObjGetSingle($splitConf[$key]['renderObj'], $splitConf[$key]['renderObj.']);
+               }
+
+               $content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
+
+               return $content;
+       }
+
+       /**
+        * Adds $newItems to $theArray, which is passed by reference. Array must only consist of numerical keys.
+        *
+        * @param mixed $newItems Array with new items or single object that's added.
+        * @param array $theArray The array the new items should be added to. Must only contain numeric keys (for array_merge() to add items instead of replacing).
+        */
+       protected function addToArray($newItems, array &$theArray) {
+               if (is_array($newItems)) {
+                       $theArray = array_merge($theArray, $newItems);
+               } elseif (is_object($newItems)) {
+                       $theArray[] = $newItems;
+               }
+       }
+
+       /**
+        * Gets a configuration value by passing them through stdWrap first and taking a default value if stdWrap doesn't yield a result.
+        *
+        * @param string $key The config variable key (from TS array).
+        * @param array $config  The TypoScript array.
+        * @param string $defaultValue  Optional default value.
+        * @return string Value of the config variable
+        */
+       protected function stdWrapValue($key, array $config, $defaultValue = '') {
+               return $this->cObj->stdWrap($config[$key], $config[$key.'.'])?
+                       $this->cObj->stdWrap($config[$key], $config[$key.'.']):
+                       $defaultValue;
+       }
+}
+
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_files.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/content/class.tslib_content_files.php']);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/cms/tslib/interfaces/interface.tslib_content_fileLinkHook.php b/typo3/sysext/cms/tslib/interfaces/interface.tslib_content_fileLinkHook.php
new file mode 100644 (file)
index 0000000..85b1a6a
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2011 Oliver Hader <oliver@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+/**
+ * Interface for classes which hook into tslib_content and do additional getImgResource processing
+ *
+ * @author Oliver Hader <oliver@typo3.org>
+ * @package TYPO3
+ * @subpackage cms
+ */
+interface tslib_content_fileLinkHook {
+
+       /**
+        * Finds alternative previewImage for given File.
+        *
+        * @abstract
+        * @param t3lib_file_File $file
+        * @return t3lib_file_File
+        */
+       function getPreviewImage(t3lib_file_File $file);
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/cms/tslib/interfaces/interface.tslib_content_getPublicUrlForFileHook.php b/typo3/sysext/cms/tslib/interfaces/interface.tslib_content_getPublicUrlForFileHook.php
new file mode 100644 (file)
index 0000000..2c5732d
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2012 Oliver Hader <oliver.hader@typo3.org>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+
+/**
+ * Interface for hooks to fetch the public URL of files
+ *
+ * @author Oliver Hader <oliver.hader@typo3.org>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+interface tslib_content_getPublicUrlForFileHook {
+
+       /**
+        * Post-processes a public URL.
+        *
+        * @param tslib_cObj $parent The current content object (context)
+        * @param array $configuration TypoScript configuration
+        * @param t3lib_file_File $file The file object to be used
+        * @param string $pubicUrl Reference to the public URL
+        */
+       public function postProcess(tslib_cObj $parent, array $configuration, t3lib_file_File $file, &$pubicUrl);
+}
+?>
\ No newline at end of file
index b378f76..96cb7d3 100755 (executable)
@@ -329,13 +329,19 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase {
                                        // Traverse the files found:
                                $filesData = array();
                                foreach($fileArray as $key => $fileName)        {
-                                       $absPath = t3lib_div::getFileAbsFileName($path.$fileName);
+                                       $absPath = t3lib_div::getFileAbsFileName(t3lib_div::resolveBackPath($path . $fileName));
                                        if (@is_file($absPath)) {
                                                $fI = pathinfo($fileName);
                                                $filesData[$key] = array();
 
+                                               $currentPath = $path;
+                                               if (t3lib_div::isFirstPartOfStr($fileName, '../../')) {
+                                                       $currentPath = '';
+                                                       $fileName = substr($fileName, 6);
+                                               }
+
                                                $filesData[$key]['filename'] = $fileName;
-                                               $filesData[$key]['path'] = $path;
+                                               $filesData[$key]['path'] = $currentPath;
                                                $filesData[$key]['filesize'] = filesize($absPath);
                                                $filesData[$key]['fileextension'] = strtolower($fI['extension']);
                                                $filesData[$key]['description'] = trim($descriptions[$key]);
@@ -349,8 +355,8 @@ class tx_cssstyledcontent_pi1 extends tslib_pibase {
                                                }
                                                $conf['linkProc.']['altText'] = $conf['linkProc.']['iconCObject.']['altText'] = $altText;
 
-                                               $this->cObj->setCurrentVal($path);
-                                               $GLOBALS['TSFE']->register['ICON_REL_PATH'] = $path.$fileName;
+                                               $this->cObj->setCurrentVal($currentPath);
+                                               $GLOBALS['TSFE']->register['ICON_REL_PATH'] = $currentPath . $fileName;
                                                $GLOBALS['TSFE']->register['filename'] = $filesData[$key]['filename'];
                                                $GLOBALS['TSFE']->register['path'] = $filesData[$key]['path'];
                                                $GLOBALS['TSFE']->register['fileSize'] = $filesData[$key]['filesize'];
index e4a5e5e..d903ea6 100644 (file)
@@ -1169,6 +1169,156 @@ tt_content.bullets {
 }
 
 
+# *****************
+# CType: uploads
+# *****************
+tt_content.uploads = COA
+tt_content.uploads {
+       10 = < lib.stdheader
+
+       20 = FILES
+       20 {
+               # get from file references:
+               references {
+                       table = tt_content
+                       uid.field = uid
+                       fieldName = media
+               }
+
+               collections.field = file_collections
+
+               # get from path (backwards compatibility, contains strings like "fileadmin/user_uploads/")
+               folders.field = select_key
+
+               # render the files
+               renderObj = COA
+               renderObj {
+                       10 = IMAGE
+                       10 {
+                               file.import.data = file:current:originalUid // file:current:uid
+                               file.width = 150
+                               stdWrap {
+                                       if.value = 1
+                                       if.isGreaterThan.field = layout
+
+                                       typolink {
+                                               parameter.data = file:current:originalUid // file:current:uid
+                                               parameter.wrap = file:|
+                                               target < lib.parseTarget
+                                               target =
+                                               target.override = {$styles.content.uploads.target}
+                                               removePrependedNumbers = 1
+
+                                               /*
+                                               jumpurl = {$styles.content.uploads.jumpurl}
+                                               jumpurl {
+                                                       secure = {$styles.content.uploads.jumpurl_secure}
+                                                       secure.mimeTypes = {$styles.content.uploads.jumpurl_secure_mimeTypes}
+                                               }
+                                               */
+                                       }
+                               }
+                       }
+
+                       # icon
+                       15 = IMAGE
+                       15 {
+                               file.import = EXT:cms/tslib/media/fileicons/
+                               file.import.data = file:current:extension
+                               file.import.case = lower
+                               file.import.wrap = |.gif
+                               stdWrap {
+                                       if {
+                                               value = 0
+                                               isGreaterThan.field = layout
+
+                                               # only show the icon if we don't have a thumbnail:
+                                               isFalse.cObject = IMG_RESOURCE
+                                               isFalse.cObject.file < tt_content.uploads.20.renderObj.10.file
+                                               isFalse.cObject.stdWrap.if < tt_content.uploads.20.renderObj.10.stdWrap.if
+                                       }
+
+                                       typolink < tt_content.uploads.20.renderObj.10.stdWrap.typolink
+                               }
+                       }
+
+                       # filename
+                       20 = TEXT
+                       20 {
+                               data = file:current:name
+                               htmlSpecialChars = 1
+                               required = 1
+
+                               replacement {
+                                       # equivalent to former useSpacesInLinkText = 0; remove using > to disable it
+                                       10 {
+                                               search = _
+                                               replace.char = 32
+                                       }
+
+                                       # equivalent to former stripFileExtensionFromLinkText = 0; move "_20" to "20" to enable it. Disabled by default.
+                                       _20 {
+                                               search = /(.*)(\..*)/
+                                               replace = \1
+                                               useRegExp = 1
+                                       }
+                               }
+
+                               typolink < tt_content.uploads.20.renderObj.10.stdWrap.typolink
+
+                               wrap = <span class="csc-uploads-fileName">|</span>
+                       }
+
+                       # description
+                       30 = TEXT
+                       30 {
+                               data = file:current:description
+                               htmlSpecialChars = 1
+                               wrap = <span class="csc-uploads-description">|</span>
+
+                               required = 1
+                       }
+
+                       # file size
+                       40 = TEXT
+                       40 {
+                               if.isTrue.field = filelink_size
+                               data = file:current:size
+                               wrap = <span class="csc-uploads-fileSize">|</span>
+                               bytes = 1
+                               bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
+                       }
+
+                       # wrap of each listed file with odd/even class
+                       wrap.cObject = COA
+                       wrap.cObject {
+                               10 = LOAD_REGISTER
+                               10 {
+                                       oddEvenClass = li-odd li-first |*| li-even || li-odd
+                                       elementClass = csc-uploads-element csc-uploads-element-{register:fileExtension}
+                                       elementClass.insertData = 1
+                               }
+
+                               20 = TEXT
+                               20 {
+                                       value = <li class="{register:oddEvenClass} {register:elementClass}">|</li>
+                                       insertData = 1
+                               }
+                               30 = RESTORE_REGISTER
+                       }
+               }
+
+               # wrap around whole content element with <ul> and editIcons
+               stdWrap {
+                       editIcons = tt_content: media, layout [table_bgColor|table_border|table_cellspacing|table_cellpadding], filelink_size
+                       editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.filelist
+                       prefixComment = 2 | File list:
+                       dataWrap = <ul class="csc-uploads csc-uploads-{field:layout}">|</ul>
+               }
+       }
+}
+
+
 
 # *****************
 # CType: table
@@ -1225,110 +1375,6 @@ tt_content.table {
        }
 }
 
-
-# *****************
-# CType: uploads
-# *****************
-# Rendered by a PHP function specifically written to handle CE filelists. See css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
-tt_content.uploads = COA
-tt_content.uploads {
-       10 = < lib.stdheader
-
-       20 = USER
-       20 {
-               userFunc = tx_cssstyledcontent_pi1->render_uploads
-               field = media
-               filePath.field = select_key
-
-               outerWrap = <ul class="csc-uploads csc-uploads-{field:layout}">|</ul>
-               outerWrap {
-                       insertData = 1
-               }
-
-               labelStdWrap.wrap = <span class="csc-uploads-fileName">|</span>
-
-               # Rendering for each file (e.g. rows of the table) as a cObject
-               itemRendering = COA
-               itemRendering {
-                       wrap.cObject = COA
-                       wrap.cObject {
-                               10 = LOAD_REGISTER
-                               10 {
-                                       oddEvenClass = li-odd li-first |*| li-even || li-odd
-                                       elementClass = csc-uploads-element csc-uploads-element-{register:fileExtension}
-                                       elementClass.insertData = 1
-                               }
-                               20 = TEXT
-                               20 {
-                                       value = <li class="{register:oddEvenClass} {register:elementClass}">|</li>
-                                       insertData = 1
-                               }
-                               30 = RESTORE_REGISTER
-                       }
-
-                       10 = TEXT
-                       10 {
-                               data = register:linkedIcon
-                       }
-
-                       20 = TEXT
-                       20 {
-                               data = register:description
-                               htmlSpecialChars = 1
-                               wrap = <span class="csc-uploads-description">|</span>
-                               required = 1
-                       }
-
-                       30 = TEXT
-                       30 {
-                               if.isTrue.field = filelink_size
-                               data = register:fileSize
-                               wrap = <span class="csc-uploads-fileSize">|</span>
-                               bytes = 1
-                               bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
-                       }
-               }
-               useSpacesInLinkText = 0
-               stripFileExtensionFromLinkText = 0
-
-               linkProc {
-                       combinedLink = 1
-
-                       target < lib.parseTarget
-                       target =
-                       target.override = {$styles.content.uploads.target}
-
-                       title.htmlSpecialChars = 1
-
-                       jumpurl = {$styles.content.uploads.jumpurl}
-                       jumpurl {
-                               secure = {$styles.content.uploads.jumpurl_secure}
-                               secure.mimeTypes = {$styles.content.uploads.jumpurl_secure_mimeTypes}
-                       }
-
-                       removePrependedNumbers = 1
-
-                       iconCObject = IMAGE
-                       iconCObject {
-                               file {
-                                       import.data = register : ICON_REL_PATH
-                                       width = 150
-                               }
-                       }
-               }
-               filesize {
-                       bytes = 1
-                       bytes.labels = {$styles.content.uploads.filesizeBytesLabels}
-               }
-               stdWrap {
-                       editIcons = tt_content: media, layout [table_bgColor|table_border|table_cellspacing|table_cellpadding], filelink_size, imagecaption
-                       editIcons.iconTitle.data = LLL:EXT:css_styled_content/pi1/locallang.xml:eIcon.filelist
-
-                       prefixComment = 2 | File list:
-               }
-       }
-}
-
 # ******************
 # CType: multimedia
 # ******************