Skip to content

Commit

Permalink
Merge pull request #408 from t3solution/5.3.16
Browse files Browse the repository at this point in the history
New release v5.3.16
  • Loading branch information
t3solution authored Oct 7, 2024
2 parents 146b434 + 15b70d9 commit 58cc10f
Show file tree
Hide file tree
Showing 26 changed files with 195 additions and 125 deletions.
5 changes: 2 additions & 3 deletions Classes/Backend/EventListener/FlexForm/FlexformEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use TYPO3\CMS\Core\Configuration\Event\AfterFlexFormDataStructureParsedEvent;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;

Expand Down Expand Up @@ -46,8 +45,8 @@ public function __invoke(AfterFlexFormDataStructureParsedEvent $event): void

if (array_key_exists($identifier['dataStructureKey'], $flexForms)) {
if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content'
&& $identifier['fieldName'] === 'tx_t3sbootstrap_flexform' && $identifier['dataStructureKey']) {
$file = Environment::getPublicPath() . $ffPath.$flexForms[$identifier['dataStructureKey']].'.xml';
&& $identifier['fieldName'] === 'tx_t3sbootstrap_flexform' && $identifier['dataStructureKey']) {
$file = GeneralUtility::getFileAbsFileName($ffPath.$flexForms[$identifier['dataStructureKey']].'.xml');
if (file_exists($file)) {
$content = @file_get_contents($file);
if ($content) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Backend/FormDataProvider/FlexFormManipulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FlexFormManipulation implements FormDataProviderInterface
*/
public function addData(array $result): array
{
$configurationManager =GeneralUtility::makeInstance(BackendConfigurationManager::class);
$configurationManager = GeneralUtility::makeInstance(BackendConfigurationManager::class);
$setup = $configurationManager->getTypoScriptSetup();
$flexforms = !empty($setup['plugin.']['tx_t3sbootstrap.']['flexform.']) ? $setup['plugin.']['tx_t3sbootstrap.']['flexform.'] : [];

Expand Down
12 changes: 3 additions & 9 deletions Classes/Command/CustomScss.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@
*/
class CustomScss extends CommandBase
{

public function initializeAction()
{
parent::initializeAction();
}


public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
{
$this->configurationManager = $configurationManager;
}


/**
* Defines the allowed options for this command
*
Expand All @@ -54,8 +48,8 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = $this->configurationManager->getConfiguration(
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = $configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
't3sbootstrap',
'm1'
Expand Down
16 changes: 13 additions & 3 deletions Classes/DataProcessing/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$rootlinePage = $pageRepository->getPage($processedRecordVariables['homepageUid']);
$smallColumnsRootline = !empty($rootlinePage['tx_t3sbootstrap_smallColumns']) ? (int)$rootlinePage['tx_t3sbootstrap_smallColumns'] : 3;
$smallColumns = $smallColumnsCurrent ?: $smallColumnsRootline;

// global override page data
if (!empty($contentObjectConfiguration['settings.']['pages.']['override.'])) {
foreach ($contentObjectConfiguration['settings.']['pages.']['override.'] as $field=>$override) {
Expand Down Expand Up @@ -425,7 +424,14 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$hasBgImages = 0;
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$fileObjects = [];
$processedData['config']['jumbotron']['alignItem'] = 'd-flex align-items-'.$processedRecordVariables['jumbotronAlignitem'];

if ( !empty($processedRecordVariables['jumbotronAlignitem']) ) {
$processedData['config']['jumbotron']['alignItem'] = 'd-flex mx-auto align-items-'.$processedRecordVariables['jumbotronAlignitem'];
$processedData['config']['jumbotron']['class'] .= ' d-flex';
} else {
$processedData['config']['jumbotron']['alignItem'] = ' d-flex';
}

$processedData['config']['jumbotron']['alignment'] = $processedRecordVariables['jumbotronAlignitem'];

if ($processedRecordVariables['jumbotronBgimage'] == 'root') {
Expand Down Expand Up @@ -517,14 +523,18 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData['config']['jumbotron']['bgImage'] = $bgSlides;
}
}
if ($hasBgImages && !empty($processedRecordVariables['jumbotronBgimageratio'])) {

if ($hasBgImages && empty($currentPage['tx_t3sbootstrap_fullheightsection']) && !empty($processedRecordVariables['jumbotronBgimageratio'])) {
$processedData['config']['jumbotron']['noBgRatio'] = false;
$processedData['config']['jumbotron']['class'] .= ' ratio ratio-'.$processedRecordVariables['jumbotronBgimageratio'];
$ratioArr = explode('x', $processedRecordVariables['jumbotronBgimageratio']);
$x = $processedRecordVariables['jumbotronBgimageratio'];
$y = $ratioArr[1].' / '.$ratioArr[0].' * 100%';
$processedData['ratioCalcCss'] = '.ratio-'.$x.'{--bs-aspect-ratio:calc('.$y.');}';
} else {
$processedData['config']['jumbotron']['class'] = ' ratio';
}

}

/**
Expand Down
13 changes: 7 additions & 6 deletions Classes/PageTitle/BreadcrumbProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
class BreadcrumbProvider extends AbstractPageTitleProvider
{

public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
{
$this->configurationManager = $configurationManager;
}
/**
* @var ConfigurationManagerInterface
*/
protected ConfigurationManagerInterface $configurationManager;


/**
* @param string $title
*/
public function setTitle(string $title)
{
$this->configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = $this->configurationManager->getConfiguration(
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = $configurationManager->getConfiguration(
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
't3sbootstrap',
'm1'
Expand Down
38 changes: 6 additions & 32 deletions Classes/ViewHelpers/MediaViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use TYPO3\CMS\Extbase\Service\ImageService;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;

#ConfigurationManagerInterface

/*
* This file is part of the TYPO3 extension t3sbootstrap.
Expand All @@ -33,35 +32,8 @@ class MediaViewHelper extends AbstractTagBasedViewHelper
* @var string
*/
protected $tagName = 'img';

/**
* @var ResponsiveImagesUtility
*/
protected $responsiveImagesUtility;

/**
* @var ConfigurationManager
*/
protected $configurationManager;


/**
* @param ResponsiveImagesUtility $responsiveImagesUtility
*/
public function injectResponsiveImagesUtility(ResponsiveImagesUtility $responsiveImagesUtility)
{
$this->responsiveImagesUtility = $responsiveImagesUtility;
}


/**
* @param ConfigurationManager $configurationManager
*/
public function injectConfigurationManager(ConfigurationManager $configurationManager)
{
$this->configurationManager = $configurationManager;
}

/**
* Initialize arguments.
*/
Expand Down Expand Up @@ -150,8 +122,8 @@ public function render(): string
$additionalConfig = array_merge_recursive($this->arguments, $additionalConfig);
return $fileRenderer->render($file, $width, $height, $additionalConfig);
}


/**
* Render img tag
*
Expand Down Expand Up @@ -258,8 +230,9 @@ protected function renderPicture(FileInterface $image, $width, $height)

$this->arguments['breakpoints'] = $breakpointArr;

$responsiveImagesUtility = GeneralUtility::makeInstance(ResponsiveImagesUtility::class);
// Generate picture tag
$this->tag = $this->responsiveImagesUtility->createPictureTag(
$this->tag = $responsiveImagesUtility->createPictureTag(
$image,
$fallbackImage,
$this->arguments['breakpoints'],
Expand Down Expand Up @@ -346,7 +319,8 @@ protected function renderImageTag(FileInterface $image, $width, $height, $fileEx
$imageService = self::getImageService();
$processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);

$settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$settings = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);

$imageUri = $imageService->getImageUri($processedImage);

Expand Down
5 changes: 2 additions & 3 deletions Classes/Wrapper/CollapsibleAccordion.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
if (!empty($file)) {
$file = $file[0];
}
$processedData['appearance'] = $parentflexconf['appearance'];
$processedData['appearance'] = !empty($parentflexconf['appearance']) ? $parentflexconf['appearance'] : '';
$processedData['show'] = !empty($flexconf['active']) ? ' show' : '';
$processedData['collapsed'] = !empty($flexconf['active']) ? '' : ' collapsed';
$processedData['expanded'] = !empty($flexconf['active']) ? 'true' : 'false';
$processedData['alwaysOpen'] = !empty($parentflexconf['alwaysOpen']) ? 'true' : 'false';
$processedData['buttonstyle'] = !empty($flexconf['style']) ? $flexconf['style'] : 'primary';
$processedData['collapsibleByPid'] = !empty($flexconf['collapsibleByPid']) ? $flexconf['collapsibleByPid'] : '';
$processedData['media'] = $file ? $file : '';
$processedData['appearance'] = $parentflexconf['appearance'];
$processedData['media'] = !empty($file) ? $file : '';

return $processedData;
}
Expand Down
20 changes: 4 additions & 16 deletions Configuration/FlexForms/CardSetting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,6 @@
</cardborderstyle>
<horizontal>
<label>Horizontal</label>
<displayCond>
<and>
<numIndex index="0">FIELD:sDEF.multiImage.enable:=:0</numIndex>
<numIndex index="1">FIELD:sDEF.tiling.enable:=:0</numIndex>
</and>
</displayCond>
<config>
<type>check</type>
</config>
Expand Down Expand Up @@ -358,12 +352,6 @@
<multiImage.enable>
<label>Enable Profile Card</label>
<description>You need at least two images for the profile card. The second is the circular, smaller image</description>
<displayCond>
<and>
<numIndex index="0">FIELD:sDEF.horizontal:=:0</numIndex>
<numIndex index="1">FIELD:sDEF.tiling.enable:=:0</numIndex>
</and>
</displayCond>
<onChange>reload</onChange>
<config>
<type>check</type>
Expand All @@ -373,10 +361,10 @@
<label>Width of the circular image (in %)</label>
<displayCond>FIELD:sDEF.multiImage.enable:=:1</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>50</default>
<eval>trim,int</eval>
<eval>trim</eval>
<range>
<lower>10</lower>
<upper>90</upper>
Expand Down Expand Up @@ -499,10 +487,10 @@
</and>
</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>50</default>
<eval>trim,int</eval>
<eval>trim</eval>
<range>
<lower>10</lower>
<upper>90</upper>
Expand Down
3 changes: 1 addition & 2 deletions Configuration/FlexForms/Carousel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
<label>Vertical shift in % ( 0 = center, range: -60 to 60 )</label>
<displayCond>USER:T3SBS\T3sbootstrap\UserFunction\TcaMatcher->isLocalVideo</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>0</default>
<eval>int</eval>
<range>
<lower>-60</lower>
<upper>60</upper>
Expand Down
4 changes: 2 additions & 2 deletions Configuration/FlexForms/Container/Buttongroup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@
<description>offset to the left specified in px</description>
<displayCond>FIELD:sDEF.slideIn:=:1</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>4</size>
<max>4</max>
<default>33</default>
<checkbox>0</checkbox>
<eval>required,int</eval>
<required>true</required>
</config>
</visiblePart>
</el>
Expand Down
7 changes: 3 additions & 4 deletions Configuration/FlexForms/Container/CarouselContainer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
<width>
<label>max. Image width (required)</label>
<config>
<type>input</type>
<type>number</type>
<size>4</size>
<max>4</max>
<default>1440</default>
<eval>int+,required</eval>
<required>true</required>
<checkbox>0</checkbox>
</config>
</width>
Expand Down Expand Up @@ -111,11 +111,10 @@
<interval>
<label>Interval</label>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<max>5</max>
<default>5000</default>
<eval>int</eval>
<checkbox>0</checkbox>
</config>
</interval>
Expand Down
3 changes: 1 addition & 2 deletions Configuration/FlexForms/Container/SwiperContainer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@
<width>
<label>max. Image width</label>
<config>
<type>input</type>
<type>number</type>
<size>4</size>
<max>4</max>
<default>576</default>
<eval>int</eval>
<checkbox>0</checkbox>
</config>
</width>
Expand Down
9 changes: 3 additions & 6 deletions Configuration/FlexForms/Container/ToastContainer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
</and>
</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>5000</default>
<eval>int</eval>
</config>
</delay>
<placement>
Expand Down Expand Up @@ -105,10 +104,9 @@
<label>Width of the toast in (px)</label>
<displayCond>FIELD:general.multipleToast:=:0</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>350</default>
<eval>int</eval>
</config>
</toastwidth>
<cookie>
Expand All @@ -125,10 +123,9 @@
<label>Cookie expiration in days</label>
<displayCond>FIELD:general.cookie:=:1</displayCond>
<config>
<type>input</type>
<type>number</type>
<size>5</size>
<default>30</default>
<eval>int</eval>
</config>
</expires>
</el>
Expand Down
Loading

0 comments on commit 58cc10f

Please sign in to comment.