Skip to content

Commit

Permalink
Merge pull request #270 from t3solution/5.2.4
Browse files Browse the repository at this point in the history
New release v5.2.4
  • Loading branch information
t3solution committed Sep 25, 2022
2 parents 52bb03f + ff3c8c7 commit c708ef0
Show file tree
Hide file tree
Showing 21 changed files with 198 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Classes/Backend/Preview/T3sbPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$out .= '<br />- Delay between transitions (in ms): '.$flexconf['delay'];
}
}
if ($record['CType'] == 'card_wrapper') {
if (!empty($flexconf['card_wrapper']) && $record['CType'] == 'card_wrapper') {
$out .= '<br />- Wrapper: Card '.$flexconf['card_wrapper'];
if ( !empty($flexconf['visibleCards']) ) {
$out .= '<br />- Visible Cards: '.$flexconf['visibleCards'];
Expand Down
7 changes: 4 additions & 3 deletions Classes/Components/Carousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ public function getProcessedData(array $processedData, array $flexconf, array $p
$processedData['style'] .= self::getCarouselCaptionStyle( $flexconf, $animate );

$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$file = $fileRepository->findByRelation('tt_content', 'assets', (int)$processedData['data']['uid'])[0];

if (!empty($fileRepository->findByRelation('tt_content', 'assets', (int)$processedData['data']['uid']))) {
$file = $fileRepository->findByRelation('tt_content', 'assets', (int)$processedData['data']['uid'])[0];
}
$processedData['localVideoPath'] = '';
if ($file) {
if (!empty($file)) {
if ($file->getMimeType() == 'video/mp4' || $file->getMimeType() == 'video/webm' || $file->getMimeType() == 'video/wav'
|| $file->getMimeType() == 'video/ogg' || $file->getMimeType() == 'video/flac' || $file->getMimeType() == 'video/opus') {
$processedData['localVideoPath'] = '/'.$file->getStorage()->getConfiguration()['basePath'].substr($file->getIdentifier(), 1);
Expand Down
1 change: 1 addition & 0 deletions Classes/Controller/ConsentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function indexAction(): void
$consentRecordUid = (int)$this->settings['consent']['contentByUid'];
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$fileObjects = $fileRepository->findByRelation('tt_content', 'assets', $consentRecordUid);
$assignedValues = [];

if ( !empty($fileObjects) ) {
if ( $fileObjects[0]->getProperties()['mime_type'] == 'video/youtube') {
Expand Down
1 change: 0 additions & 1 deletion Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3sbootstrap');
$cType = $processedData['data']['CType'];
$parentCType = '';

$flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
$flexconf = $flexFormService->convertFlexFormContentToArray($processedData['data']['tx_t3sbootstrap_flexform']);
$parentflexconf = [];
Expand Down
9 changes: 4 additions & 5 deletions Classes/DataProcessing/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
}
$webp = (bool)$settings['webp'];

if ( is_numeric($contentObjectConfiguration['settings.']['config.']['uid']) ) {
if ( !empty($contentObjectConfiguration['settings.']['config.']['uid'])
&& is_numeric($contentObjectConfiguration['settings.']['config.']['uid']) ) {
$processedRecordVariables = $contentObjectConfiguration['settings.']['config.'];
} else {
$processedData['noConfig'] = TRUE;
Expand Down Expand Up @@ -164,8 +165,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
* Navbar
*/
if ( $processedRecordVariables['navbarEnable'] ) {

// navbar menu
$mainMenu = [];
foreach ($processedData['navbarMenu'] as $key=>$navbarMenu) {
$mainMenu[$key] = $navbarMenu;
if (!empty($navbarMenu['data']['tx_t3sbootstrap_fontawesome_icon'])) {
Expand Down Expand Up @@ -292,7 +293,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
} else {
$navbarColor = $processedRecordVariables['navbarColor'];
}
$navBarAttr .= ' data-colorschemes="'.'bg-'.$navbarColor.'"';
$navBarAttr .= ' data-colorschemes="'.$navbarColor.'"';
$navBarAttr .= ' data-color="navbar-'.$processedRecordVariables['navbarEnable'].'"';
}

Expand Down Expand Up @@ -405,8 +406,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
# Image from pages media
$hasBgImages = 0;
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);


$fileObjects = [];
$processedData['config']['jumbotron']['alignItem'] = 'd-flex align-items-'.$processedRecordVariables['jumbotronAlignitem'];
$processedData['config']['jumbotron']['alignment'] = $processedRecordVariables['jumbotronAlignitem'];
Expand Down
90 changes: 46 additions & 44 deletions Classes/ViewHelpers/MediaViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,52 +301,54 @@ protected function renderImageTag(FileInterface $image, $width, $height, $fileEx
protected function getCropString($image, $cropString)
{
$cropObject = json_decode($cropString);
foreach($this->arguments['breakpoints'] as $cv) {
$cropVariant = $cv['cropVariant'];
$cropObject->$cropVariant->selectedRatio = $this->arguments['ratio'];
$cropedWidth = $image->getProperties()['width'] * $cropObject->$cropVariant->cropArea->width;
$cropedHeight = $image->getProperties()['height'] * $cropObject->$cropVariant->cropArea->height;
$rArr = explode(':',$this->arguments['ratio']);
if ( $this->arguments['shift'] ) {
$shift = $this->arguments['shift'] > 0 ? $cropObject->$cropVariant->cropArea->y + $this->arguments['shift']
: $cropObject->$cropVariant->cropArea->y - ($this->arguments['shift'] * -1);
$cropObject->$cropVariant->cropArea->y = $shift;
}
if ( $rArr[0] > $rArr[1] ) {
// landscape
$pxHeight = ($cropedWidth / $rArr[0]) * $rArr[1];
if ( $image->getProperties()['height'] > $pxHeight ) {
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
} else {
$cHeight = $image->getProperties()['height'] / $pxHeight;

$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
if (!empty($this->arguments['breakpoints'])) {
foreach($this->arguments['breakpoints'] as $cv) {
$cropVariant = $cv['cropVariant'];
$cropObject->$cropVariant->selectedRatio = $this->arguments['ratio'];
$cropedWidth = $image->getProperties()['width'] * $cropObject->$cropVariant->cropArea->width;
$cropedHeight = $image->getProperties()['height'] * $cropObject->$cropVariant->cropArea->height;
$rArr = explode(':',$this->arguments['ratio']);
if ( $this->arguments['shift'] ) {
$shift = $this->arguments['shift'] > 0 ? $cropObject->$cropVariant->cropArea->y + $this->arguments['shift']
: $cropObject->$cropVariant->cropArea->y - ($this->arguments['shift'] * -1);
$cropObject->$cropVariant->cropArea->y = $shift;
}
} elseif ($rArr[0] == $rArr[1]) {
// square
if ( $image->getProperties()['width'] > $image->getProperties()['height'] ) {
$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
} else {
$pxHeight = $cropedWidth / $rArr[0] * $rArr[1];
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
}
} else {
// portrait
$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
if ( $image->getProperties()['width'] > $pxWidth ) {
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
if ( $rArr[0] > $rArr[1] ) {
// landscape
$pxHeight = ($cropedWidth / $rArr[0]) * $rArr[1];
if ( $image->getProperties()['height'] > $pxHeight ) {
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
} else {
$cHeight = $image->getProperties()['height'] / $pxHeight;

$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
}
} elseif ($rArr[0] == $rArr[1]) {
// square
if ( $image->getProperties()['width'] > $image->getProperties()['height'] ) {
$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
} else {
$pxHeight = $cropedWidth / $rArr[0] * $rArr[1];
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
}
} else {
$cWidth = $image->getProperties()['width'] / $pxWidth;
$pxHeight = $cropedWidth / $rArr[1] * $rArr[0];
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
// portrait
$pxWidth = $cropedHeight / $rArr[1] * $rArr[0];
if ( $image->getProperties()['width'] > $pxWidth ) {
$cWidth = $pxWidth / $image->getProperties()['width'];
$cropObject->$cropVariant->cropArea->width = $cWidth;
} else {
$cWidth = $image->getProperties()['width'] / $pxWidth;
$pxHeight = $cropedWidth / $rArr[1] * $rArr[0];
$cHeight = $pxHeight / $image->getProperties()['height'];
$cropObject->$cropVariant->cropArea->height = $cHeight;
}
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion Classes/Wrapper/CarouselContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function getProcessedData(array $processedData, array $flexconf): array
->fetchAll();

$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$carouselSlides = [];
foreach($statement as $element) {
$file = $fileRepository->findByRelation('tt_content', 'assets', $element['uid']);
if ( !empty($file) ) {
Expand All @@ -50,7 +51,11 @@ public function getProcessedData(array $processedData, array $flexconf): array
$processedData['containsVideo'] = TRUE;
}
}
$carouselSlides[$element['uid']] = $file[0];
if (!empty($file[0])) {
$carouselSlides[$element['uid']] = $file[0];
} else {
$carouselSlides[$element['uid']] = '';
}
}

$processedData['carouselSlides'] = !empty($carouselSlides) ? $carouselSlides : '';
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
(
new \B13\Container\Tca\ContainerConfiguration(
'three_columns',
'3 cols',
'LLL:EXT:t3sbootstrap/Resources/Private/Language/locallang_be.xlf:tx_container.threeColumns.title',
'description',
[
[
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TypoScript/Lib/ContentElement.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ lib.contentElement {
lg = {$bootstrap.navbar.breakpoint.lg}
xl = {$bootstrap.navbar.breakpoint.xl}
xxl = {$bootstrap.navbar.breakpoint.xxl}
}
}
}
variables {
be_layout = TEXT
Expand Down
6 changes: 6 additions & 0 deletions Configuration/TypoScript/Page/Template.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ page {
mobileOrder = {$bootstrap.pages.override.mobileOrder}
tx_t3sbootstrap_titlecolor = {$bootstrap.pages.override.titlecolor}
tx_t3sbootstrap_subtitlecolor = {$bootstrap.pages.override.subtitlecolor}
tx_t3sbootstrap_smallColumns = {$bootstrap.pages.override.smallColumns}
tx_t3sbootstrap_breakpoint = {$bootstrap.pages.override.breakpoint}
tx_t3sbootstrap_dropdownRight = {$bootstrap.pages.override.dropdownRight}
tx_t3sbootstrap_container = {$bootstrap.pages.override.container}
tx_t3sbootstrap_linkToTop = {$bootstrap.pages.override.linkToTop}
tx_t3sbootstrap_mobileOrder = {$bootstrap.pages.override.mobileOrder}
}
}
config {
Expand Down
6 changes: 3 additions & 3 deletions Contrib/scssphp/bin/pscss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use ScssPhp\ScssPhp\Parser;
use ScssPhp\ScssPhp\Version;

$style = null;
$loadPaths = null;
$loadPaths = [];
$dumpTree = false;
$inputFile = null;
$changeDir = false;
Expand Down Expand Up @@ -148,7 +148,7 @@ EOT;
$value = parseArgument($i, array('-I', '--load-path'));

if (isset($value)) {
$loadPaths = $value;
$loadPaths[] = $value;
continue;
}

Expand Down Expand Up @@ -188,7 +188,7 @@ if ($dumpTree) {
$scss = new Compiler();

if ($loadPaths) {
$scss->setImportPaths(explode(PATH_SEPARATOR, $loadPaths));
$scss->setImportPaths($loadPaths);
}

if ($style) {
Expand Down
37 changes: 37 additions & 0 deletions Contrib/scssphp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"sass/sass-spec": "*",
"squizlabs/php_codesniffer": "~3.5",
"symfony/phpunit-bridge": "^5.1",
"thoughtbot/bourbon": "^7.0",
"twbs/bootstrap": "~5.0",
"twbs/bootstrap4": "4.6.0",
"zurb/foundation": "~6.5"
Expand All @@ -63,6 +64,42 @@
}
}
},
{
"type": "package",
"package": {
"name": "thoughtbot/bourbon",
"version": "v7.0.0",
"source": {
"type": "git",
"url": "https://github.com/thoughtbot/bourbon.git",
"reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thoughtbot/bourbon/zipball/fbe338ee6807e7f7aa996d82c8a16f248bb149b3",
"reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3",
"shasum": ""
}
}
},
{
"type": "package",
"package": {
"name": "thoughtbot/bourbon",
"version": "v7.0.0",
"source": {
"type": "git",
"url": "https://github.com/thoughtbot/bourbon.git",
"reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thoughtbot/bourbon/zipball/fbe338ee6807e7f7aa996d82c8a16f248bb149b3",
"reference": "fbe338ee6807e7f7aa996d82c8a16f248bb149b3",
"shasum": ""
}
}
},
{
"type": "package",
"package": {
Expand Down
40 changes: 38 additions & 2 deletions Contrib/scssphp/src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3836,10 +3836,46 @@ protected function getFunctionReference($name, $safeCopy = false)
return [Type::T_FUNCTION_REFERENCE, 'user', $name, $f, $prototype];
}

$lowercasedName = strtolower($normalizedName);

// Special functions overriding a CSS function are case-insensitive. We normalize them as lowercase
// to avoid the deprecation warning about the wrong case being used.
if ($lowercasedName === 'min' || $lowercasedName === 'max') {
$normalizedName = $lowercasedName;
}

if (($f = $this->getBuiltinFunction($normalizedName)) && \is_callable($f)) {
$libName = $f[1];
$prototype = isset(static::$$libName) ? static::$$libName : null;


// All core functions have a prototype defined. Not finding the
// prototype can mean 2 things:
// - the function comes from a child class (deprecated just after)
// - the function was found with a different case, which relates to calling the
// wrong Sass function due to our camelCase usage (`fade-in()` vs `fadein()`),
// because PHP method names are case-insensitive while property names are
// case-sensitive.
if ($prototype === null || strtolower($normalizedName) !== $normalizedName) {
$r = new \ReflectionMethod($this, $libName);
$actualLibName = $r->name;

if ($actualLibName !== $libName || strtolower($normalizedName) !== $normalizedName) {
$kebabCaseName = preg_replace('~(?<=\\w)([A-Z])~', '-$1', substr($actualLibName, 3));
assert($kebabCaseName !== null);
$originalName = strtolower($kebabCaseName);
$warning = "Calling built-in functions with a non-standard name is deprecated since Scssphp 1.8.0 and will not work anymore in 2.0 (they will be treated as CSS function calls instead).\nUse \"$originalName\" instead of \"$name\".";
@trigger_error($warning, E_USER_DEPRECATED);
$fname = $this->getPrettyPath($this->sourceNames[$this->sourceIndex]);
$line = $this->sourceLine;
Warn::deprecation("$warning\n on line $line of $fname");

// Use the actual function definition
$prototype = isset(static::$$actualLibName) ? static::$$actualLibName : null;
$f[1] = $libName = $actualLibName;
}
}

if (\get_class($this) !== __CLASS__ && !isset($this->warnedChildFunctions[$libName])) {
$r = new \ReflectionMethod($this, $libName);
$declaringClass = $r->getDeclaringClass()->name;
Expand Down Expand Up @@ -7461,7 +7497,7 @@ public function toHSL($red, $green, $blue)
}
}

return [Type::T_HSL, fmod($h, 360), $s * 100, $l / 5.1];
return [Type::T_HSL, fmod($h + 360, 360), $s * 100, $l / 5.1];
}

/**
Expand Down Expand Up @@ -8148,7 +8184,7 @@ protected function libHsl($args, $kwargs, $funcName = 'hsl')
}
}

$hueValue = $hue->getDimension() % 360;
$hueValue = fmod($hue->getDimension(), 360);

while ($hueValue < 0) {
$hueValue += 360;
Expand Down
3 changes: 3 additions & 0 deletions Contrib/scssphp/src/Node/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function getDenominatorUnits()
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
if ($offset === -3) {
Expand All @@ -174,6 +175,7 @@ public function offsetExists($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
switch ($offset) {
Expand All @@ -200,6 +202,7 @@ public function offsetGet($offset)
/**
* {@inheritdoc}
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw new \BadMethodCallException('Number is immutable');
Expand Down
Loading

0 comments on commit c708ef0

Please sign in to comment.