Skip to content

Commit

Permalink
Merge pull request #348 from t3solution/5.3.1
Browse files Browse the repository at this point in the history
New release v5.3.1
  • Loading branch information
t3solution authored Aug 11, 2023
2 parents 207b116 + af87d92 commit 46864e8
Show file tree
Hide file tree
Showing 93 changed files with 4,047 additions and 2,562 deletions.
23 changes: 15 additions & 8 deletions Classes/Backend/EventListener/TCA/TcaCompilation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['customFaIcons'])) {
$newItems = [];
foreach ( explode(',',$extconf['customFaIcons']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['tt_content']['columns']['tx_t3sbootstrap_header_fontawesome']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -35,7 +36,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['customHeaderClass'])) {
$newItems = [];
foreach ( explode(',',$extconf['customHeaderClass']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['tt_content']['columns']['tx_t3sbootstrap_header_class']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -47,7 +49,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['customFaIconsPages'])) {
$newItems = [];
foreach ( explode(',',$extconf['customFaIconsPages']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['pages']['columns']['tx_t3sbootstrap_fontawesome_icon']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -57,7 +60,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['customTitleColor'])) {
$newItems = [];
foreach ( explode(',',$extconf['customTitleColor']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['pages']['columns']['tx_t3sbootstrap_titlecolor']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -67,7 +71,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['customSubtitleColor'])) {
$newItems = [];
foreach ( explode(',',$extconf['customSubtitleColor']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['pages']['columns']['tx_t3sbootstrap_subtitlecolor']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -79,7 +84,8 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['figureClass'])) {
$newItems = [];
foreach ( explode(',',$extconf['figureClass']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['sys_file_reference']['columns']['tx_t3sbootstrap_extra_class']['config']['valuePicker']['items'] = $newItems;
Expand All @@ -89,11 +95,12 @@ public function __invoke(AfterTcaCompilationEvent $event): void
if (!empty($extconf['imageClass'])) {
$newItems = [];
foreach ( explode(',',$extconf['imageClass']) as $custom) {
$key = trim(end(explode(' ', $custom)));
$customArray = explode(' ', $custom);
$key = trim(end($customArray));
$newItems[] = [0 => $key, 1 => $custom];
}
$tca['sys_file_reference']['columns']['tx_t3sbootstrap_extra_imgclass']['config']['valuePicker']['items'] = $newItems;
}
}

$event->setTca($tca);
}
Expand Down
103 changes: 30 additions & 73 deletions Classes/Backend/FormDataProvider/FlexFormManipulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,73 +29,30 @@ public function addData(array $result): array
# if FlexFormManipulation
if ( !empty($flexforms) && !empty($result['databaseRow']['CType']) ) {

switch ($result['databaseRow']['CType']) {
case 't3sbs_card':
$flexformFile = 'cardSetting.';
break;
case 't3sbs_carousel':
$flexformFile = 'carousel.';
break;
case 't3sbs_button':
$flexformFile = 'button.';
break;
case 't3sbs_mediaobject':
$flexformFile = 'mediaobject.';
break;
case 'table':
$flexformFile = 'table.';
break;
case 'card_wrapper':
$flexformFile = 'cardWrapper.';
break;
case 'autoLayout_row':
$flexformFile = 'autoLayoutRow.';
break;
case 'button_group':
$flexformFile = 'buttongroup.';
break;
case 'container':
$flexformFile = 'container.';
break;
case 'two_columns':
$flexformFile = 'twoColumns.';
break;
case 'three_columns':
$flexformFile = 'threeColumns.';
break;
case 'four_columns':
$flexformFile = 'fourColumns.';
break;
case 'six_columns':
$flexformFile = 'sixColumns.';
break;
case 'background_wrapper':
$flexformFile = 'backgroundWrapper.';
break;
case 'parallax_wrapper':
$flexformFile = 'parallaxWrapper.';
break;
case 'carousel_container':
$flexformFile = 'carouselContainer.';
break;
case 'collapsible_accordion':
$flexformFile = 'collapse.';
break;
case 'collapsible_container':
$flexformFile = 'collapseContainer.';
break;
case 'modal':
$flexformFile = 'modal.';
break;
case 'tabs_container':
$flexformFile = 'tabs.';
break;
case 'tabs_tab':
$flexformFile = 'tabsTab.';
break;
default:
$flexformFile = 'bootstrap.';
}
$flexformFile = match ($result['databaseRow']['CType']) {
't3sbs_card' => 'cardSetting.',
't3sbs_carousel' => 'carousel.',
't3sbs_button' => 'button.',
't3sbs_mediaobject' => 'mediaobject.',
'table' => 'table.',
'card_wrapper' => 'cardWrapper.',
'autoLayout_row' => 'autoLayoutRow.',
'button_group' => 'buttongroup.',
'container' => 'container.',
'two_columns' => 'twoColumns.',
'three_columns' => 'threeColumns.',
'four_columns' => 'fourColumns.',
'six_columns' => 'sixColumns.',
'background_wrapper' => 'backgroundWrapper.',
'parallax_wrapper' => 'parallaxWrapper.',
'carousel_container' => 'carouselContainer.',
'collapsible_accordion' => 'collapse.',
'collapsible_container' => 'collapseContainer.',
'modal' => 'modal.',
'tabs_container' => 'tabs.',
'tabs_tab' => 'tabsTab.',
default => 'bootstrap.',
};

$dataStructure = [];

Expand All @@ -106,7 +63,7 @@ public function addData(array $result): array
$addArr = [];

foreach ($flexforms as $file=>$fields) {
if ( $file == $flexformFile ) {
if ( $file === $flexformFile ) {
foreach ($fields as $field=>$mod) {
if ( !empty($mod['add']) ) {
foreach (explode(',',$mod['add']) as $add) {
Expand All @@ -116,11 +73,11 @@ public function addData(array $result): array
foreach ($fieldArr as $fieldName) {
if (!empty($fieldName) && $fieldName !== 'array' && is_array($fieldName)) {
foreach ($fieldName as $key=>$name) {
if (!empty($name['config']['type']) && $name['config']['type'] == 'select') {
if (substr($field, 0, -1) == $key) {
if (!empty($name['config']['type'])
&& $name['config']['type'] === 'select'
&& substr($field, 0, -1) === $key) {
$addArr = ['label' => trim($add), 'value' => lcfirst(GeneralUtility::underscoredToUpperCamelCase(trim($add)))];
array_push($dataStructure['sheets'][$sheetName]['ROOT']['el'][$key]['config']['items'], $addArr);
}
}
}
}
Expand All @@ -138,10 +95,10 @@ public function addData(array $result): array
foreach ($fieldArr as $fieldName) {
if (!empty($fieldName) && $fieldName !== 'array' && is_array($fieldName)) {
foreach ($fieldName as $key=>$name) {
if (!empty($name['config']['type']) && $name['config']['type'] == 'select') {
if (!empty($name['config']['type']) && $name['config']['type'] === 'select') {
if (substr($field, 0, -1) == $key) {
foreach ($name['config']['items'] as $k=>$item ) {
if (!empty($item['value']) && trim($item['value']) == trim($reduce)) {
if (!empty($item['value']) && trim($item['value']) === trim($reduce)) {
unset($dataStructure['sheets'][$sheetName]['ROOT']['el'][$key]['config']['items'][$k]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Backend/Preview/DefaultPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function renderPageModulePreviewHeader(GridColumnItem $item): string
}
}

if ($record['CType'] == 't3sbs_gallery') {
if ($record['CType'] === 't3sbs_gallery') {
$flexconfSettings .= 'columns='.$record['imagecols'].', ';
if ( !empty($record['tx_t3sbootstrap_image_ratio'])) {
$flexconfSettings .= 'ratio='.$record['tx_t3sbootstrap_image_ratio'].', ';
Expand All @@ -114,7 +114,7 @@ public function renderPageModulePreviewHeader(GridColumnItem $item): string
}

$flexconfOut = '';

if ($record['CType'] === 't3sbs_carousel') {
if ( !empty($flexconf['shift']) ) {
$flexconfOut .= 'shift='.$flexconf['shift'].', ';
Expand Down
5 changes: 3 additions & 2 deletions Classes/Command/CustomScss.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($settings['cdn']['noZip']) {
self::getBootstrapFilesNoZip($settings, $bootstrapVersion, $bootstrapScssPath);
} else {
self::getBootstrapFiles($bootstrapVersion);
self::getBootstrapFiles($bootstrapVersion);
}
if (!file_exists(GeneralUtility::getFileAbsFileName(self::localZipPath.'scss/bootstrap.scss'))) {
self::getBootstrapFiles($settings, $bootstrapVersion, $bootstrapScssPath);
self::getBootstrapFilesNoZip($settings, $bootstrapVersion, $bootstrapScssPath);
}

# Custom
Expand Down Expand Up @@ -268,6 +268,7 @@ public function getBootstrapFiles($bootstrapVersion): void

parent::rmDir(GeneralUtility::getFileAbsFileName(self::localZipPath.'bootstrap-'.$bootstrapVersion));
$zipFile = GeneralUtility::getFileAbsFileName(self::localZipPath.self::localZipFile);

if (file_exists($zipFile)) unlink($zipFile);
} else {
throw new \InvalidArgumentException('No content from GitHub archive!', 1657464783);
Expand Down
28 changes: 28 additions & 0 deletions Classes/Components/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use TYPO3\CMS\Core\Service\FlexFormService;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use T3SBS\T3sbootstrap\Helper\FlexformHelper;
use T3SBS\T3sbootstrap\Utility\BackgroundImageUtility;

/*
* This file is part of the TYPO3 extension t3sbootstrap.
Expand Down Expand Up @@ -164,6 +165,18 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
}
}
}

# if ( !empty($cardData['square']['enable']) ) {
# $cardClass .= ' rounded-0 border-0';
# }

if ( !empty($cardData['tiling']['enable']) ) {
$cardClass = 'card tiling rounded-0 border-0 h-100'.$processedData['class'];
if (empty($processedData['data']['tx_t3sbootstrap_contextcolor'])) {
$cardClass .= ' bg-transparent';
}
}

// header position
if ( $processedData['data']['header_position'] ) {
$headerPosition = $processedData['data']['header_position'];
Expand All @@ -184,6 +197,17 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
$cardClass .= ' h-100';
}

if ( !empty($cardData['tiling']['enable']) ) {
$processedData['addmedia']['imgclass'] = ' rounded-0 '.$cardData['image']['class'];
$bgMediaQueries = '768,576';
$bgimages = GeneralUtility::makeInstance(BackgroundImageUtility::class)
->getBgImage($processedData['data']['uid'], 'tt_content', FALSE, FALSE,
$flexconf, FALSE, $processedData['data']['uid'],$bgMediaQueries);
if ($bgimages) {
$cardData['bgimages'] = $bgimages;
}
}

$processedData['class'] = trim($cardClass);

// addmedia
Expand All @@ -192,6 +216,10 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
$processedData['addmedia']['figureclass'] = ' text-center';
$processedData['addmedia']['figureclass'] .= !empty($flexconf['horizontal']) ? ' d-block' : '';

if ( !empty($cardData['square']['enable']) ) {
$processedData['addmedia']['imgclass'] = 'img-fluid';
}

$processedData['card'] = $cardData;

if ( !empty($processedData['data']['imagewidth']) && !empty($flexconf['maxwidth'])) {
Expand Down
2 changes: 0 additions & 2 deletions Classes/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ public function listAction(bool $deleted = FALSE, bool $created = FALSE, bool $u

/**
* action new
*
* @return void
*/
public function newAction(): ResponseInterface
{
Expand Down
Loading

0 comments on commit 46864e8

Please sign in to comment.