Skip to content

Commit

Permalink
v4.4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
t3solution committed May 10, 2020
1 parent 4fa81c2 commit 113a245
Show file tree
Hide file tree
Showing 71 changed files with 844 additions and 2,159 deletions.
7 changes: 4 additions & 3 deletions Classes/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class ConfigController extends ActionController
protected $version;



/**
* Inject a configRepository repository to enable DI
*
Expand Down Expand Up @@ -221,7 +222,7 @@ public function createAction(\T3SBS\T3sbootstrap\Domain\Model\Config $newConfig)
$newConfig->setPid((int)$_GET['id']);
$this->configRepository->add($newConfig);

$this->redirect('list');
parent::redirect('list');
}


Expand Down Expand Up @@ -289,7 +290,7 @@ public function updateAction(\T3SBS\T3sbootstrap\Domain\Model\Config $config)
$config->setHomepageUid($homepageUid);

$this->configRepository->update($config);
$this->redirect('edit',NULL,Null,array('config' => $config));
parent::redirect('edit',NULL,Null,array('config' => $config));
}


Expand All @@ -303,7 +304,7 @@ public function deleteAction(\T3SBS\T3sbootstrap\Domain\Model\Config $config)
{
$this->addFlashMessage('The object was deleted.');
$this->configRepository->remove($config);
$this->redirect('list');
parent::redirect('list');
}


Expand Down
4 changes: 3 additions & 1 deletion Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData['containerPost'] = '</div>';
$processedData['container'] = $container;
}

if ($processedData['be_layout'] == 'OneCol' && !$container) {
$pageContainer = self::getFrontendController()->page['tx_t3sbootstrap_container'] ? TRUE : FALSE;
if (!$pageContainer && !$processedData['data']['tx_gridelements_container']) {
Expand Down Expand Up @@ -461,7 +462,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData['data']['tx_t3sbootstrap_animateCss'] = FALSE;
}
if ($processedData['data']['tx_t3sbootstrap_animateCss'] && $extConf['animateCss'] ) {
$delay = $processedData['data']['tx_t3sbootstrap_animateCssDelay'] ? ' delay-'.$processedData['data']['tx_t3sbootstrap_animateCssDelay'].'s' : '';

$delay = $processedData['data']['tx_t3sbootstrap_animateCssDelay'] ? ' delay-'.$processedData['data']['tx_t3sbootstrap_animateCssDelay'] : '';
// add to class
if( $processedData['data']['tx_t3sbootstrap_animateCssRepeat'] ) {
$processedData['class'] .= ' animated bt_hidden '.$delay;
Expand Down
553 changes: 346 additions & 207 deletions Classes/DataProcessing/ConfigProcessor.php

Large diffs are not rendered by default.

58 changes: 44 additions & 14 deletions Classes/DataProcessing/GalleryProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ class GalleryProcessor implements DataProcessorInterface
*/
protected $maxWidthToast;

/**
* @var boolean
*/
protected $disableAutoRow;

/**
* @var array
*/
Expand All @@ -220,7 +225,6 @@ class GalleryProcessor implements DataProcessorInterface
protected $contentContainer;



/**
* Process data for a gallery, for instance the CType "textmedia"
*
Expand Down Expand Up @@ -258,6 +262,10 @@ public function process(
throw new ContentRenderingException('No files found for key ' . $filesProcessedDataKey . ' in $processedData.', 1436809789);
}

if (empty($this->fileObjects)) {
return $processedData;
}

$this->numberOfColumns = (int)$this->getConfigurationValue('numberOfColumns', 'imagecols');
$this->mediaOrientation = (int)$this->getConfigurationValue('mediaOrientation', 'imageorient');
$this->maxGalleryWidth = (int)$this->getConfigurationValue('maxGalleryWidth') ?: 1140;
Expand All @@ -277,6 +285,7 @@ public function process(
$this->rowWidth = $processedData['data']['tx_t3sbootstrap_inTextImgRowWidth'];
$this->maxWidthMediaObject = $this->getConfigurationValue('maxWidthMediaObject');
$this->maxWidthToast = $this->getConfigurationValue('maxWidthToast');
$this->disableAutoRow = $this->getConfigurationValue('disableAutoRow');

$this->determineGalleryPosition();
$this->calculateRowsAndColumns();
Expand Down Expand Up @@ -345,6 +354,10 @@ protected function determineGalleryPosition()
protected function determineMaximumGalleryWidth()
{

if ( $this->rowWidth == 'auto' && $this->disableAutoRow ) {
$this->rowWidth == 'none';
}

if ( $this->rowWidth == 'auto' ) {

if ( $this->cType == 'textmedia' || $this->cType == 'textpic' || $this->cType == 'image' ) {
Expand Down Expand Up @@ -408,10 +421,10 @@ protected function calculateRowsAndColumns()
{
// If no columns defined, set it to 1
$columns = max((int)$this->numberOfColumns, 1);

if ($columns === 88) {
$columns = 1;
} else {
} else {
// When more columns than media elements, set the columns to the amount of media elements
if ($columns > $this->galleryData['count']['files']) {
$columns = $this->galleryData['count']['files'];
Expand Down Expand Up @@ -469,7 +482,7 @@ protected function calculateMediaWidthsAndHeights()
// nax media width
$mediaWidth = $bsMaxGridWidth;

if ( $this->rowWidth != 'none' ) {
if ( $this->rowWidth && $this->rowWidth != 'none' ) {
$rowWidth = (int) end(explode('-', $this->rowWidth));
} else {
$rowWidth = 100;
Expand All @@ -478,8 +491,12 @@ protected function calculateMediaWidthsAndHeights()
// calculate the default padding
$padding = self::getDefaultPadding($rowWidth);

if ( $this->colPos == 0 || $this->colPos == 1 || $this->colPos == 2 || $this->colPos === -1 ) {

if ( $this->colPos == 0
|| $this->colPos == 1
|| $this->colPos == 2
|| ($this->colPos === -1 && $this->parentgridColPos < 3)
)
{
if ($this->beLayout == 'OneCol') {
$galleryWidth = ($bsMaxGridWidth * $rowWidth / 100 - $padding) - ($this->galleryData['count']['columns']-1) * 16;
$mediaWidth = $galleryWidth / $this->galleryData['count']['columns'];
Expand Down Expand Up @@ -521,7 +538,12 @@ protected function calculateMediaWidthsAndHeights()
}

// Jumbotron, footer && expanded content
if ( $this->colPos == 3 || $this->colPos == 4 || $this->colPos == 20 || $this->colPos == 21 || $this->colPos === -1 )
if ( $this->colPos == 3
|| $this->colPos == 4
|| $this->colPos == 20
|| $this->colPos == 21
|| ($this->colPos === -1 && $this->parentgridColPos > 2)
)
{
$galleryWidth = ($bsMaxGridWidth * $rowWidth / 100 - $padding) - ($this->galleryData['count']['columns']-1) * 16;
$mediaWidth = $galleryWidth / $this->galleryData['count']['columns'];
Expand Down Expand Up @@ -549,11 +571,7 @@ protected function calculateMediaWidthsAndHeights()
// User entered a predefined width
if ($this->equalMediaWidth) {

if ( $this->equalMediaWidth < $mediaWidth ) {
$mediaWidth = $this->equalMediaWidth;
}

if ( $this->rowWidth == 'none' ) {
if ( ($this->equalMediaWidth < floor($mediaWidth)) || $this->rowWidth == 'none' ) {
$mediaWidth = $this->equalMediaWidth;
}

Expand All @@ -562,6 +580,14 @@ protected function calculateMediaWidthsAndHeights()
$mediaWidth = 575;
}

if ( $this->cType == 't3sbs_mediaobject' && $this->maxWidthMediaObject < $mediaWidth ) {
$mediaWidth = $this->maxWidthMediaObject;
}

if ( $this->cType == 't3sbs_toast' && $this->maxWidthToast < $mediaWidth ) {
$mediaWidth = $this->maxWidthToast;
}

// User entered a predefined width & height
if ($this->equalMediaHeight) {

Expand Down Expand Up @@ -623,11 +649,11 @@ protected function calculateMediaWidthsAndHeights()
$mediaWidth = 575;
}

if ( $this->cType == 't3sbs_mediaobject' ) {
if ( $this->cType == 't3sbs_mediaobject' && $this->maxWidthMediaObject < $mediaWidth ) {
$mediaWidth = $this->maxWidthMediaObject;
}

if ( $this->cType == 't3sbs_toast' ) {
if ( $this->cType == 't3sbs_toast' && $this->maxWidthToast < $mediaWidth ) {
$mediaWidth = $this->maxWidthToast;
}

Expand All @@ -645,6 +671,10 @@ protected function calculateMediaWidthsAndHeights()
}
}





$this->galleryData['width'] = floor($mediaWidth);
}

Expand Down
37 changes: 28 additions & 9 deletions Classes/Helper/DefaultHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getContainerClass($data)

$pageContainer = self::getFrontendController()->page['tx_t3sbootstrap_container'] ? TRUE : FALSE;

if ( $pageContainer === FALSE && $data['colPos'] === 0 ) {
if ( $pageContainer === FALSE && ($data['colPos'] === 0 || $data['parentgrid_colPos'] === 0) ) {
$container = $data['tx_t3sbootstrap_container'];
} else {

Expand All @@ -44,12 +44,24 @@ public function getContainerClass($data)
$footerContainer = $t3sbconfig[0]['footer_container'];
$expandedcontentTopContainer = $t3sbconfig[0]['expandedcontent_containertop'];
$expandedcontentBottomContainer = $t3sbconfig[0]['expandedcontent_containerbottom'];

$footerByPid = $t3sbconfig[0]['footer_pid'];

if(!empty($t3sbconfig)) break;
}
if ( $data['colPos'] === 3 && !$jumbotronContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( $data['colPos'] === 4 && !$footerContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( $data['colPos'] === 20 && !$expandedcontentTopContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( $data['colPos'] === 21 && !$expandedcontentBottomContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( ($data['colPos'] === 3 || $data['parentgrid_colPos'] === 3)
&& !$jumbotronContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( ($data['colPos'] === 4 || $data['parentgrid_colPos'] === 4)
&& !$footerContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( ($data['colPos'] === 20 || $data['parentgrid_colPos'] === 20)
&& !$expandedcontentTopContainer ) $container = $data['tx_t3sbootstrap_container'];
if ( ($data['colPos'] === 21 || $data['parentgrid_colPos'] === 21)
&& !$expandedcontentBottomContainer ) $container = $data['tx_t3sbootstrap_container'];

if ($footerByPid && ($data['colPos'] === 0 || $data['parentgrid_colPos'] === 0)) {
$container = 'colPosContainer';
}

}

} else {
Expand All @@ -62,13 +74,20 @@ public function getContainerClass($data)
$footerContainer = $t3sbconfig[0]['footer_container'];
$expandedcontentTopContainer = $t3sbconfig[0]['expandedcontent_containertop'];
$expandedcontentBottomContainer = $t3sbconfig[0]['expandedcontent_containerbottom'];

$footerByPid = $t3sbconfig[0]['footer_pid'];

if(!empty($t3sbconfig)) break;
}
if ( $data['colPos'] === 3 && $jumbotronContainer ) $container = 'colPosContainer';
if ( $data['colPos'] === 4 && $footerContainer ) $container = 'colPosContainer';
if ( $data['colPos'] === 20 && $expandedcontentTopContainer ) 'colPosContainer';
if ( $data['colPos'] === 21 && $expandedcontentBottomContainer ) 'colPosContainer';

if ( ($data['colPos'] === 3 || $data['parentgrid_colPos'] === 3) && $jumbotronContainer ) $container = 'colPosContainer';
if ( ($data['colPos'] === 4 || $data['parentgrid_colPos'] === 4) && $footerContainer ) $container = 'colPosContainer';
if ( ($data['colPos'] === 20 || $data['parentgrid_colPos'] === 20) && $expandedcontentTopContainer ) $container = 'colPosContainer';
if ( ($data['colPos'] === 21 || $data['parentgrid_colPos'] === 21) && $expandedcontentBottomContainer ) $container = 'colPosContainer';

if ($footerByPid && ($data['colPos'] === 0 || $data['parentgrid_colPos'] === 0)) {
$container = 'colPosContainer';
}
}

return trim($container);
Expand Down
11 changes: 7 additions & 4 deletions Classes/Tasks/CdnToLocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function execute() {
$customDir = 'fileadmin/T3SB/Resources/Public/JS/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'popper.js';
$cdnPath = 'https://unpkg.com/@popperjs/core@'.$version;
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/'.$version.'/umd/popper.min.js';
self::writeCustomFile($customPath, $customFileName, $cdnPath);
}

Expand All @@ -97,14 +97,17 @@ public function execute() {
$customFileName = 'highlight.default.min.css';
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'.$version.'/styles/default.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath);


$customFileName = 'highlight.a11y-light.min.css';
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'.$version.'/styles/a11y-light.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath);
$customDir = 'fileadmin/T3SB/Resources/Public/JS/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'highlight.min.js';
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'.$version.'/highlight.min.js';
self::writeCustomFile($customPath, $customFileName, $cdnPath);

$customFileName = 'highlight.php.min.js';
$cdnPath = 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/'.$version.'/languages/php.min.js';
self::writeCustomFile($customPath, $customFileName, $cdnPath);
}

if ($key == 'lazyload') {
Expand Down
8 changes: 4 additions & 4 deletions Classes/ViewHelpers/SplitFileRefViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ public static function renderStatic(array $arguments, \Closure $renderChildrenCl

$fileParts = GeneralUtility::split_fileref($file->getPublicUrl());

$image= $fileParts['path'].$fileParts['filebody'].'.jpg';
$fileParts['imgext'] = 'jpg';
$image= $fileParts['path'].$fileParts['filebody'].'.jpg';
$fileParts['imgext'] = 'jpg';

if (!file_exists($image)) {
if (!file_exists($image)) {
$image= $fileParts['path'].$fileParts['filebody'].'.png';
$fileParts['imgext'] = 'png';
}
}

$templateVariableContainer->add($arguments['as'], $fileParts);
$content = $renderChildrenClosure();
Expand Down
2 changes: 1 addition & 1 deletion Configuration/FlexForms/CardContent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
</T3DataStructure>
8 changes: 4 additions & 4 deletions Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,21 @@
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
't3sbootstrap',
'Configuration/TSConfig/Registered/Textpic.typoscript',
'Configuration/TSConfig/Registered/Textpic.tsconfig',
'Remove CType textpic'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
't3sbootstrap',
'Configuration/TSConfig/Registered/Text.typoscript',
'Configuration/TSConfig/Registered/Text.tsconfig',
'Remove CType text'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
't3sbootstrap',
'Configuration/TSConfig/Registered/Image.typoscript',
'Configuration/TSConfig/Registered/Image.tsconfig',
'Remove CType image'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
't3sbootstrap',
'Configuration/TSConfig/Registered/Header.typoscript',
'Configuration/TSConfig/Registered/Header.tsconfig',
'Remove CType header'
);
2 changes: 1 addition & 1 deletion Configuration/TCA/Overrides/sys_file_reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
unset($tempSysFileReferenceColumns);


TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('sys_file_reference', 'imageoverlayPalette','--linebreak--,tx_t3sbootstrap_description_align','after:description');
TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('sys_file_reference', 'imageoverlayPalette','--linebreak--,tx_t3sbootstrap_description_align','after:title');

TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette('sys_file_reference', 'imageoverlayPalette','--linebreak--,tx_t3sbootstrap_extra_class','after:tx_t3sbootstrap_description_align');

Expand Down
22 changes: 17 additions & 5 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@
# if typoscript_rendering is loaded
if ( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('typoscript_rendering') ) {

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'T3SBS.T3sbootstrap',
'Pi1',
'Content Consent'
);
if (version_compare(TYPO3_branch, '10.0', '>=')) {

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'T3sbootstrap',
'Pi1',
'Content Consent'
);

} else {

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'T3SBS.T3sbootstrap',
'Pi1',
'Content Consent'
);

}

$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase('t3sbootstrap');
$pluginSignature = strtolower($extensionName) . '_pi1';
Expand Down
Loading

0 comments on commit 113a245

Please sign in to comment.