diff --git a/Classes/Controller/ConfigController.php b/Classes/Controller/ConfigController.php
index 71e862b3..b4f1e42a 100644
--- a/Classes/Controller/ConfigController.php
+++ b/Classes/Controller/ConfigController.php
@@ -246,7 +246,7 @@ public function newAction(): void
/**
* action create
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $newConfig
+ * @param Config $newConfig
* @return void
*/
public function createAction(Config $newConfig): void
@@ -263,7 +263,7 @@ public function createAction(Config $newConfig): void
/**
* action edit
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @param bool $updated
* @return void
*/
@@ -290,7 +290,7 @@ public function editAction(Config $config, $updated = FALSE): void
/**
* action update
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @return void
*/
public function updateAction(Config $config): void
@@ -306,7 +306,7 @@ public function updateAction(Config $config): void
/**
* action delete
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @return void
*/
public function deleteAction(Config $config): void
@@ -400,8 +400,8 @@ public function getFieldsOptions(): array
/**
* take over $rootConfig settings
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $rootConfig
- * @return \T3SBS\T3sbootstrap\Domain\Model\Config $newConfig
+ * @param Config $rootConfig
+ * @return Config $newConfig
*/
public function getNewConfig(Config $rootConfig): Config
{
@@ -422,7 +422,7 @@ public function getNewConfig(Config $rootConfig): Config
/**
* Compare config with rootconfig
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @return array
*/
protected function compareConfig(Config $config): array
@@ -647,7 +647,7 @@ public function writeConstants(): void
/**
* Get the data from DB
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @param bool $isRoot
* @return string
*/
@@ -681,7 +681,7 @@ private function getConstants(Config $config, $isRoot): string
/**
* Get the Tca Columns
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @param Config $config
* @return array
*/
private function getTcaColumns(): array
@@ -780,8 +780,8 @@ private function getUtilityColors(): array
/**
* Returns some default settings for new root configuration
*
- * @param \T3SBS\T3sbootstrap\Domain\Model\Config $newConfig
- * @return \T3SBS\T3sbootstrap\Domain\Model\Config $newConfig
+ * @param Config $newConfig
+ * @return Config $newConfig
*/
protected function setDefaults($newConfig): Config
{
diff --git a/Classes/DataProcessing/BootstrapProcessor.php b/Classes/DataProcessing/BootstrapProcessor.php
index 91a9a3ec..9510dcc0 100644
--- a/Classes/DataProcessing/BootstrapProcessor.php
+++ b/Classes/DataProcessing/BootstrapProcessor.php
@@ -24,6 +24,7 @@
use T3SBS\T3sbootstrap\Utility\BackgroundImageUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Resource\FileRepository;
+use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
class BootstrapProcessor implements DataProcessorInterface
@@ -353,7 +354,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
if ( $processedData['data']['CType'] == 't3sbs_carousel' ) {
$processedData['dimensions']['width'] = $parentflexconf['width'] ?: '';
$processedData['carouselLink'] = $parentflexconf['link'];
-
+ $processedData['mobileNoRatio'] = $parentflexconf['mobileNoRatio'];
if ($parentflexconf['link'] == 'button' && $processedData['data']['header_link']){
$processedData['data']['button_link'] = $processedData['data']['header_link'];
$processedData['data']['header_link'] = '';
@@ -547,17 +548,12 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
/**
* Toasts
*/
- if ( $processedData['data']['CType'] == 't3sbs_toast' ) {
+ if ( $processedData['data']['CType'] == 't3sbs_toast' || $processedData['data']['CType'] == 'toast_container' ) {
$processedData['animation'] = $flexconf['animation'] ? 'true' : 'false';
$processedData['autohide'] = $flexconf['autohide'] ? 'true' : 'false';
$processedData['delay'] = $flexconf['delay'];
- if ( $flexconf['placement'] == 'left' ) {
- $processedData['placement'] = 'position: absolute; top: 0; left: 0;';
- } elseif ( $flexconf['placement'] == 'right' ) {
- $processedData['placement'] = 'position: absolute; top: 0; right: 0;';
- } else {
- $processedData['placement'] = '';
- }
+ $processedData['toastwidth'] = $flexconf['toastwidth'];
+ $processedData['placement'] = $flexconf['placement'];
}
// if media
@@ -685,11 +681,25 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
# CSS-class for container only
if ( $processedData['isTxContainer'] ) {
$containerClass = $classHelper->getTxContainerClass($processedData['data'], $flexconf, $processedData['isVideo'], $extConf);
-
-
$processedData['class'] .= $containerClass ? ' '.$containerClass : '';
}
+ # Flip Card
+ if ( $processedData['data']['CType'] == 't3sbs_card' && $flexconf['flipcard'] ) {
+ if ( $processedData['data']['tx_t3sbootstrap_textcolor'] ) {
+ $backclass = 'text-'.$processedData['data']['tx_t3sbootstrap_textcolor'];
+ }
+ if ( $processedData['data']['tx_t3sbootstrap_bgcolor'] ) {
+ $backstyle = $processedData['data']['tx_t3sbootstrap_bgcolor'];
+ } else {
+ if ( $processedData['data']['tx_t3sbootstrap_contextcolor'] ) {
+ $backclass .= ' bg-'.$processedData['data']['tx_t3sbootstrap_contextcolor'];
+ }
+ }
+ $processedData['backclass'] = trim((string)$backclass);
+ $processedData['backstyle'] = $backstyle;
+ }
+
$processedData['style'] .= ' '.$processedData['data']['tx_t3sbootstrap_extra_style'];
$processedData['style'] = trim($processedData['style']);
$processedData['class'] = trim($processedData['class']);
@@ -703,7 +713,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
*
* @return TypoScriptFrontendController
*/
- protected function getFrontendController(): \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+ protected function getFrontendController(): TypoScriptFrontendController
{
return $GLOBALS['TSFE'];
}
diff --git a/Classes/DataProcessing/CardProcessor.php b/Classes/DataProcessing/CardProcessor.php
index b5fa22f0..6420e01f 100644
--- a/Classes/DataProcessing/CardProcessor.php
+++ b/Classes/DataProcessing/CardProcessor.php
@@ -159,7 +159,15 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
// class
$cardClass = 'card';
$cardClass .= $parentflexconf['equalHeight'] ? ' h-100' : '';
- $cardClass .= $processedData['data']['tx_t3sbootstrap_header_position'] ? ' '.$processedData['data']['tx_t3sbootstrap_header_position']:'';
+
+ if ( $flexconf['flipcard'] ) {
+ $cardClass .= ' flip-card border-0';
+ $cardData['flipcard'] = TRUE;
+ $cardData['rotateY'] = $flexconf['rotateY'];
+ } else {
+ $cardClass .= $processedData['data']['tx_t3sbootstrap_header_position'] ? ' '.$processedData['data']['tx_t3sbootstrap_header_position']:'';
+ }
+
if ( $processedData['data']['header_position'] ) {
$headerPosition = $processedData['data']['header_position'];
if ( $headerPosition == 'left' ) $headerPosition = 'start';
diff --git a/Classes/DataProcessing/GalleryProcessor.php b/Classes/DataProcessing/GalleryProcessor.php
index f9821e25..14eafbfd 100644
--- a/Classes/DataProcessing/GalleryProcessor.php
+++ b/Classes/DataProcessing/GalleryProcessor.php
@@ -189,6 +189,11 @@ class GalleryProcessor implements DataProcessorInterface
*/
protected $disableAutoRow;
+ /**
+ * @var string
+ */
+ protected $parentflexconf;
+
/**
* @var array
*/
diff --git a/Classes/Helper/ClassHelper.php b/Classes/Helper/ClassHelper.php
index 34bbc3ad..7705f88b 100644
--- a/Classes/Helper/ClassHelper.php
+++ b/Classes/Helper/ClassHelper.php
@@ -12,6 +12,7 @@
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
class ClassHelper implements SingletonInterface
{
@@ -99,6 +100,15 @@ public function getAllClass($data, $flexconf, $extConf): string
$class .= $flexconf['alignSelf'] ? ' align-self-'.$flexconf['alignSelf'] : '';
}
+ //Flip Card
+ if ( $data['CType'] == 't3sbs_card' && $flexconf['flipcard'] ) {
+ if ( $data['tx_t3sbootstrap_contextcolor'] ) {
+ $data['tx_t3sbootstrap_contextcolor'] = '';
+ }
+ if ( $data['tx_t3sbootstrap_textcolor'] ) {
+ $data['tx_t3sbootstrap_textcolor'] = '';
+ }
+ }
$class .= $data['tx_t3sbootstrap_textcolor'] ? ' text-'.$data['tx_t3sbootstrap_textcolor'] : '';
$class .= $data['tx_t3sbootstrap_contextcolor'] ? ' bg-'.$data['tx_t3sbootstrap_contextcolor'] : '';
@@ -363,7 +373,7 @@ public function getContainerClass($parentflexconf, $flexconf): string
*
* @return TypoScriptFrontendController
*/
- protected function getFrontendController(): \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
+ protected function getFrontendController(): TypoScriptFrontendController
{
return $GLOBALS['TSFE'];
}
diff --git a/Classes/Helper/WrapperHelper.php b/Classes/Helper/WrapperHelper.php
index 12925ca2..eae42089 100644
--- a/Classes/Helper/WrapperHelper.php
+++ b/Classes/Helper/WrapperHelper.php
@@ -96,6 +96,7 @@ public function getBackgroundWrapper($processedData, $flexconf, $cdnEnable=null,
$processedData['alignItem'] = $flexconf['alignVideoItem'] != 'none' ? ' '.$flexconf['alignVideoItem'] :'';
// aspect ratio
$processedData['aspectRatio'] = $flexconf['aspectRatio'];
+ $processedData['shift'] = $flexconf['shift'];
// prepare needed javascript
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
$overlayChild = $queryBuilder
@@ -246,7 +247,7 @@ public function getCardWrapper($processedData, $flexconf): array
case 6:
$processedData['flipper']['class'] = 'col-xs-12 col-sm-6 col-md-2';
break;
- default:
+ default:
$processedData['flipper']['class'] = 'col-xs-12 col-sm-6 col-md-4';
}
}
@@ -407,6 +408,7 @@ public function getCollapsible($processedData, $flexconf, $parentflexconf): arra
$processedData['show'] = $flexconf['active'] ? ' show' : '';
$processedData['collapsed'] = $flexconf['active'] ? '' : ' collapsed';
$processedData['expanded'] = $flexconf['active'] ? 'true' : 'false';
+ $processedData['alwaysOpen'] = $parentflexconf['alwaysOpen'] ? 'true' : 'false';
$processedData['buttonstyle'] = $flexconf['style'] ? $flexconf['style'] : 'primary';
$processedData['collapsibleByPid'] = $flexconf['collapsibleByPid'] ?: '';
$processedData['media'] = $file ? $file : '';
diff --git a/Classes/ViewHelpers/DummyImageViewHelper.php b/Classes/ViewHelpers/DummyImageViewHelper.php
new file mode 100644
index 00000000..7a64e9cc
--- /dev/null
+++ b/Classes/ViewHelpers/DummyImageViewHelper.php
@@ -0,0 +1,48 @@
+registerArgument('uid', 'string', 'Uid of tt_content with custom dummy image for EXT:news', false);
+ }
+
+ /**
+ * @param array $arguments
+ * @param \Closure $renderChildrenClosure
+ * @param RenderingContextInterface $renderingContext
+ */
+ public static function renderStatic(
+ array $arguments,
+ \Closure $renderChildrenClosure,
+ RenderingContextInterface $renderingContext
+ ) {
+
+ $fileRepository = GeneralUtility::makeInstance(FileRepository::class);
+ $fileObjects = $fileRepository->findByRelation('tt_content', 'image', (int)$arguments['uid']);
+ if (empty($fileObjects)) {
+ $fileObjects = $fileRepository->findByRelation('tt_content', 'assets', (int)$arguments['uid']);
+ }
+
+ return $fileObjects[0];
+ }
+
+}
diff --git a/Classes/ViewHelpers/GifbuilderViewHelper.php b/Classes/ViewHelpers/GifbuilderViewHelper.php
index 590e6c49..27d503aa 100644
--- a/Classes/ViewHelpers/GifbuilderViewHelper.php
+++ b/Classes/ViewHelpers/GifbuilderViewHelper.php
@@ -127,8 +127,4 @@ private function generateSrcsetImages( $file, $image ) {
return $bgImages;
}
-
-
-
-
}
diff --git a/Classes/ViewHelpers/MediaViewHelper.php b/Classes/ViewHelpers/MediaViewHelper.php
index c3c18a27..0c642cc1 100644
--- a/Classes/ViewHelpers/MediaViewHelper.php
+++ b/Classes/ViewHelpers/MediaViewHelper.php
@@ -52,6 +52,7 @@ public function initializeArguments()
$this->registerArgument('picturefill', 'bool', 'Use rendering suggested by picturefill.js', false, true);
$this->registerArgument('lazyload', 'int', 'Generate markup that supports lazyloading', false, 0);
$this->registerArgument('ratio', 'string', 'Image ratio', false, '');
+ $this->registerArgument('mobileNoRatio', 'bool', 'no aspect ratio for mobile', false, '');
$this->registerArgument('shift', 'string', 'Image shift', false, '');
$this->registerArgument('columns', 'int', 'Columns for Image Gallery', false, 0);
$this->registerArgument('placeholderSize', 'int', 'Size of the placeholder image for lazyloading (0 = disabled)', false, 0);
@@ -103,8 +104,16 @@ protected function renderPicture(FileInterface $image, $width, $height)
// Get crop variants
$cropString = $image instanceof FileReference ? $image->getProperty('crop') : '';
+ if ( $this->arguments['mobileNoRatio'] && $this->arguments['ratio'] ) {
+ $mobileImgManipulation = json_decode($cropString)->mobile;
+ }
if ( $this->arguments['ratio'] ) {
- $cropString = self::getCropString($image);
+ $cropString = self::getCropString($image, $cropString);
+ if ( $this->arguments['mobileNoRatio'] ) {
+ $cropObject = json_decode($cropString);
+ $cropObject->mobile = $mobileImgManipulation;
+ $cropString = json_encode($cropObject);
+ }
}
$cropVariantCollection = CropVariantCollection::create((string) $cropString);
@@ -116,7 +125,6 @@ protected function renderPicture(FileInterface $image, $width, $height)
// Generate fallback image
$fallbackImage = $this->generateFallbackImage($image, $width, $cropArea);
-
if ( $GLOBALS['_GET']['type'] == '98' ) {
$lazyload = 0;
} else {
@@ -157,7 +165,6 @@ protected function renderPicture(FileInterface $image, $width, $height)
$placeholderInline
);
-
return $this->tag->render();
}
@@ -175,8 +182,17 @@ protected function renderImageSrcset(FileInterface $image, $width, $height)
// Get crop variants
$cropString = $image instanceof FileReference ? $image->getProperty('crop') : '';
+ if ( $this->arguments['mobileNoRatio'] && $this->arguments['ratio'] ) {
+ $mobileImgManipulation = json_decode($cropString)->mobile;
+ }
+
if ( $this->arguments['ratio'] ) {
- $cropString = self::getCropString($image);
+ $cropString = self::getCropString($image, $cropString);
+ if ( $this->arguments['mobileNoRatio'] ) {
+ $cropObject = json_decode($cropString);
+ $cropObject->mobile = $mobileImgManipulation;
+ $cropString = json_encode($cropObject);
+ }
}
$cropVariantCollection = CropVariantCollection::create((string) $cropString);
@@ -266,8 +282,17 @@ protected function renderImageTag(FileInterface $image, $width, $height)
$cropVariant = 'default';
$cropString = $image instanceof FileReference ? $image->getProperty('crop') : '';
+ if ( $this->arguments['mobileNoRatio'] && $this->arguments['ratio'] ) {
+ $mobileImgManipulation = json_decode($cropString)->mobile;
+ }
+
if ( $this->arguments['ratio'] ) {
- $cropString = self::getCropString($image);
+ $cropString = self::getCropString($image, $cropString);
+ if ( $this->arguments['mobileNoRatio'] ) {
+ $cropObject = json_decode($cropString);
+ $cropObject->mobile = $mobileImgManipulation;
+ $cropString = json_encode($cropObject);
+ }
}
$cropVariantCollection = CropVariantCollection::create((string)$cropString);
@@ -330,48 +355,43 @@ protected function renderImageTag(FileInterface $image, $width, $height)
*
* @return string
*/
- protected function getCropString($image)
+ protected function getCropString($image, $cropString)
{
- $rArr = explode(':',$this->arguments['ratio']);
- $l = $rArr[0] / $rArr[1];
- $p = $rArr[1] / $rArr[0];
- $w = $image->getProperties()['height']/$image->getProperties()['width'] *$l;
- $h = 1;
- $x = $this->arguments['shift'] ? $this->arguments['shift'] : (1 - $w) / 2;
- $y = 0;
- if ( $w > 1 ) {
- $h = $image->getProperties()['width']/$image->getProperties()['height'] *$p;
- $w = 1;
- $x = 0;
- $y = $this->arguments['shift'] ? $this->arguments['shift'] : (1 - $h) / 2;
+ $cropObject = json_decode($cropString);
+
+ foreach($this->arguments['breakpoints'] as $cv) {
+ $cropVariant = $cv['cropVariant'];
+ $cropObject->$cropVariant->selectedRatio = $this->arguments['ratio'];
+ $cropObject->$cropVariant->cropArea->y = $this->arguments['shift'] ? $this->arguments['shift'] : $cropObject->$cropVariant->cropArea->y;
+ $cropedWidth = $image->getProperties()['width'] * $cropObject->$cropVariant->cropArea->width;
+ $cropedHeight = $image->getProperties()['height'] * $cropObject->$cropVariant->cropArea->height;
+ $rArr = explode(':',$this->arguments['ratio']);
+
+ if ( $rArr[0] > $rArr[1] ) {
+ // landscape
+ $pxHeight = $cropedWidth / $rArr[0] * $rArr[1];
+ $cHeight = $pxHeight / $image->getProperties()['height'];
+ $cropObject->$cropVariant->cropArea->height = $cHeight;
+ } 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];
+ $cWidth = $pxWidth / $image->getProperties()['width'];
+ $cropObject->$cropVariant->cropArea->width = $cWidth;
+ }
}
- $cropArray['default']['cropArea']['x'] = $x;
- $cropArray['default']['cropArea']['y'] = $y;
- $cropArray['default']['cropArea']['width'] = $w;
- $cropArray['default']['cropArea']['height'] = $h;
- $cropArray['default']['selectedRatio'] = $this->arguments['ratio'];
- $cropArray['default']['focusArea'] = null;
-
- $cropArray['tablet']['cropArea']['x'] = $x;
- $cropArray['tablet']['cropArea']['y'] = $y;
- $cropArray['tablet']['cropArea']['width'] = $w;
- $cropArray['tablet']['cropArea']['height'] = $h;
- $cropArray['tablet']['selectedRatio'] = $this->arguments['ratio'];
- $cropArray['tablet']['focusArea'] = null;
-
- $cropArray['mobile']['cropArea']['x'] = $x;
- $cropArray['mobile']['cropArea']['y'] = $y;
- $cropArray['mobile']['cropArea']['width'] = $w;
- $cropArray['mobile']['cropArea']['height'] = $h;
- $cropArray['mobile']['selectedRatio'] = $this->arguments['ratio'];
- $cropArray['mobile']['focusArea'] = null;
-
- $object = (object)$cropArray;
-
- return json_encode($object);
-
+ return json_encode($cropObject);
}
-
}
diff --git a/Configuration/FlexForms/CardSetting.xml b/Configuration/FlexForms/CardSetting.xml
index 05e667f9..bacc37ae 100644
--- a/Configuration/FlexForms/CardSetting.xml
+++ b/Configuration/FlexForms/CardSetting.xml
@@ -55,6 +55,43 @@
+
Folgendes Template auslagern und anpassen:
Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom1.htmldiff --git a/Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom2.html b/Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom2.html index 1dada911..e1634840 100644 --- a/Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom2.html +++ b/Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom2.html @@ -1,5 +1,5 @@
Folgendes Template auslagern und anpassen:
Resources/Private/Extensions/news/Resources/Private/Partials/Detail/Custom1.htmldiff --git a/Resources/Private/Extensions/news/Resources/Private/Partials/List/Card.html b/Resources/Private/Extensions/news/Resources/Private/Partials/List/Card.html index 46182bb6..87eb78d8 100644 --- a/Resources/Private/Extensions/news/Resources/Private/Partials/List/Card.html +++ b/Resources/Private/Extensions/news/Resources/Private/Partials/List/Card.html @@ -1,4 +1,5 @@