[FEATURE] Allow Backend Logo to be set via extConf 26/47026/4
authorBenni Mack <benni@typo3.org>
Thu, 3 Mar 2016 21:05:03 +0000 (22:05 +0100)
committerBenni Mack <benni@typo3.org>
Fri, 4 Mar 2016 09:20:14 +0000 (10:20 +0100)
The Backend Logo can now be configured via extConf
and the Extension Manager.

The $GLOBALS[TBE_STYLES][logo] option has no effect
anymore.

Resolves: #74109
Releases: master
Change-Id: Id1c1975395b9163a0efbb0cf4dc9f402df2fcc3c
Reviewed-on: https://review.typo3.org/47026
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Private/Language/locallang.xlf
typo3/sysext/backend/ext_conf_template.txt
typo3/sysext/core/Documentation/Changelog/master/Feature-74109-SetTheAlternativeBackendLogoViaExtensionManager.rst [new file with mode: 0644]

index 8530543..3da55f1 100644 (file)
@@ -262,18 +262,19 @@ class BackendController
         // Prepare the scaffolding, at this point extension may still add javascript and css
         $view = $this->getFluidTemplateObject($this->templatePath . 'Backend/Main.html');
 
-        // Render the TYPO3 logo in the left corner
-        $logoUrl = $GLOBALS['TBE_STYLES']['logo'] ?: ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/Images/typo3-topbar@2x.png';
-        $logoPath = GeneralUtility::resolveBackPath(PATH_typo3 . $logoUrl);
+        // 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);
         list($logoWidth, $logoHeight) = @getimagesize($logoPath);
 
         // High-resolution?
-        if (strpos($logoUrl, '@2x.') !== false) {
+        if (strpos($logoPath, '@2x.') !== false) {
             $logoWidth = $logoWidth/2;
             $logoHeight = $logoHeight/2;
         }
 
-        $view->assign('logoUrl', $logoUrl);
+        $view->assign('logoUrl', PathUtility::getAbsoluteWebPath($logoPath));
         $view->assign('logoWidth', $logoWidth);
         $view->assign('logoHeight', $logoHeight);
         $view->assign('logoLink', TYPO3_URL_GENERAL);
index 8f3c7d2..33cb0bc 100644 (file)
@@ -28,6 +28,9 @@ Have a nice day.</source>
                        <trans-unit id="config.loginBackgroundImage">
                                <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>
+                       </trans-unit>
                        <trans-unit id="foldertreeview.noFolders.title">
                                <source>No folders available</source>
                        </trans-unit>
index 580e5fb..5ff1483 100644 (file)
@@ -9,4 +9,7 @@ loginLogo =
 loginHighlightColor =
 
 # cat=Login; type=string; label=LLL:EXT:backend/Resources/Private/Language/locallang.xlf:config.loginBackgroundImage
-loginBackgroundImage =
\ No newline at end of file
+loginBackgroundImage =
+
+# cat=Backend; type=string; label=LLL:EXT:backend/Resources/Private/Language/locallang.xlf:config.backendLogo
+backendLogo =
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-74109-SetTheAlternativeBackendLogoViaExtensionManager.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-74109-SetTheAlternativeBackendLogoViaExtensionManager.rst
new file mode 100644 (file)
index 0000000..6ce1b16
--- /dev/null
@@ -0,0 +1,17 @@
+========================================================================
+Feature: #74109 - Set the alternative Backend Logo via Extension Manager
+========================================================================
+
+Description
+===========
+
+The Backend Logo in the upper left corner can now be configured in the Extension Configuration of EXT:backend
+within the Extension Manager. A relative path to the TYPO3 installation ("PATH_site"), e.g. "fileadmin/myfile.jpg"
+or a path to an extension, e.g. "EXT:my_theme/Resources/Public/Icons/Logo.png" can be configured there.
+
+The configuration option within the Backend extension (EXT:backend) is called ``backendLogo``.
+
+Impact
+======
+
+The previously available ``$GLOBALS[TBE_STYLES][logo]`` option has no effect anymore.
\ No newline at end of file