[FOLLOWUP][FEATURE] Allow Backend Logo to be set via extConf 42/47042/5
authorBjörn Jacob <bjoern.jacob@tritum.de>
Fri, 4 Mar 2016 13:30:59 +0000 (14:30 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 4 Mar 2016 13:40:31 +0000 (14:40 +0100)
The new PHP 7 syntax introduced also returns an empty
string, if set but empty.

Resolves: #74109
Releases: master
Change-Id: If902ea201cb49578ab2109b40de90c37dcb63b5d
Reviewed-on: https://review.typo3.org/47042
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Private/Language/locallang.xlf

index 3da55f1..8804edb 100644 (file)
@@ -264,8 +264,17 @@ class BackendController
 
         // Extension Configuration to find the TYPO3 logo in the left corner
         $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['backend']);
-        $logoPath = $extConf['backendLogo'] ?? 'EXT:backend/Resources/Public/Images/typo3-topbar@2x.png';
-        $logoPath = GeneralUtility::getFileAbsFileName($logoPath);
+        $logoPath = '';
+        if (!empty($extConf['backendLogo'])) {
+            $customBackendLogo = GeneralUtility::getFileAbsFileName($extConf['backendLogo']);
+            if (!empty($customBackendLogo)) {
+                $logoPath = $customBackendLogo;
+            }
+        }
+        // if no custom logo was set or the path is invalid, use the original one
+        if (empty($logoPath)) {
+            $logoPath = GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Public/Images/typo3-topbar@2x.png');
+        }
         list($logoWidth, $logoHeight) = @getimagesize($logoPath);
 
         // High-resolution?
index 33cb0bc..ef6538a 100644 (file)
@@ -29,7 +29,7 @@ Have a nice day.</source>
                                <source>Background Image: If set, this image will be used as background image for the login screen for screen sizes greater than 767 pixel (e.g. fileadmin/images/my-background.jpg or EXT:my_theme/Resources/Public/Images/my-background.jpg or //domain.tld/my-background.png)</source>
                        </trans-unit>
                        <trans-unit id="config.backendLogo">
-                               <source>Logo: If set, this logo will be used instead of the TYPO3 logo in the TYPO3 Backend in the left top corner (e.g. fileadmin/images/backend-logo.png or EXT:my_theme/Resources/Public/Images/backend-logo.png or //domain.tld/login-logo.png)</source>
+                               <source>Logo: If set, this logo will be used instead of the TYPO3 logo in the TYPO3 Backend in the left top corner (e.g. fileadmin/images/backend-logo.png or EXT:my_theme/Resources/Public/Images/backend-logo.png</source>
                        </trans-unit>
                        <trans-unit id="foldertreeview.noFolders.title">
                                <source>No folders available</source>