From 8f73305daf6f8760ef433dc2843bcf425f9e0e49 Mon Sep 17 00:00:00 2001 From: Kay Strobach Date: Wed, 8 Jul 2015 18:02:32 +0200 Subject: [PATCH 1/2] [FEATURE] compile less dynamically for rte Fixes #1 --- Classes/XClass/RteHtmlAreaBase.php | 19 +++++++++++++++++++ ext_conf_template.txt | 5 ++++- ext_localconf.php | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Classes/XClass/RteHtmlAreaBase.php diff --git a/Classes/XClass/RteHtmlAreaBase.php b/Classes/XClass/RteHtmlAreaBase.php new file mode 100644 index 0000000..9f32cc4 --- /dev/null +++ b/Classes/XClass/RteHtmlAreaBase.php @@ -0,0 +1,19 @@ +thisConfig['contentCSS'] = parent::getContentCssFileName(); + + $this->thisConfig['contentCSS'] = substr(\KayStrobach\Dyncss\Service\DyncssService::getCompiledFile($this->thisConfig['contentCSS']), 3); + + return parent::getContentCssFileName(); + } +} \ No newline at end of file diff --git a/ext_conf_template.txt b/ext_conf_template.txt index c1f41bf..192f723 100644 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -2,4 +2,7 @@ state = # cat=basic; type=boolean; label= Enable Debugmode (e.g. for firesass or similar), if the used parser is able to do that -enableDebugMode = \ No newline at end of file +enableDebugMode = + +# cat=basic; type=boolean; label= Enable xclass for parsing RTE.default.contentCSS +enableRteXclass = 1 \ No newline at end of file diff --git a/ext_localconf.php b/ext_localconf.php index 057f247..edaa64c 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -40,3 +40,11 @@ // clear cache item $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'KayStrobach\Dyncss\Hooks\T3libTcemainHook->clearCachePostProc'; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'][] = 'KayStrobach\Dyncss\Hooks\Backend\Toolbar\ClearCacheActionsHook'; + +// pagets rte xclass parsing RTE.default.contentCSS + $dynCssConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['dyncss']); + if($dynCssConfig['enableRteXclass']) { + $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase'] = array( + 'className' => 'KayStrobach\Dyncss\XClass\RteHtmlAreaBase', + ); + } From 5a18064c2e937d837c04051329879fa962566dcb Mon Sep 17 00:00:00 2001 From: Kay Strobach Date: Tue, 4 Aug 2015 18:13:17 +0200 Subject: [PATCH 2/2] [TASK] clear cache only if explizit --- Classes/Hooks/T3libTcemainHook.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/Classes/Hooks/T3libTcemainHook.php b/Classes/Hooks/T3libTcemainHook.php index edc5b6f..4a0a784 100644 --- a/Classes/Hooks/T3libTcemainHook.php +++ b/Classes/Hooks/T3libTcemainHook.php @@ -20,8 +20,6 @@ function clearCachePostProc($params, &$pObj) { return; } switch($params['cacheCmd']) { - case 'pages': - case 'all': case 'dyncss': GeneralUtility::rmdir( PATH_site . 'typo3temp/Cache/Data/DynCss',