Skip to content

Commit

Permalink
Merge pull request #195 from t3solution/5.1.9
Browse files Browse the repository at this point in the history
New release v5.1.9
  • Loading branch information
t3solution authored Apr 26, 2022
2 parents 5cb9ce6 + 2610691 commit 41f08a3
Show file tree
Hide file tree
Showing 105 changed files with 2,130 additions and 3,916 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

/**
* ConfigController
*/
class ConfigController extends ActionController
{

Expand Down Expand Up @@ -106,10 +102,10 @@ class ConfigController extends ActionController
protected $rootTemplates;


protected $persistenceManager;
protected $persistenceManager;


public function __construct(
public function __construct(
ConfigRepository $configRepository,
PersistenceManager $persistenceManager
)
Expand Down Expand Up @@ -453,7 +449,6 @@ protected function overrideConfig(): array
}
}
}

}

return $override;
Expand Down Expand Up @@ -564,12 +559,15 @@ public function writeConstants(): void
$configRepository = $this->configRepository->findOneByPid($this->rootPageId);
$navbarBreakpoint = $configRepository->getNavbarBreakpoint();
$breakpointWidth = $this->settings['breakpoint'][$navbarBreakpoint];

$siteroots = [];
$filecontent = '';

foreach( $this->configRepository->findAll() as $config ) {
$page = GeneralUtility::makeInstance(PageRepository::class)->getPage($config->getPid());
if ( $page['hidden'] === 0 && $page['deleted'] === 0 ) {
if (!empty($page['is_siteroot'])) {
$siteroots[$config->getUid()] = $page['is_siteroot'];
}
$pages[$config->getPid()] = $page;
$configurations[$config->getPid()] = $config;
}
Expand All @@ -578,7 +576,7 @@ public function writeConstants(): void
foreach ( $configurations as $config ) {
if ($config->getPid() == $config->getHomepageUid()) {
// is root page
if ( count($configurations) === 1 ) {
if ( count($siteroots) === 1 ) {
$filecontent .= self::getConstants($config, TRUE);
$filecontent .= 'bootstrap.config.navbarBreakpointWidth = '.$breakpointWidth.PHP_EOL;
} else {
Expand All @@ -587,7 +585,6 @@ public function writeConstants(): void
$filecontent .= 'bootstrap.config.navbarBreakpointWidth = '.$breakpointWidth.PHP_EOL;
$filecontent .= '[END]'.PHP_EOL.PHP_EOL;
}

} else {
if ($config->getGeneralRootline()) {
$filecontent .= '['.$config->getPid().' in tree.rootLineIds]'.PHP_EOL;
Expand All @@ -598,7 +595,6 @@ public function writeConstants(): void
$filecontent .= '[END]'.PHP_EOL.PHP_EOL;
}
}

$customDir = 'fileadmin/T3SB/Configuration/TypoScript/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 't3sbconstants.typoscript';
Expand Down Expand Up @@ -678,7 +674,6 @@ private function getTcaColumns(): array
private function getUtilityColors(): array
{
$defaultUtilColorsList = '$white,$gray-100,$gray-200,$gray-300,$gray-400,$gray-500,$gray-600,$gray-700,$gray-800,$gray-900,$black,$blue,$indigo,$purple,$pink,$red,$orange,$yellow,$green,$teal,$cyan,$primary,$secondary,$success,$info,$warning,$danger,$light,$dark';
# $defaultUtilColorsList = '$gray-100,$gray-200,$gray-300,$gray-400,$gray-500,$gray-600,$gray-700,$gray-800,$gray-900,$black,$blue,$indigo,$purple,$pink,$red,$orange,$yellow,$green,$teal,$cyan,$primary,$secondary,$success,$info,$warning,$danger,$light,$dark';
$utilityColors = [];
$utilColors = [];
$colors = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

/**
* ConsentController
*/
class ConsentController extends ActionController
{

Expand Down
12 changes: 4 additions & 8 deletions Classes/Backend/FormDataProvider/FlexFormManipulation.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@

namespace T3SBS\T3sbootstrap\Backend\FormDataProvider;

use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager;

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

use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager;

/**
* Fill the news records with default values
*/
class FlexFormManipulation implements FormDataProviderInterface
{

Expand Down
7 changes: 5 additions & 2 deletions Classes/Backend/Preview/DefaultPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string

if ($record['CType'] == 't3sbs_gallery') {
$out .= 'Columns: '.$record['imagecols'];
if ($record['CType'] == 't3sbs_gallery') {
$out .= '<br />Aspect ratio: '.$record['tx_t3sbootstrap_image_ratio'];
if ( !empty($record['tx_t3sbootstrap_image_ratio'])) {
$out .= '<br />Aspect ratio: '.$record['tx_t3sbootstrap_image_ratio'];
}
if ( !empty($record['file_collections'])) {
$out .= '<br />File collection UID(s): '.$record['file_collections'];
}
}
if ($record['CType'] === 't3sbs_card') {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Backend/Preview/T3sbPreviewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ public function renderPageModulePreviewContent(GridColumnItem $item): string
$out .= '<br />- row-cols-xxl: '.$flexconf['xxl_rowclass'];
}
} else {
if ( !empty($flexconf['equalWidth']) ) {
if ( !empty($flexconf['equalWidth']) ) {
$out .= '<br />- Equal Width';
}
}
}
if ( !empty($flexconf['horizontalGutters'])) {
$out .= '<br />- Horizontal gutters: '.$flexconf['horizontalGutters'];
Expand Down
8 changes: 2 additions & 6 deletions Classes/Command/CdnToLocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/

/**
* Command for update CDN to LOCAL
*/
class CdnToLocal extends Command
{

Expand Down Expand Up @@ -174,7 +170,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$customFileName = 'halkaBox.min.css';
$cdnPath = 'https://cdn.jsdelivr.net/npm/halkabox@'.$version.'/dist/'.$customFileName;
self::writeCustomFile($customPath, $customFileName, $cdnPath, true);

$customDir = 'fileadmin/T3SB/Resources/Public/JS/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'halkaBox.min.js';
Expand All @@ -193,7 +189,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'glightbox.min.js';
$cdnPath = 'https://cdn.jsdelivr.net/npm/glightbox@'.$version.'/dist/js/'.$customFileName;
self::writeCustomFile($customPath, $customFileName, $cdnPath);
self::writeCustomFile($customPath, $customFileName, $cdnPath);
}

if ($key == 'cookieconsent') {
Expand Down
6 changes: 1 addition & 5 deletions Classes/Command/CustomScss.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
/**
* Command for update Custom SCSS
*/
class CustomScss extends Command
{

Expand Down Expand Up @@ -252,8 +249,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$message = GeneralUtility::makeInstance(FlashMessage::class,
'You have to activate SCSS in the EM config!',
'T3S Bootstrap - Custom SCSS',
FlashMessage::ERROR,
true
FlashMessage::ERROR
);

$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
Expand Down
73 changes: 73 additions & 0 deletions Classes/Components/Button.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
declare(strict_types=1);

namespace T3SBS\T3sbootstrap\Components;

use TYPO3\CMS\Core\SingletonInterface;

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

/**
* Returns the $processedData
*/
public function getProcessedData(array $processedData, array $flexconf, array $parentflexconf): array
{
$outline = !empty($flexconf['outline']) ? 'outline-':'';
$style = !empty($flexconf['style']) ? $flexconf['style'] : '';
$typolinkButtonClass = ' btn btn-'.$outline.$style;
$typolinkButtonClass .= !empty($flexconf['btnsize']) && $flexconf['btnsize'] != 'default' ? ' '.$flexconf['btnsize']:'';
if ( empty($parentflexconf) ) {
$processedData['btn-block'] = false;
if (!empty($flexconf['block'])) {
$processedData['btn-block'] = true;
}
}
$headerPosition = '';
if ($processedData['data']['header_position']) {
$headerPosition = $processedData['data']['header_position'];
if ( $headerPosition == 'left' ) $headerPosition = '';
if ( $headerPosition == 'center' ) $headerPosition = 'text-center';
if ( $headerPosition == 'right' ) $headerPosition = 'd-md-flex justify-content-md-end';
}

$processedData['headerPosition'] = $headerPosition;

if ( $flexconf['fixedPosition'] ) {
$typolinkButtonClass .= ' d-none fixedPosition fixedPosition-'.$flexconf['fixedPosition'];
$typolinkButtonClass .= !empty($flexconf['rotate']) ? ' rotateFixedPosition rotate-'.$flexconf['rotate'] : '';
$processedData['fixedButton'] = $flexconf['fixedPosition'];
}

$processedData['linkTitle'] = $flexconf['linkTitle'];
$processedData['slideInButton'] = FALSE;
$processedData['slideInButtonFaIcon'] = FALSE;

if ( !empty($parentflexconf['fixedPosition']) && $parentflexconf['fixedPosition'] == 'right'
&& $parentflexconf['slideIn']
&& $parentflexconf['visiblePart']
&& $parentflexconf['vertical']
) {
// slide in button
$processedData['slideInButton'] = TRUE;

if ( $processedData['data']['tx_t3sbootstrap_header_fontawesome'] ) {
$processedData['slideInButtonFaIcon'] = TRUE;
} else {
$processedData['data']['tx_t3sbootstrap_header_fontawesome'] = 'fas fa-ban text-danger';
$processedData['slideInButtonFaIcon'] = TRUE;
}
}

$processedData['class'] .= $typolinkButtonClass;

return $processedData;
}

}
Loading

0 comments on commit 41f08a3

Please sign in to comment.