Last active
August 29, 2015 14:06
-
-
Save kaystrobach/deec41d7da688c8758ba to your computer and use it in GitHub Desktop.
iconOverlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* register hook for icon overlay | |
*/ | |
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideIconOverlay'][] | |
= 'KayStrobach\\Themes\\Hook\\IconUtilityHook'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* add themes overlay | |
*/ | |
array_push($GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayPriorities'], 'themefound'); | |
$GLOBALS['TBE_STYLES']['spriteIconApi']['spriteIconRecordOverlayNames']['themefound'] = 'extensions-themes-overlay-theme'; | |
/** | |
* add sprites | |
*/ | |
\TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons( | |
array( | |
'switch-off' => ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/power_orange.png', | |
'switch-disable' => ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/power_grey.png', | |
'switch-on' => ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/power_green.png', | |
'overlay-theme' => ExtensionManagementUtility::extRelPath($_EXTKEY) . 'Resources/Public/Icons/overlay_theme.png', | |
), | |
$_EXTKEY | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace KayStrobach\Themes\Hook; | |
use KayStrobach\Themes\Utilities\CheckPageUtility; | |
/** | |
* Class PageNotFoundHandlingHook | |
* | |
* @package KayStrobach\Themes\Hook | |
*/ | |
class IconUtilityHook { | |
/** | |
* adds the overlay icon to a page with a theme set | |
* | |
* @param $table | |
* @param $row | |
* @param $status | |
* @return void | |
*/ | |
public function overrideIconOverlay($table, &$row, &$status) { | |
if ($table === 'pages') { | |
if (CheckPageUtility::hasTheme($row['uid']) > 0) { | |
$status['themefound'] = TRUE; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment