[FEATURE] Introduce $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] 45/43045/3
authorFrans Saris <franssaris@gmail.com>
Thu, 2 Apr 2015 18:14:39 +0000 (20:14 +0200)
committerPhilipp Gampe <philipp.gampe@typo3.org>
Sat, 5 Sep 2015 20:24:10 +0000 (22:24 +0200)
Releases: master
Resolves: #69543
Change-Id: I676a20fd64a13e6f04774fe2fa838c5b51d6eaf0
Reviewed-on: http://review.typo3.org/43045
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Tested-by: Philipp Gampe <philipp.gampe@typo3.org>
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Documentation/Changelog/master/Feature-69543-IntroducedGLOBALSTYPO3_CONF_VARSSYSmediafile_ext.rst [new file with mode: 0644]

index 32c542d..06ff2e2 100644 (file)
@@ -86,6 +86,7 @@ return array(
                 */
                'curlTimeout' => 0,                                             // Integer: Timeout value for cURL requests in seconds. 0 means to wait indefinitely. Deprecated since 4.6 - will be removed in 6.2. See below for http options.
                'textfile_ext' => 'txt,ts,html,htm,css,tmpl,js,sql,xml,csv,xlf',                // Text file extensions. Those that can be edited. Executable PHP files may not be editable in webspace if disallowed!
+               'mediafile_ext' => 'gif,jpg,jpeg,bmp,png,pdf,svg,ai,mov,avi',// Commalist of file extensions perceived as media files by TYPO3. Lowercase and no spaces between!
                'binPath' => '',                                                // String: List of absolute paths where external programs should be searched for. Eg. <code>/usr/local/webbin/,/home/xyz/bin/</code>. (ImageMagick path have to be configured separately)
                'binSetup' => '',                                               // String (textarea): List of programs (separated by newline or comma). By default programs will be searched in default paths and the special paths defined by 'binPath'. When PHP has openbasedir enabled the programs can not be found and have to be configured here. Example: <code>perl=/usr/bin/perl,unzip=/usr/local/bin/unzip</code>
                't3lib_cs_convMethod' => '',                    // String (values: "iconv", "recode", "mbstring", default is homemade PHP-code). Defines which of these PHP-features to use for various charset conversion functions in \TYPO3\CMS\Core\Charset\CharsetConverter. Will speed up charset conversion radically.
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-69543-IntroducedGLOBALSTYPO3_CONF_VARSSYSmediafile_ext.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-69543-IntroducedGLOBALSTYPO3_CONF_VARSSYSmediafile_ext.rst
new file mode 100644 (file)
index 0000000..5e1cb27
--- /dev/null
@@ -0,0 +1,70 @@
+================================================================================
+Feature: #69543 - Introduced $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']
+================================================================================
+
+Description
+===========
+
+Now we got the ``RendererRegistry`` with the ``VideoTagRenderer``, ``AudioTagRenderer`` and ``MediaViewHelper`` in the
+core we needed also a way to define a list of file extensions of the files that can be handled by these. This list
+can then be used in the TCA for allowing sys_file_references to these files.
+
+.. code-block:: php
+
+       // Comma list of file extensions perceived as media files by TYPO3.
+       // Lowercase and no spaces between
+       $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] = 'gif,jpg,jpeg,bmp,png,pdf,svg,ai,mov,avi';
+
+
+TCA example:
+------------
+
+.. code-block:: php
+
+       'media' => array(
+               'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.media',
+               'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('media', array(
+                       'foreign_types' => array(
+                               '0' => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               ),
+                               \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               ),
+                               \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               ),
+                               \TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               ),
+                               \TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               ),
+                               \TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => array(
+                                       'showitem' => '
+                                               --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
+                                               --palette--;;filePalette'
+                               )
+                       )
+               ), $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'])
+       ),
+
+
+Extending this list:
+--------------------
+
+If you want to extend this list you can add the desired extension name to list in the ``ext_localconf.php`` of your extension.
+
+.. code-block:: php
+
+       $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] .= ',myext';
\ No newline at end of file