Skip to content

Commit

Permalink
Merge pull request #162 from t3solution/5.1.4
Browse files Browse the repository at this point in the history
New release v5.1.4
  • Loading branch information
t3solution authored Nov 3, 2021
2 parents 19e589c + b4904c9 commit 6baa6c0
Show file tree
Hide file tree
Showing 83 changed files with 2,885 additions and 9,661 deletions.
22 changes: 11 additions & 11 deletions Classes/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
*/
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
{
Expand All @@ -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
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
{
Expand Down
34 changes: 22 additions & 12 deletions Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'] = '';
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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']);
Expand All @@ -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'];
}
Expand Down
10 changes: 9 additions & 1 deletion Classes/DataProcessing/CardProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
5 changes: 5 additions & 0 deletions Classes/DataProcessing/GalleryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ class GalleryProcessor implements DataProcessorInterface
*/
protected $disableAutoRow;

/**
* @var string
*/
protected $parentflexconf;

/**
* @var array
*/
Expand Down
12 changes: 11 additions & 1 deletion Classes/Helper/ClassHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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'] : '';

Expand Down Expand Up @@ -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'];
}
Expand Down
4 changes: 3 additions & 1 deletion Classes/Helper/WrapperHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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';
}
}
Expand Down Expand Up @@ -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 : '';
Expand Down
48 changes: 48 additions & 0 deletions Classes/ViewHelpers/DummyImageViewHelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
namespace T3SBS\T3sbootstrap\ViewHelpers;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Core\Resource\FileRepository;

/**
* This file is part of the TYPO3 extension t3sbootstrap.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/

class DummyImageViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;

/**
*/
public function initializeArguments()
{
$this->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];
}

}
4 changes: 0 additions & 4 deletions Classes/ViewHelpers/GifbuilderViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,4 @@ private function generateSrcsetImages( $file, $image ) {
return $bgImages;
}





}
Loading

0 comments on commit 6baa6c0

Please sign in to comment.