[BUGFIX] Re-implement GFX[thumbnails] for Backend 38/45138/2
authorBenni Mack <benni@typo3.org>
Sat, 5 Dec 2015 12:38:59 +0000 (13:38 +0100)
committerMorton Jonuschat <m.jonuschat@mojocode.de>
Sun, 6 Dec 2015 12:18:07 +0000 (13:18 +0100)
The option to disable thumbnails globally for every
backend user in various places does not work anymore,
but is still quite useful. The patch re-introduces the option
to not show the thumbnail in various places.

Resolves: #60497
Releases: master
Change-Id: I28e8bf86563032df8008c7de9aa7861bb5c0e2c0
Reviewed-on: https://review.typo3.org/45138
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/filelist/Classes/Controller/FileListController.php

index 42e3648..59fb5c1 100644 (file)
@@ -309,7 +309,7 @@ class InlineRecordContainer extends AbstractContainer
         $thumbnail = false;
 
         // Renders a thumbnail for the header
-        if (!empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
+        if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && !empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
             $fieldValue = $rec[$inlineConfig['appearance']['headerThumbnail']['field']];
             $firstElement = array_shift(GeneralUtility::trimExplode('|', array_shift(GeneralUtility::trimExplode(',', $fieldValue))));
             $fileUid = array_pop(BackendUtility::splitTable_Uid($firstElement));
index ae3a8c2..f519a4d 100755 (executable)
@@ -1733,7 +1733,7 @@ class BackendUtility
                 }
 
                 // Preview web image or media elements
-                if (GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] . ',' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'], $fileReferenceObject->getExtension())) {
+                if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] . ',' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'], $fileReferenceObject->getExtension())) {
                     $processedImage = $fileObject->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, array(
                                         'width' => $sizeParts[0],
                                         'height' => $sizeParts[1] . 'c',
index 9ffb651..b428d52 100644 (file)
@@ -352,7 +352,7 @@ class FileListController extends ActionController
         if ($this->folderObject) {
             // Create fileListing object
             $this->filelist = GeneralUtility::makeInstance(FileList::class, $this);
-            $this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs'];
+            $this->filelist->thumbs = $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $this->MOD_SETTINGS['displayThumbs'];
             // Create clipboard object and initialize that
             $this->filelist->clipObj = GeneralUtility::makeInstance(Clipboard::class);
             $this->filelist->clipObj->fileMode = 1;
@@ -428,6 +428,7 @@ class FileListController extends ActionController
 
             $this->view->assign('headline', $this->getModuleHeadline());
             $this->view->assign('listHtml', $this->filelist->HTMLcode);
+
             $this->view->assign('checkboxes', [
                 'bigControlPanel' => [
                     'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable',
@@ -436,7 +437,7 @@ class FileListController extends ActionController
                         $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"'),
                 ],
                 'displayThumbs' => [
-                    'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable',
+                    'enabled' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable',
                     'label' => $this->getLanguageService()->getLL('displayThumbs', true),
                     'html' => BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]',
                         $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"'),