Skip to content

Commit

Permalink
BUGFIX release v5.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Helmut Hackbarth authored and Helmut Hackbarth committed Apr 8, 2023
1 parent c15d254 commit fa2f9a3
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 9 deletions.
43 changes: 42 additions & 1 deletion Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData['data']['configuid'] = (int)$processorConfiguration['configuid'];
$processedData['header_fontawesome'] = '';

$sectionMenuClass = '';
if (!empty($contentObjectConfiguration['settings.']['sectionMenuClass'])) {
$sectionMenuClass = $contentObjectConfiguration['settings.']['sectionMenuClass'];
}

// class
$classHelper = GeneralUtility::makeInstance(ClassHelper::class);
$class = $classHelper->getDefaultClass($processedData['data'], $flexconf, $extConf['cTypeClass']);
$class = $classHelper->getDefaultClass($processedData['data'], $flexconf, $extConf['cTypeClass'], $sectionMenuClass);
$processedData['class'] = !empty($processedData['class']) ? $processedData['class'].' '.$class : $class;

// header class
Expand Down Expand Up @@ -311,6 +316,16 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData['class'] .= $classHelper->getContainerClass($parentflexconf, $flexconf);
}

$processedData['dataAttr'] = '';
if (!empty($processedData['data']['tx_content_animations_animation'])) {
$completeAnimationSettings = $this->generateAnimationAttributeSettingsFromAnimationsArray($processedData['data']);
$processedData['dataAttr'] = !empty($completeAnimationSettings) ? $completeAnimationSettings : '';
$processedData['dataAnimate'] = '';
$processedData['isAnimateCss'] = FALSE;
$processedData['animateCssRepeat'] = FALSE;
$flexconf['animate'] = '';
}

// container class
$defaultHelper = GeneralUtility::makeInstance(DefaultHelper::class);
$processedData = $defaultHelper->getContainerClass($processedData, $extConf['container']);
Expand All @@ -337,4 +352,30 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu

return $processedData;
}



/**
* @param array $animationSettingsArray
* @return string
*/
private function generateAnimationAttributeSettingsFromAnimationsArray(array $animationSettingsArray)
{
$animationSettings = '';

foreach ($animationSettingsArray as $key => $value) {
if (str_starts_with($key, 'tx_content_animations_')) {
if ($key == 'tx_content_animations_animation' ) {
$newphrase = str_replace('tx_content_animations_animation', 'data-aos', $key);
$animationSettings .= $newphrase . '="' . $value . '" ';
} else {
$newphrase = str_replace('tx_content_animations_', 'data-aos-', $key);
$animationSettings .= $newphrase . '="' . $value . '" ';
}
}
}
return ' '.$animationSettings;
}


}
4 changes: 2 additions & 2 deletions Classes/Helper/ClassHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class ClassHelper implements SingletonInterface
/**
* Returns the CSS-class for default elements
*/
public function getDefaultClass(array $data, array $flexconf, string $cTypeClass): string
public function getDefaultClass(array $data, array $flexconf, string $cTypeClass, string $sectionMenuClass): string
{
// class
if ( $cTypeClass ) {
Expand Down Expand Up @@ -145,7 +145,7 @@ public function getDefaultClass(array $data, array $flexconf, string $cTypeClass
}
}

if ($data['sectionIndex']) {
if ($sectionMenuClass) {
$class .= ' section-index';
}

Expand Down
1 change: 1 addition & 0 deletions Classes/Helper/DefaultHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function getDefaults(
$processedData['data']['image_zoom'] = '';
$processedData['addmedia']['imagezoom'] = '';
}

// animate css for all CEs exept t3sbs_carousel & collapsible_accordion
if ($animateCss && (!empty($processedData['data']['tx_t3sbootstrap_animateCss']) || !empty($flexconf['animate']))
&& $cType != 't3sbs_carousel' && $cType != 'collapsible_accordion')
Expand Down
27 changes: 27 additions & 0 deletions Configuration/TSConfig/Page.tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -426,5 +426,32 @@ TCEFORM.tt_content {
t3sbs_carousel.disabled = 1
}
}
tx_content_animations_animation {
types {
collapsible_accordion.disabled = 1
t3sbs_carousel.disabled = 1
tabs_tab.disabled = 1
listGroup_wrapper.disabled = 1
t3sbs_button.disabled = 1
}
}
tx_content_animations_duration {
types {
collapsible_accordion.disabled = 1
t3sbs_carousel.disabled = 1
tabs_tab.disabled = 1
listGroup_wrapper.disabled = 1
t3sbs_button.disabled = 1
}
}
tx_content_animations_delay {
types {
collapsible_accordion.disabled = 1
t3sbs_carousel.disabled = 1
tabs_tab.disabled = 1
listGroup_wrapper.disabled = 1
t3sbs_button.disabled = 1
}
}

}
1 change: 1 addition & 0 deletions Configuration/TypoScript/Lib/ContentElement.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ lib.contentElement {
webp = {$bootstrap.extconf.webp}
btnSlideOutCorrection = 21
t3sbconcatenate = {$bootstrap.extconf.t3sbconcatenate}
sectionMenuClass = {$bootstrap.config.sectionMenuClass}
// used also with config
config {
sectionmenuAnchorOffset = {$bootstrap.config.sectionmenuAnchorOffset}
Expand Down
2 changes: 2 additions & 0 deletions Configuration/TypoScript/constants.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ bootstrap.config.enableUtilityColors = 1
# hints to increase the website speed in the BE Modul
bootstrap.config.enableInfo = 1

bootstrap.config.sectionMenuClass = 0

# include print template
bootstrap.print.enable = 0

Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Layouts/Content/Default.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
<f:link.typolink parameter="{celink}" class="ce-link{f:if(condition: '{parentCType} == listGroup_wrapper', then: ' list-group-item list-group-item-action')}">
<f:if condition="{isTxContainer}">
<f:then>
<div id="c{data.uid}">
<div id="c{data.uid}"{dataAttr -> f:format.raw()}>
<f:render section="Header" optional="true">
<f:render partial="Header/All" arguments="{_all}" />
</f:render>
<f:render section="Main" arguments="{_all}" />
</div>
</f:then>
<f:else>
<div id="c{data.uid}"{classAttr -> f:format.raw()}{styleAttr -> f:format.raw()}>
<div id="c{data.uid}"{classAttr -> f:format.raw()}{styleAttr -> f:format.raw()}{dataAttr -> f:format.raw()}>
<f:render section="Header" optional="true">
<f:render partial="Header/All" arguments="{_all}" />
</f:render>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
function t3sbLocalCarouselVideo(videoCarousel) {
videoCarousel.addEventListener('slide.bs.carousel', function (el) {
let slides = this.getElementsByClassName('carousel-item');
slides.forEach( carouselItem => {
Array.from(slides).forEach( carouselItem => {
if ( carouselItem.classList.contains('active') ) {
if ( carouselItem.classList.contains('carousel-video') ) {
carouselItem.getElementsByTagName('video')[0].play();
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'title' => 'Bootstrap Components',
'description' => 'Startup extension to use bootstrap 5 classes, components and more out of the box. Example and info: www.t3sbootstrap.de',
'category' => 'templates',
'version' => '5.2.9',
'version' => '5.2.10',
'state' => 'stable',
'clearCacheOnLoad' => true,
'author' => 'Helmut Hackbarth',
Expand Down
4 changes: 2 additions & 2 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@
// Optional lazyLoad
if (array_key_exists('lazyLoad', $extconf)) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('bootstrap.extconf.lazyLoad = '.$extconf['lazyLoad']);
}
}
// Optional animateCss
if (array_key_exists('animateCss', $extconf) && $extconf['animateCss'] > '0') {
if (array_key_exists('animateCss', $extconf) && $extconf['animateCss'] > '0' && !\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('content_animations')) {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptConstants('bootstrap.extconf.animateCss = '.$extconf['animateCss']);
}
// Optional select-field for a .container or .container-fluid class in any content element
Expand Down

0 comments on commit fa2f9a3

Please sign in to comment.