@@ -67,7 +67,6 @@ public function initializeAction(): void
6767 } else {
6868 throw new \InvalidArgumentException ('Your t3sb_package is not loaded! ' , 1657464787 );
6969 }
70-
7170 }
7271
7372
@@ -269,19 +268,19 @@ protected function deleteFilesFromDirectory(string $directory): void
269268 /**
270269 * Write data from DB to constant file and import in sys_template
271270 */
272- protected function writeConstants (): void
271+ protected function writeConstants (Config $ currentConfig ): void
273272 {
274273 $ this ->persistenceManager ->persistAll ();
275274 if ($ this ->countRootTemplates ) {
276- $ configRepository = $ this ->configRepository ->findOneBy (['pid ' => $ this ->rootPageId ]);
277- $ navbarBreakpoint = $ configRepository ->getNavbarBreakpoint ();
278- if (!empty ($ this ->settings ['breakpoint ' ])) {
275+ $ navbarBreakpoint = $ currentConfig ->getNavbarBreakpoint ();
276+ if (!empty ($ this ->settings ['breakpoint ' ]) && !empty ($ navbarBreakpoint )) {
279277 $ breakpointWidth = $ navbarBreakpoint === 'no ' ? '' : $ this ->settings ['breakpoint ' ][$ navbarBreakpoint ];
280278 } else {
281279 $ breakpointWidth = 'sm ' ;
282280 }
283281 $ siteroots = [];
284282 $ filecontent = '' ;
283+
285284 foreach ($ this ->configRepository ->findAll () as $ config ) {
286285 $ page = GeneralUtility::makeInstance (PageRepository::class)->getPage ($ config ->getPid ());
287286 if (!empty ($ page ['uid ' ]) && $ page ['hidden ' ] === 0 && $ page ['deleted ' ] === 0 ) {
@@ -395,8 +394,14 @@ protected function getConstants(Config $config, bool $isRoot): string
395394 if ($ isRoot ) {
396395 $ constants .= 'bootstrap.config. ' .$ var .' = ' .$ value .PHP_EOL ;
397396 } else {
398- if ($ config ->$ getField () != $ this ->rootConfig ->$ getField ()) {
399- $ constants .= 'bootstrap.config. ' .$ var .' = ' .$ value .PHP_EOL ;
397+
398+ if ($ getField == 'getHomepageuid ' ) {
399+ $ getField = 'getHomepageUid ' ;
400+ }
401+ if (!empty ($ this ->rootConfig )) {
402+ if ($ config ->$ getField () != $ this ->rootConfig ->$ getField ()) {
403+ $ constants .= 'bootstrap.config. ' .$ var .' = ' .$ value .PHP_EOL ;
404+ }
400405 }
401406 }
402407 }
@@ -485,23 +490,32 @@ protected function getUtilityColors(): array
485490 }
486491
487492 if (empty ($ this ->settings ['sitepackage ' ])) {
488- $ variablesSCSS = 'fileadmin/T3SB/Resources/Public/Contrib/Bootstrap/scss/_variables .scss ' ;
493+ $ variablesSCSS = 'fileadmin/T3SB/Resources/Public/T3SB-SCSS/custom-variables .scss ' ;
489494 } else {
490- $ variablesSCSS = 'EXT:t3sb_package/Resources/Public/Contrib/Bootstrap/scss/_variables .scss ' ;
495+ $ variablesSCSS = 'EXT:t3sb_package/Resources/Public/T3SB-SCSS/custom-variables .scss ' ;
491496 }
492497
493498 $ variablesSCSS = GeneralUtility::getFileAbsFileName ($ variablesSCSS );
494499 $ variablesSCSS = GeneralUtility::getURL ($ variablesSCSS );
500+ $ defaultUtilColors = [];
501+ $ varUtilColors = [];
495502
496503 if (!empty ($ variablesSCSS )) {
497504 foreach (GeneralUtility::trimExplode ('; ' , $ variablesSCSS ) as $ defaultVariables ) {
498- $ defaultScssColor = GeneralUtility::trimExplode (': ' , $ defaultVariables );
499- if (str_starts_with ((string )$ defaultVariables , '$ ' ) && GeneralUtility::inList ($ defaultUtilColorsList , $ defaultScssColor [0 ])
500- && (str_starts_with ((string )$ defaultScssColor [1 ], '$ ' ) || str_starts_with ((string )$ defaultScssColor [1 ], '# ' ))) {
501- $ scsscolor = GeneralUtility::trimExplode (': ' , $ defaultVariables );
502- $ defaultUtilColors [$ scsscolor [0 ]] = substr ($ scsscolor [1 ], 0 , -9 );
505+ $ scssColorArr = GeneralUtility::trimExplode (': ' , $ defaultVariables );
506+ if (!empty ($ scssColorArr [0 ]) && str_starts_with ((string )$ scssColorArr [0 ], '$ ' ) && !empty ($ scssColorArr [1 ]) && (str_starts_with ((string )$ scssColorArr [1 ], '# ' ))) {
507+ if (!empty ($ scssColorArr [1 ])) {
508+ $ defaultUtilColors [$ scssColorArr [0 ]] = $ scssColorArr [1 ];
509+ }
510+ } elseif (!empty ($ scssColorArr [1 ]) && str_starts_with ((string )$ scssColorArr [1 ], '$ ' ) && !empty ($ scssColorArr [0 ]) && GeneralUtility::inList ($ defaultUtilColorsList , $ scssColorArr [0 ])) {
511+ if (!empty ($ defaultUtilColors [$ scssColorArr [1 ]])) {
512+ $ varUtilColors [$ scssColorArr [0 ]] = $ defaultUtilColors [$ scssColorArr [1 ]];
513+ }
503514 }
504515 }
516+
517+ $ defaultUtilColors = array_merge ($ defaultUtilColors , $ varUtilColors );
518+
505519 foreach ($ defaultUtilColors as $ key =>$ customvariables ) {
506520 if (str_starts_with ((string )$ customvariables , '$ ' )) {
507521 if (!empty ($ customScssArr [$ customvariables ]) && $ customScssArr [$ customvariables ]) {
@@ -582,6 +596,7 @@ protected function setDefaults(Config $newConfig): Config
582596 $ newConfig ->setNavbarLangFlags (1 );
583597 $ newConfig ->setSectionmenuScrollspyThreshold ('0.1, 0.5, 1 ' );
584598 $ newConfig ->setSectionmenuScrollspyRootMargin ('0px 0px -75% ' );
599+ $ newConfig ->setJumbotronBgimageratio ('37:9 ' );
585600
586601 return $ newConfig ;
587602 }
0 commit comments