Skip to content

Instantly share code, notes, and snippets.

@josefglatz
Last active August 29, 2015 14:12
Show Gist options
  • Save josefglatz/af59afc1f049d6a77e86 to your computer and use it in GitHub Desktop.
Save josefglatz/af59afc1f049d6a77e86 to your computer and use it in GitHub Desktop.
TYPO3CMS 6.2 LTS: Set backend logo depending on TYPO3_CONTEXT
<?php
/***************
* Set backend logo depending on TYPO3_CONTEXT
* supports
* Development
* Testing
* Production/Staging
* Production/Live
*/
if (GeneralUtility::getApplicationContext()->isDevelopment()) {
$GLOBALS['TBE_STYLES']['logo'] = '../typo3conf/ext/' . $_EXTKEY . '/Resources/Public/Backend/Images/typo3-topbar_' . 'development' . '@2x.png';
} elseif (GeneralUtility::getApplicationContext()->isTesting()) {
$GLOBALS['TBE_STYLES']['logo'] = '../typo3conf/ext/' . $_EXTKEY . '/Resources/Public/Backend/Images/typo3-topbar_' . 'testing' . '@2x.png';
} elseif (GeneralUtility::getApplicationContext()->isProduction()
&& GeneralUtility::getApplicationContext()->__toString() === 'Production/Staging') {
$GLOBALS['TBE_STYLES']['logo'] = '../typo3conf/ext/' . $_EXTKEY . '/Resources/Public/Backend/Images/typo3-topbar_' . 'productionstaging' . '@2x.png';
} elseif (GeneralUtility::getApplicationContext()->isProduction()
&& GeneralUtility::getApplicationContext()->__toString() === 'Production/Live') {
$GLOBALS['TBE_STYLES']['logo'] = '../typo3conf/ext/' . $_EXTKEY . '/Resources/Public/Backend/Images/typo3-topbar_' . 'productionlive' . '@2x.png';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment