Skip to content

Commit 6ece0f0

Browse files
authored
Merge pull request #469 from t3solution/5.3.30
See release notes at https://www.t3sbootstrap.de/log
2 parents b5e5b4b + 8e9d6df commit 6ece0f0

File tree

130 files changed

+1830
-655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1830
-655
lines changed

Classes/Command/CdnToLocal.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5555
throw new \InvalidArgumentException('Your t3sb_package is not loaded!', 1657464787);
5656
}
5757
}
58-
5958
if (!empty($settings['cdn']['googlefonts']) && empty($settings['cdn']['noZip'])) {
6059
if (empty($settings['sitepackage'])) {
6160
$this->getGoogleFonts($settings['cdn']['googlefonts'], $settings['gooleFontsWeights'], $baseDir);
@@ -108,28 +107,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
108107
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/'.$version.'/umd/popper.min.js';
109108
$this->writeCustomFile($customPath, $customFileName, $cdnPath);
110109
}
111-
112-
if ($key === 'jqueryEasing') {
113-
$customPath = $baseDir.'Resources/Public/T3SB-JS/';
114-
$customFileName = 'jquery.easing.min.js';
115-
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/'.$version.'/'.$customFileName;
116-
$this->writeCustomFile($customPath, $customFileName, $cdnPath);
117-
}
118-
119110
if ($key === 'lazyload') {
120111
$customPath = $baseDir.'Resources/Public/T3SB-JS/';
121112
$customFileName = 'lazyload.min.js';
122113
$cdnPath = 'https://cdn.jsdelivr.net/npm/vanilla-lazyload@'.$version.'/dist/'.$customFileName;
123114
$this->writeCustomFile($customPath, $customFileName, $cdnPath);
124115
}
125116

126-
if ($key === 'picturefill') {
127-
$customPath = $baseDir.'Resources/Public/T3SB-JS/';
128-
$customFileName = 'picturefill.min.js';
129-
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/picturefill/'.$version.'/'.$customFileName;
130-
$this->writeCustomFile($customPath, $customFileName, $cdnPath);
131-
}
132-
133117
if ($key === 'animate') {
134118
$customPath = $baseDir.'Resources/Public/T3SB-CSS/';
135119
$customFileName = 'animate.compat.css';
@@ -209,7 +193,6 @@ private function writeCustomFile($customPath, $customFileName, $cdnPath, $extend
209193
{
210194
$customFile = $customPath.$customFileName;
211195
$customContent = GeneralUtility::getURL($cdnPath);
212-
213196
if ($extend && str_contains((string)$customContent, '/*#')) {
214197
$customContentArr = explode('/*#', $customContent);
215198
$customContent = $customContentArr[0];

Classes/Command/CustomScss.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
class CustomScss extends CommandBase
2626
{
2727

28+
public const BOOTSTRAPLATEST = '5.3.8';
29+
2830
/**
2931
* Defines the allowed options for this command
3032
*
@@ -64,7 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6466

6567
if ($settings['customScss'] && array_key_exists('customScss', $extConf) && $extConf['customScss'] === '1') {
6668
# get the Boostrap SCSS-Files
67-
$bootstrapVersion = str_starts_with($settings['cdn']['bootstrap'], '5.') ? $settings['cdn']['bootstrap'] : $settings['cdn']['bootstraplatest'];
69+
$bootstrapVersion = str_starts_with($settings['cdn']['bootstrap'], '5.') ? $settings['cdn']['bootstrap'] : self::BOOTSTRAPLATEST;
6870
$bootstrapScssPath = $baseDir.'Resources/Public/Contrib/Bootstrap/scss/';
6971
if (!is_dir($bootstrapScssPath)) {
7072
if (!mkdir($bootstrapScssPath, 0777, true) && !is_dir($bootstrapScssPath)) {
@@ -273,7 +275,7 @@ public function getBootstrapFiles($bootstrapVersion, $baseDir): void
273275
$zip->extractTo($extractTo);
274276
$zip->close();
275277
} else {
276-
throw new \InvalidArgumentException('Sorry ZIP creation failed at this time! Set the constant "bootstrap.cdn.noZip=1" and try again.', 1657464538);
278+
throw new \InvalidArgumentException('Sorry ZIP creation failed at this time! Set the setup "module.tx_t3sbootstrap.settings.cdn.noZip=1" and try again.', 1657464538);
277279
}
278280

279281
$renameFrom = $baseDir.'Resources/Public/Contrib/Bootstrap/bootstrap-'.$bootstrapVersion.'/scss';

Classes/Command/TextToTextmedia.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4040
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
4141
$contentQueryBuilder = $connectionPool->getQueryBuilderForTable('tt_content');
4242
$texts = $contentQueryBuilder
43-
->select('uid',)
43+
->select('uid')
4444
->from('tt_content')
4545
->where(
4646
$contentQueryBuilder->expr()->eq('CType', $contentQueryBuilder->createNamedParameter('text'))

Classes/Components/Button.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
109109
$processedData['slideInButton'] = true;
110110
$processedData['slideInButtonFaIcon'] = true;
111111
if ( empty($processedData['data']['header_icon']) ) {
112-
$processedData['data']['header_icon'] = 'fa6:solid,ban';
112+
$processedData['data']['header_icon'] = 'fa7:solid,ban';
113113
}
114114
}
115115

Classes/Components/Card.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Card implements SingletonInterface
2121
/**
2222
* Returns the $processedData
2323
*/
24-
public function getProcessedData(array $processedData, array $flexconf, array $parentflexconf): array
24+
public function getProcessedData(array $processedData, array $flexconf, array $parentflexconf, bool $minimumWidth): array
2525
{
2626

2727
$cardData = $flexconf;
@@ -205,6 +205,10 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
205205

206206
$processedData['card'] = $cardData;
207207

208+
if (empty($processedData['data']['imagewidth']) && $minimumWidth) {
209+
$processedData['data']['imagewidth'] = 575;
210+
}
211+
208212
if (!empty($processedData['data']['imagewidth']) && !empty($flexconf['maxwidth'])) {
209213
$processedData['style'] .= ' max-width: '.$processedData['data']['imagewidth'].'px;';
210214
}

Classes/Controller/AbstractController.php

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

Classes/Controller/ConfigController.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,9 @@ public function initializeAction(): void
4444
public function listAction(
4545
bool $deleted = false,
4646
bool $created = false,
47-
bool $updateSss = false
47+
bool $updateScss = false
4848
): ResponseInterface
4949
{
50-
$cdnHint = false;
51-
$file = $this->baseDir.'Resources/Public/Contrib/Bootstrap/scss/bootstrap.scss';
52-
if (file_exists($file) && $this->settings['cdn']['enable']) {
53-
$cdnHint = true;
54-
}
55-
5650
$assignedOptions['idNull'] = FALSE;
5751
if ($this->request->getQueryParams()['id'] === '0') {
5852
$assignedOptions['idNull'] = TRUE;
@@ -83,10 +77,9 @@ public function listAction(
8377
$assignedOptions['admin'] = $this->isAdmin;
8478
$assignedOptions['customScss'] = false;
8579
$assignedOptions['action'] = 'list';
86-
$assignedOptions['updateScss'] = $updateSss;
80+
$assignedOptions['updateScss'] = $updateScss;
8781
$assignedOptions['deleted'] = $deleted;
8882
$assignedOptions['created'] = $created;
89-
$assignedOptions['cdnHint'] = $cdnHint;
9083
$assignedOptions['settings'] = $this->settings;
9184

9285
if (!empty($this->settings['customScss']) && (int)$this->settings['customScss'] === 1) {
@@ -176,7 +169,8 @@ public function createAction(Config $newConfig = null): ResponseInterface
176169
$newConfig = parent::setDefaults($newConfig);
177170
$this->configRepository->add($newConfig);
178171
parent::setDefaultBackendLayout();
179-
parent::writeConstants();
172+
parent::writeConstants($newConfig);
173+
180174
return $this->redirect('list', null, null, ['created' => true]);
181175
}
182176

@@ -226,7 +220,7 @@ public function updateAction(Config $config): ResponseInterface
226220
$config->setHomepageUid($this->rootPageId);
227221
$this->configRepository->update($config);
228222
$this->persistenceManager->persistAll();
229-
parent::writeConstants();
223+
parent::writeConstants($config);
230224
if (!empty($this->settings['clearPageCache'])) {
231225
$cacheService = GeneralUtility::makeInstance(CacheService::class);
232226
$cacheService->clearPageCache();
@@ -242,7 +236,7 @@ public function updateAction(Config $config): ResponseInterface
242236
public function deleteAction(Config $config): ResponseInterface
243237
{
244238
$this->configRepository->remove($config);
245-
parent::writeConstants();
239+
parent::writeConstants($config);
246240
return $this->redirect('list', null, null, array('deleted' => true));
247241
}
248242

Classes/DataProcessing/BootstrapProcessor.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function process(
9292
$flexconf = $flexFormService->convertFlexFormContentToArray($processedData['data']['tx_t3sbootstrap_flexform']);
9393
}
9494
$parentflexconf = [];
95-
$parentContainer = [];
95+
9696
$parentUid = $processedData['data']['tx_container_parent'];
9797
$t3sbsElement = false;
9898
if (str_contains(self::T3SBS_ELEMENTS.','.self::TX_CONTAINER_GRID.','.self::TX_CONTAINER, $cType) && $cType !== 'list') {
@@ -111,7 +111,6 @@ public function process(
111111
$parentflexconf = $flexformHelper->addMissingElements($parentflexconf, $parentCType, $t3sbsElement);
112112
}
113113
}
114-
$parentContainer = $parentData['tx_container_parent'];
115114
}
116115

117116
$processedData['parentCType'] = $parentCType;
@@ -201,7 +200,7 @@ public function process(
201200
}
202201
if ($cType === 't3sbs_card') {
203202
$processedData = GeneralUtility::makeInstance(Card::class)
204-
->getProcessedData($processedData, $flexconf, $parentflexconf);
203+
->getProcessedData($processedData, $flexconf, $parentflexconf, (bool)$processorConfiguration['minimumWidth']);
205204
}
206205
if ($cType === 't3sbs_carousel') {
207206
$processedData = GeneralUtility::makeInstance(Carousel::class)

Classes/DataProcessing/ConfigProcessor.php

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ public function process(
6161
} else {
6262
$company = $companyArr[0] ?: $company;
6363
}
64+
$processedData['config']['general']['company'] = !empty($company) ? trim($company) : 'Company Name';
65+
$processedData['config']['general']['homepageUid'] = $processedRecordVariables['homepageUid'] ?: 1;
66+
$processedData['config']['general']['pageTitle'] = $processedRecordVariables['pageTitle'] ?: '';
67+
$processedData['config']['general']['pageTitlealign'] = $processedRecordVariables['pageTitlealign'] ?: '';
68+
$processedData['config']['general']['pageTitleclass'] = $processedRecordVariables['pageTitleclass'] ?: '';
6469

6570
// flexible small columns
6671
$currentPage = $frontendController->page;
@@ -71,13 +76,8 @@ public function process(
7176
? (int)$rootlinePage['tx_t3sbootstrap_smallColumns'] : 3;
7277
$smallColumns = $smallColumnsCurrent ?: $smallColumnsRootline;
7378

74-
$processedData['config']['general']['company'] = !empty($company) ? trim($company) : 'Company Name';
75-
$processedData['config']['general']['homepageUid'] = $processedRecordVariables['homepageUid'] ?: 1;
76-
$processedData['config']['general']['pageTitle'] = $processedRecordVariables['pageTitle'] ?: '';
77-
$processedData['config']['general']['pageTitlealign'] = $processedRecordVariables['pageTitlealign'] ?: '';
78-
$processedData['config']['general']['pageTitleclass'] = $processedRecordVariables['pageTitleclass'] ?: '';
79-
if (ExtensionManagementUtility::isLoaded('indexed_search') && $currentPage['doktype'] == 1) {
80-
$processedData['config']['general']['pageTitleIndexedSearch'] = true;
79+
if (ExtensionManagementUtility::isLoaded('indexed_search') && $currentPage['doktype']) {
80+
$processedData['config']['general']['pageTitleSearch'] = true;
8181
}
8282

8383
// global override page data
@@ -89,7 +89,7 @@ public function process(
8989
$processedData['data'][$field] = $override;
9090
$smallColumns = $override;
9191
} elseif ($field === 'tx_t3sbootstrap_container') {
92-
if (($backendLayout === 'OneCol' || $backendLayout === 'OneCol_Extra') && $processedData['data']['tx_t3sbootstrap_container'] === '0') {
92+
if (($backendLayout === 'OneCol' || $backendLayout === 'OneCol_Extra') && $override === 'none') {
9393
// no override if container = none
9494
} else {
9595
$processedData['data']['tx_t3sbootstrap_container'] = $override;
@@ -522,20 +522,32 @@ public function process(
522522
$processedData['config']['jumbotron']['bgImage'] = $bgSlides;
523523
}
524524
}
525-
526-
if ($hasBgImages && empty($currentPage['tx_t3sbootstrap_fullheightsection']) && !empty($processedRecordVariables['jumbotronBgimageratio'])) {
525+
526+
$jumbotronBgimageratio = $processedRecordVariables['jumbotronBgimageratio'];
527+
$jumbotronBgimageratio = empty($jumbotronBgimageratio) ? '37x9' : $jumbotronBgimageratio;
528+
if ($hasBgImages && empty($currentPage['tx_t3sbootstrap_fullheightsection'])) {
529+
if (str_contains($jumbotronBgimageratio, ':')) {
530+
$jumbotronBgimageratio = str_replace(':', 'x', $jumbotronBgimageratio);
531+
} elseif (str_contains($jumbotronBgimageratio, '/')) {
532+
$jumbotronBgimageratio = str_replace('/', 'x', $jumbotronBgimageratio);
533+
} elseif (str_contains($jumbotronBgimageratio, 'by')) {
534+
$jumbotronBgimageratio = str_replace('by', 'x', $jumbotronBgimageratio);
535+
} elseif (str_contains($jumbotronBgimageratio, 'x')) {
536+
// do nothing
537+
} else {
538+
$jumbotronBgimageratio = '37x9';
539+
}
527540
$processedData['config']['jumbotron']['noBgRatio'] = false;
528-
$processedData['config']['jumbotron']['class'] .= ' ratio ratio-'.$processedRecordVariables['jumbotronBgimageratio'];
529-
$ratioArr = explode('x', $processedRecordVariables['jumbotronBgimageratio']);
530-
$x = $processedRecordVariables['jumbotronBgimageratio'];
541+
$processedData['config']['jumbotron']['class'] .= ' ratio ratio-'.$jumbotronBgimageratio;
542+
$ratioArr = explode('x', $jumbotronBgimageratio);
543+
$x = $jumbotronBgimageratio;
531544
$y = $ratioArr[1].' / '.$ratioArr[0].' * 100%';
532545
$processedData['ratioCalcCss'] = '.ratio-'.$x.'{--bs-aspect-ratio:calc('.$y.');}';
533546
} else {
534547
if ( !empty($processedData['data']['tx_t3sbootstrap_fullheightsection']) ) {
535548
$processedData['config']['jumbotron']['class'] = ' ratio';
536549
}
537550
}
538-
539551
}
540552

541553
/**

Classes/DataProcessing/GalleryProcessor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ protected function calculateMediaWidthsAndHeights()
486486
}
487487

488488

489-
490489
// User entered a predefined width
491490
if ($this->equalMediaWidth) {
492491
$mediaWidth = $this->checkMediaWidth($this->equalMediaWidth);
@@ -901,7 +900,7 @@ protected function getGridWidth($bsGridWidth, $suffix): int
901900
protected function checkMediaWidth($mediaWidth): int
902901
{
903902
#if ($this->minimumWidth && $mediaWidth < self::minimumWidth) {
904-
if ($this->minimumWidth && empty($mediaWidth)) {
903+
if ($this->minimumWidth && empty($this->equalMediaHeight)) {
905904
// set to 575px and therefore 100% wide on mobile (constant: minimumWidth=1)
906905
$mediaWidth = self::minimumWidth;
907906
}

0 commit comments

Comments
 (0)