Commit 77d988e1 authored by Benni Mack's avatar Benni Mack Committed by Morton Jonuschat
Browse files

[BUGFIX] Re-implement GFX[thumbnails] for Backend

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's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarDaniel Goerz <ervaude@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: default avatarMorton Jonuschat <m.jonuschat@mojocode.de>
parent 828d107c
......@@ -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));
......
......@@ -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',
......
......@@ -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"'),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment