Skip to content

Commit

Permalink
Merge pull request #310 from t3solution/5.2.11
Browse files Browse the repository at this point in the history
New release v5.2.11
  • Loading branch information
t3solution authored Apr 10, 2023
2 parents 12369b5 + 73678c7 commit 8f58e96
Show file tree
Hide file tree
Showing 13 changed files with 236 additions and 17 deletions.
9 changes: 8 additions & 1 deletion Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
class BootstrapProcessor implements DataProcessorInterface
{
const TX_CONTAINER_GRID = 'two_columns,three_columns,four_columns,six_columns,row_columns';
const T3SBS_ELEMENTS = 't3sbs_mediaobject,t3sbs_card,t3sbs_carousel,t3sbs_button,t3sbs_fluidtemplate,t3sbs_gallery,t3sbs_toast';
const T3SBS_ELEMENTS = 't3sbs_mediaobject,t3sbs_card,t3sbs_carousel,t3sbs_button,t3sbs_fluidtemplate,t3sbs_gallery,t3sbs_toast,t3sbs_assets';
const TX_CONTAINER = 'button_group,background_wrapper,parallax_wrapper,autoLayout_row,container,carousel_container,collapsible_container,collapsible_accordion,modal,tabs_container,tabs_tab,listGroup_wrapper,masonry_wrapper,swiper_container,toast_container,card_wrapper';

/**
Expand Down Expand Up @@ -157,6 +157,13 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$processedData = GeneralUtility::makeInstance(Toast::class)
->getProcessedData($processedData, $flexconf);
}
if ( $cType == 't3sbs_assets' ) {
$pi_flexconf = $flexFormService->convertFlexFormContentToArray($processedData['data']['pi_flexform']);
if (!empty($pi_flexconf)) {
$processedData['assets']['jquery'] = $pi_flexconf['settings']['jquery'];
$processedData['assets']['priority'] = $pi_flexconf['settings']['priority'];
}
}
#if ( $cType == 't3sbs_fluidtemplate' ) {}
#if ( $cType == 't3sbs_gallery' ) {}
}
Expand Down
34 changes: 24 additions & 10 deletions Classes/Hooks/FlexFormHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,35 @@
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
class NewsFlexFormHook
class FlexFormHook
{

public function parseDataStructureByIdentifierPostProcess(array $dataStructure, array $identifier): array
{
$extconf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3sbootstrap');

if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content'
&& ($identifier['dataStructureKey'] === 'news_pi1,list' || $identifier['dataStructureKey'] === '*,news_pi1'
|| $identifier['dataStructureKey'] === '*,news_newsdetail') ) {
$file = Environment::getPublicPath() . '/typo3conf/ext/t3sbootstrap/Resources/Private/Extensions/news/Configuration/FlexForms/News.xml';
$content = file_get_contents($file);
if ($content) {
$dataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content);
$ffPath = '/fileadmin/T3SB/FlexForms/';

foreach ( $GLOBALS['TCA']['tt_content']['columns']['tx_t3sbootstrap_flexform']['config']['ds'] as $key=>$flexForm ) {

$flexForms[$key] = substr($flexForm, 46, -4);
}
}
return $dataStructure;

if ( array_key_exists($identifier['dataStructureKey'],$flexForms) ) {

if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content'
&& $identifier['fieldName'] === 'tx_t3sbootstrap_flexform' && $identifier['dataStructureKey']) {

$file = Environment::getPublicPath() . $ffPath.$flexForms[$identifier['dataStructureKey']].'.xml';

$content = file_exists($file) ? file_get_contents($file) : '';

if ($content) {
$dataStructure['sheets']['extraEntry'] = GeneralUtility::xml2array($content);
}
}
}

return $dataStructure;
}
}
3 changes: 2 additions & 1 deletion Classes/Hooks/NewsFlexFormHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public function parseDataStructureByIdentifierPostProcess(array $dataStructure,
{

if ($identifier['type'] === 'tca' && $identifier['tableName'] === 'tt_content'
&& ($identifier['dataStructureKey'] === 'news_pi1,list' || $identifier['dataStructureKey'] === '*,news_pi1') ) {
&& ($identifier['dataStructureKey'] === 'news_pi1,list' || $identifier['dataStructureKey'] === '*,news_pi1'
|| $identifier['dataStructureKey'] === '*,news_newsdetail') ) {
$file = Environment::getPublicPath() . '/typo3conf/ext/t3sbootstrap/Resources/Private/Extensions/news/Configuration/FlexForms/News.xml';
$content = file_get_contents($file);
if ($content) {
Expand Down
33 changes: 33 additions & 0 deletions Configuration/FlexForms/AssetInline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<T3DataStructure>
<sheets>
<sDEF>
<ROOT>
<type>array</type>
<TCEforms>
<sheetTitle>Inline JavaScript Settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<settings.jquery>
<TCEforms>
<label>jQuery Framework</label>
<description>Enable if you use jquery.</description>
<config>
<type>check</type>
</config>
</TCEforms>
</settings.jquery>
<settings.priority>
<TCEforms>
<label>Priority</label>
<description>Define whether the JavaScript should be put in the &lt;head&gt; tag above-the-fold or somewhere in the body part.</description>
<config>
<type>check</type>
</config>
</TCEforms>
</settings.priority>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
13 changes: 9 additions & 4 deletions Configuration/Icons.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
<?php
return [

'buttongroup' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
'name' => 'bars',
'additionalClasses' => 'fa-solid fa-bars',
'buttongroup' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\FontawesomeIconProvider::class,
'name' => 'bars',
'additionalClasses' => 'fa-solid fa-bars',
],

'cssJsIcon' => [
'provider' => \TYPO3\CMS\Core\Imaging\IconProvider\BitmapIconProvider::class,
'source' => 'EXT:t3sbootstrap/Resources/Public/Icons/Register/css-javascript.png',
],

];
52 changes: 52 additions & 0 deletions Configuration/TCA/Overrides/tt_content.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,17 @@
/***************
* Add new CTypes
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
[
'Plain CSS or JavaScript inline',
't3sbs_assets',
'cssJsIcon',
],
'textmedia',
'after'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'tt_content',
'CType',
Expand Down Expand Up @@ -1249,6 +1260,47 @@
unset($tempContentColumns);


/***************
* Assets Inline
*/
$GLOBALS['TCA']['tt_content']['types']['t3sbs_assets'] = [
'showitem' => '
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
--palette--;;general,
header; Internal title (not displayed),
--div--;Java Script,
bodytext;JavaScript,
pi_flexform; Inline JavaScript Settings,
--div--;CSS,
tx_t3sbootstrap_bodytext;CSS,
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
--palette--;;hidden
',
'columnsOverrides' => [
'bodytext' => [
'config' => [
'format' => 'javascript',
'renderType' => 't3editor',
'wrap' => 'off',
],
],
'tx_t3sbootstrap_bodytext' => [
'config' => [
'format' => 'css',
'renderType' => 't3editor',
'wrap' => 'off',
],
],
],
];

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
'*',
'FILE:EXT:t3sbootstrap/Configuration/FlexForms/AssetInline.xml',
't3sbs_assets'
);


/***************
* Button - t3sbs_button
*/
Expand Down
10 changes: 10 additions & 0 deletions Configuration/TSConfig/NewContentElements.tsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ mod.wizards {
common.elements {
textmedia.tt_content_defValues.imageorient = 0
}
special.elements {
t3sbsassets {
iconIdentifier = cssJsIcon
title = Plain CSS or JavaScript
description = With this element you can insert raw JS or CSS code on the page.
tt_content_defValues.CType = t3sbs_assets
}
}
t3sbs {
header = LLL:EXT:t3sbootstrap/Resources/Private/Language/locallang_be.xlf:t3sbs_contentelements
elements {
Expand Down Expand Up @@ -58,3 +66,5 @@ mod.wizards {
}
}
}
mod.wizards.newContentElement.wizardItems.special.show := addToList(t3sbsassets)

50 changes: 50 additions & 0 deletions Configuration/TSConfig/Page.tsconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@

#-------------------------------------------------------------------------------
# Include
#-------------------------------------------------------------------------------
mod.web_layout {
tt_content {
preview {
t3sbs_assets = EXT:t3sbootstrap/Resources/Private/Templates/Preview/t3sbs_assets.html
}
}
}

#-------------------------------------------------------------------------------
# Include
#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -141,6 +153,7 @@ TCEFORM.tt_content {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
collapsible_accordion.disabled = 1
t3sbs_assets.disabled = 1
}
}
header_position {
Expand Down Expand Up @@ -292,12 +305,14 @@ TCEFORM.tt_content {
types {
t3sbs_button.disabled = 1
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_bgcolor {
types {
t3sbs_button.disabled = 1
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
t3sbs_carousel {
label.default = Caption background color (use with opacity - image link and zoom did not work)
label.de = Caption background color (use with opacity - image link and zoom did not work)
Expand All @@ -307,12 +322,14 @@ TCEFORM.tt_content {
tx_t3sbootstrap_header_fontawesome {
types {
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_bgopacity {
types {
t3sbs_button.disabled = 1
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
t3sbs_carousel {
label.default = Opacity for Caption background color
label.de = Opacity for Caption background color
Expand All @@ -324,55 +341,73 @@ TCEFORM.tt_content {
t3sbs_button.disabled = 1
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
}
}

tx_t3sbootstrap_textcolor {
types {
t3sbs_button.disabled = 1
t3sbs_toast.disabled = 1
t3sbs_assets.disabled = 1
t3sbs_carousel {
label.default = Text color for caption
label.de = Text color for caption
}
}
}

tx_t3sbootstrap_extra_class {
types {
t3sbs_assets.disabled = 1
}
}

tx_t3sbootstrap_padding_sides {
types {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
toast_container.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_padding_size {
types {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
toast_container.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_margin_sides {
types {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
toast_container.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_margin_size {
types {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
toast_container.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_container {
types {
t3sbs_carousel.disabled = 1
t3sbs_toast.disabled = 1
collapsible_accordion.disabled = 1
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_flexform {
types {
t3sbs_assets.disabled = 1
}
}
tx_t3sbootstrap_inTextImgRowWidth {
types {
t3sbs_card.disabled = 1
Expand Down Expand Up @@ -453,5 +488,20 @@ TCEFORM.tt_content {
t3sbs_button.disabled = 1
}
}
tx_content_animations_animation {
types {
t3sbs_assets.disabled = 1
}
}
tx_content_animations_duration {
types {
t3sbs_assets.disabled = 1
}
}
tx_content_animations_delay {
types {
t3sbs_assets.disabled = 1
}
}

}
7 changes: 7 additions & 0 deletions Configuration/TypoScript/ContentElement/Bootstrap.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# ===============================================================================
tt_content {

# **********************************************************
# Assets Inline
# **********************************************************
t3sbs_assets =< lib.contentElement
t3sbs_assets.templateName = AssetsInline
t3sbs_assets.stdWrap.editIcons = tt_content

# **********************************************************
# BOOTSTAP: Button
# **********************************************************
Expand Down
Loading

0 comments on commit 8f58e96

Please sign in to comment.