Index: t3lib/class.t3lib_tstemplate.php =================================================================== --- t3lib/class.t3lib_tstemplate.php (revision 9323) +++ t3lib/class.t3lib_tstemplate.php (working copy) @@ -661,6 +661,13 @@ * @see processTemplate() */ function includeStaticTypoScriptSources($idList,$templateID,$pid,$row) { + + // Mode "Include before static and static from extensions if Root-flag is set" (3) + if ($row['static_file_mode'] == 3 && t3lib_div::isFirstPartOfStr($templateID, 'sys_') && $row['root']) { + $this->addExtensionStatics($idList, $templateID, $pid, $row); + } + + // Static Template Records (static_template): include_static is a list of static templates to include // Call function for link rendering: if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSources'])) { @@ -704,7 +711,10 @@ } } - $this->addExtensionStatics($idList,$templateID,$pid,$row); + // Mode "Always include before this template record" (1) or "Default (Include before if Root-flag is set)" (0) + if ($row['static_file_mode'] == 1 || ($row['static_file_mode'] == 0 && t3lib_div::isFirstPartOfStr($templateID, 'sys_') && $row['root'])) { + $this->addExtensionStatics($idList, $templateID, $pid, $row); + } // Include Static Template Records after all other TypoScript has been included. if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tstemplate.php']['includeStaticTypoScriptSourcesAtEnd'])) { @@ -734,7 +744,6 @@ function addExtensionStatics($idList,$templateID,$pid,$row) { global $TYPO3_LOADED_EXT; - if ($row['static_file_mode']==1 || ($row['static_file_mode']==0 && substr($templateID,0,4)=='sys_' && $row['root'])) { foreach ($TYPO3_LOADED_EXT as $extKey => $files) { if (is_array($files) && ($files['ext_typoscript_constants.txt'] || $files['ext_typoscript_setup.txt'] || $files['ext_typoscript_editorcfg.txt'])) { $mExtKey = str_replace('_','',$extKey); @@ -750,7 +759,6 @@ $this->processTemplate($subrow,$idList.',ext_'.$mExtKey,$pid, 'ext_'.$mExtKey,$templateID); } } - } } /** Index: typo3/sysext/cms/locallang_tca.xml =================================================================== --- typo3/sysext/cms/locallang_tca.xml (revision 9323) +++ typo3/sysext/cms/locallang_tca.xml (working copy) @@ -195,6 +195,7 @@ + Index: typo3/sysext/cms/tbl_cms.php =================================================================== --- typo3/sysext/cms/tbl_cms.php (revision 9323) +++ typo3/sysext/cms/tbl_cms.php (working copy) @@ -971,6 +971,7 @@ array('LLL:EXT:cms/locallang_tca.xml:sys_template.static_file_mode.0', '0'), array('LLL:EXT:cms/locallang_tca.xml:sys_template.static_file_mode.1', '1'), array('LLL:EXT:cms/locallang_tca.xml:sys_template.static_file_mode.2', '2'), + array('LLL:EXT:cms/locallang_tca.xml:sys_template.static_file_mode.3', '3'), ), 'default' => '0' )