diff --git a/Classes/Command/CdnToLocal.php b/Classes/Command/CdnToLocal.php
index 17ca2349..68dfc073 100644
--- a/Classes/Command/CdnToLocal.php
+++ b/Classes/Command/CdnToLocal.php
@@ -76,17 +76,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
if ($settings['cdn']['bootswatch']) {
$bootswatchTheme = $settings['cdn']['bootswatch'];
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootswatch/'.$settings['cdn']['bootstrap'].'/'.$bootswatchTheme.'/bootstrap.min.css';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootswatch@'.$settings['cdn']['bootstrap'].'/dist/'.$bootswatchTheme.'/bootstrap.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath, true);
} else {
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootstrap/'.$settings['cdn']['bootstrap'].'/css/bootstrap.min.css';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootstrap@'.$settings['cdn']['bootstrap'].'/dist/css/bootstrap.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath, true);
}
$customDir = 'fileadmin/T3SB/Resources/Public/JS/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'bootstrap.min.js';
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootstrap/'.$version.'/js/bootstrap.min.js';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootstrap@'.$version.'/dist/js/bootstrap.min.js';
self::writeCustomFile($customPath, $customFileName, $cdnPath);
}
diff --git a/Classes/Controller/ConfigController.php b/Classes/Controller/ConfigController.php
index cfaa0459..473e32e5 100644
--- a/Classes/Controller/ConfigController.php
+++ b/Classes/Controller/ConfigController.php
@@ -23,6 +23,7 @@
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Backend\View\BackendTemplateView;
+
/**
* ConfigController
*/
@@ -87,12 +88,27 @@ public function listAction()
$pageRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
}
+ $childPages = $pageRepository->getMenu((int)$_GET['id'], 'uid');
+ $childUids = array_keys($childPages);
+ $subChildPages = $pageRepository->getMenu($childUids, 'uid');
+ $allPages = array_merge($childPages, $subChildPages);
+ foreach ( $allPages as $page ) {
+ $pageList .= $page['uid'].',';
+ }
+ $pageList = rtrim($pageList, ',');
+
$configRepository = $this->configRepository->findAll();
foreach ( $configRepository as $key => $config ) {
- $page = $pageRepository->getPage($config->getPid());
- $allConfig[$page['uid']]['title'] = $page['title'];
- $allConfig[$page['uid']]['uid'] = $page['uid'];
+
+ if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($pageList, $config->getPid())) {
+
+ $page = $pageRepository->getPage($config->getPid());
+
+ $allConfig[$page['uid']]['title'] = $page['title'];
+ $allConfig[$page['uid']]['uid'] = $page['uid'];
+
+ }
}
$assignedOptions['allConfig'] = $allConfig;
@@ -137,7 +153,7 @@ public function newAction()
if ( $rootConfig ) {
// config from rootline
- if ( $this->settings['t3sbConfig']['rootline'] ) {
+ if ( $rootConfig->getGeneralRootline() ) {
$rootLineArray = GeneralUtility::makeInstance(RootlineUtility::class, (int)$_GET['id'])->get();
@@ -219,6 +235,9 @@ public function createAction(\T3SBS\T3sbootstrap\Domain\Model\Config $newConfig)
$newConfig->setHomepageUid($homepageUid);
$newConfig->setPid((int)$_GET['id']);
$this->configRepository->add($newConfig);
+ $persistenceManager = $this->objectManager->get("TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager");
+ $persistenceManager->persistAll();
+ self::writeConstants();
parent::redirect('list');
}
@@ -288,6 +307,10 @@ public function updateAction(\T3SBS\T3sbootstrap\Domain\Model\Config $config)
$config->setHomepageUid($homepageUid);
$this->configRepository->update($config);
+ $persistenceManager = $this->objectManager->get("TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager");
+ $persistenceManager->persistAll();
+ self::writeConstants();
+
parent::redirect('edit',NULL,Null,array('config' => $config));
}
@@ -302,6 +325,10 @@ public function deleteAction(\T3SBS\T3sbootstrap\Domain\Model\Config $config)
{
$this->addFlashMessage('The object was deleted.', '', FlashMessage::INFO);
$this->configRepository->remove($config);
+ $persistenceManager = $this->objectManager->get("TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager");
+ $persistenceManager->persistAll();
+ self::writeConstants();
+
parent::redirect('list');
}
@@ -463,12 +490,14 @@ public function getNewConfig(\T3SBS\T3sbootstrap\Domain\Model\Config $rootConfig
$newConfig->setExpandedcontentContainertop( $rootConfig->getExpandedcontentContainertop() );
$newConfig->setExpandedcontentClasstop( $rootConfig->getExpandedcontentClasstop() );
- $newConfig->setexpandedcontentEnablebottom( $rootConfig->getexpandedcontentEnablebottom() );
+ $newConfig->setExpandedcontentEnablebottom( $rootConfig->getExpandedcontentEnablebottom() );
$newConfig->setExpandedcontentSlidebottom( $rootConfig->getExpandedcontentSlidebottom() );
$newConfig->setExpandedcontentContainerpositionbottom( $rootConfig->getExpandedcontentContainerpositionbottom() );
$newConfig->setExpandedcontentContainerbottom( $rootConfig->getExpandedcontentContainerbottom() );
$newConfig->setExpandedcontentClassbottom( $rootConfig->getExpandedcontentClassbottom() );
+ $newConfig->setGeneralRootline( $rootConfig->getGeneralRootline() );
+
return $newConfig;
}
@@ -527,7 +556,7 @@ protected function compareConfig($config)
$compare = [];
$rootConfig = $this->configRepository->findOneByPid(self::getRootPageUid());
- $fileds = 'getCompany, getHomepageUid, getPageTitle, getPageTitlealign, getPageTitlecontainer, getPageTitleclass, getMetaEnable, getMetaValue, getMetaContainer, getMetaClass, getMetaText, getNavbarEnable, getNavbarEntrylevel, getNavbarLevels, getNavbarExcludeuiduist, getNavbarIncludespacer, getNavbarJustify, getNavbarSectionmenu, getNavbarMegamenu, getNavbarHover, getNavbarClickableparent, getNavbarBrand, getNavbarImage, getNavbarColor, getNavbarShrinkcolorschemes, getNavbarShrinkcolor, getNavbarBackground, getNavbarContainer, getNavbarPlacement, getNavbarAlignment, getNavbarClass, getNavbarToggler, getNavbarBreakpoint, getNavbarOffcanvas, getNavbarHeight, getNavbarSearchbox, getNavbarLangmenu, getJumbotronEnable, getJumbotronBgimage, getJumbotronFluid, getJumbotronSlide, getJumbotronPosition, getJumbotronContainer, getJumbotronContainerposition, getJumbotronClass, getBreadcrumbEnable, getBreadcrumbNotonrootpage, getBreadcrumbFaicon, getBreadcrumbCorner, getBreadcrumbBottom, getBreadcrumbPosition, getBreadcrumbContainer, getBreadcrumbContainerposition, getBreadcrumbClass, getSidebarEnable, getSidebarRightenable, , getSidebarEntrylevel, getSidebarLevels, getSidebarExcludeuiduist, getSidebarIncludespacer, getFooterEnable, getFooterFluid, getFooterSlide, getFooterSticky, getFooterContainer, getFooterContainerposition, getFooterClass, getFooterPid, getExpandedcontentEnabletop, getExpandedcontentSlidetop, getExpandedcontentContainerpositiontop, getExpandedcontentContainertop, getExpandedcontentClasstop, getexpandedcontentEnablebottom, getExpandedcontentSlidebottom, getExpandedcontentContainerpositionbottom, getExpandedcontentContainerbottom, getExpandedcontentClassbottom';
+ $fileds = 'getCompany, getHomepageUid, getPageTitle, getPageTitlealign, getPageTitlecontainer, getPageTitleclass, getMetaEnable, getMetaValue, getMetaContainer, getMetaClass, getMetaText, getNavbarEnable, getNavbarEntrylevel, getNavbarLevels, getNavbarExcludeuiduist, getNavbarIncludespacer, getNavbarJustify, getNavbarSectionmenu, getNavbarMegamenu, getNavbarHover, getNavbarClickableparent, getNavbarBrand, getNavbarImage, getNavbarColor, getNavbarShrinkcolorschemes, getNavbarShrinkcolor, getNavbarBackground, getNavbarContainer, getNavbarPlacement, getNavbarAlignment, getNavbarClass, getNavbarToggler, getNavbarBreakpoint, getNavbarOffcanvas, getNavbarHeight, getNavbarSearchbox, getNavbarLangmenu, getJumbotronEnable, getJumbotronBgimage, getJumbotronFluid, getJumbotronSlide, getJumbotronPosition, getJumbotronContainer, getJumbotronContainerposition, getJumbotronClass, getBreadcrumbEnable, getBreadcrumbNotonrootpage, getBreadcrumbFaicon, getBreadcrumbCorner, getBreadcrumbBottom, getBreadcrumbPosition, getBreadcrumbContainer, getBreadcrumbContainerposition, getBreadcrumbClass, getSidebarEnable, getSidebarRightenable, , getSidebarEntrylevel, getSidebarLevels, getSidebarExcludeuiduist, getSidebarIncludespacer, getFooterEnable, getFooterFluid, getFooterSlide, getFooterSticky, getFooterContainer, getFooterContainerposition, getFooterClass, getFooterPid, getExpandedcontentEnabletop, getExpandedcontentSlidetop, getExpandedcontentContainerpositiontop, getExpandedcontentContainertop, getExpandedcontentClasstop, getExpandedcontentEnablebottom, getExpandedcontentSlidebottom, getExpandedcontentContainerpositionbottom, getExpandedcontentContainerbottom, getExpandedcontentClassbottom, getGeneralRootline';
$filedsArr = GeneralUtility::trimExplode(',', $fileds, 1);
@@ -556,7 +585,11 @@ protected function compareConfig($config)
}
-
+ /**
+ * SCSS in the BE
+ *
+ * @return array
+ */
public function getCustomScss( $file ) {
$customScssDir = $this->settings['customScssPath'] ? $this->settings['customScssPath'] : 'fileadmin/T3SB/SCSS/';
@@ -625,7 +658,11 @@ public function getCustomScss( $file ) {
}
-
+ /**
+ * Delete files from directory
+ *
+ * @return void
+ */
public function deleteFilesFromDirectory($directory){
if (is_dir($directory)) {
if ($dh = opendir($directory)) {
@@ -639,4 +676,194 @@ public function deleteFilesFromDirectory($directory){
}
}
+
+ /**
+ * Write data from DB to constant file and import in sys_template
+ *
+ * @return void
+ */
+ public function writeConstants() {
+
+ $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
+ $rootTemplates = $queryBuilder
+ ->select('uid','pid', 'constants')
+ ->from('sys_template')
+ ->where(
+ $queryBuilder->expr()->eq('root', $queryBuilder->createNamedParameter(1, \PDO::PARAM_INT))
+ )
+ ->execute()->fetchAll();
+
+
+ if ( count($rootTemplates) ) {
+
+ $configRepository = $this->configRepository->findAll();
+
+ foreach ($rootTemplates as $key=>$rootTemplate) {
+
+ $import = "@import 'fileadmin/T3SB/Configuration/TypoScript/t3sbconstants-".$rootTemplate['pid'].".typoscript'";
+
+ $pos = strpos($rootTemplate['constants'], $import);
+
+ if ($pos === FALSE) {
+
+ $setConstants = "# Please do not delete or comment out the following line".PHP_EOL;
+ $setConstants .= $import.PHP_EOL;
+ $setConstants .= $rootTemplate['constants'];
+
+ $update = $queryBuilder
+ ->update('sys_template')
+ ->where(
+ $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($rootTemplate['uid'], \PDO::PARAM_INT))
+ )
+ ->set('constants', $setConstants)
+ ->execute();
+ }
+
+ $filecontent = '';
+
+ foreach ( $configRepository as $config ) {
+
+ if ( $config->getPid() == $rootTemplate['pid'] ) {
+ $filecontent .= self::getContents($config).PHP_EOL;
+
+ } else {
+
+ $rootLineArray = GeneralUtility::makeInstance(RootlineUtility::class, $config->getPid())->get();
+
+ if ($rootLineArray[0]['uid'] == $rootTemplate['pid'] ){
+
+ if ($config->getGeneralRootline() || $config->getNavbarMegamenu()) {
+ $filecontent .= '['.$config->getPid().' in tree.rootLineIds]'.PHP_EOL;
+ } else {
+ $filecontent .= '[page["uid"] == '.$config->getPid().']'.PHP_EOL;
+ }
+
+ $filecontent .= self::getContents($config);
+ $filecontent .= '[END]'.PHP_EOL.PHP_EOL;
+ }
+ }
+ }
+
+ $customDir = 'fileadmin/T3SB/Configuration/TypoScript/';
+ $customPath = GeneralUtility::getFileAbsFileName($customDir);
+ $customFileName = 't3sbconstants-'.$rootTemplate['pid'].'.typoscript';
+ $customFile = $customPath.$customFileName;
+
+ if (file_exists($customFile)) {
+ unlink($customFile);
+ }
+ if (!is_dir($customPath)) {
+ mkdir($customPath, 0777, true);
+ }
+
+ GeneralUtility::writeFile($customFile, $filecontent);
+
+ }
+ }
+
+ }
+
+
+ /**
+ * Get the data from DB
+ *
+ * @param \T3SBS\T3sbootstrap\Domain\Model\Config $config
+ * @return string
+ */
+ private function getContents(\T3SBS\T3sbootstrap\Domain\Model\Config $config) {
+
+ $constants = 'bootstrap.db.uid = '.$config->getUid() .PHP_EOL;
+ $constants .= 'bootstrap.db.company = '.$config->getCompany() .PHP_EOL;
+ $constants .= 'bootstrap.db.homepage_uid = '.$config->getHomepageUid() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.page_title = '.$config->getPageTitle() .PHP_EOL;
+ $constants .= 'bootstrap.db.page_titlealign = '.$config->getPageTitlealign() .PHP_EOL;
+ $constants .= 'bootstrap.db.page_titlecontainer = '.$config->getPageTitlecontainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.page_titleclass = '.$config->getPageTitleclass() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.meta_enable = '.$config->getMetaEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.meta_value = '.$config->getMetaValue() .PHP_EOL;
+ $constants .= 'bootstrap.db.meta_container = '.$config->getMetaContainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.meta_class = '.$config->getMetaClass() .PHP_EOL;
+ $constants .= 'bootstrap.db.meta_text = '.$config->getMetaText() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.navbar_enable = '.$config->getNavbarEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_entrylevel = '.$config->getNavbarEntrylevel() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_levels = '.$config->getNavbarLevels() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_excludeuiduist = '.$config->getNavbarExcludeuiduist() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_includespacer = '.$config->getNavbarIncludespacer() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_justify = '.$config->getNavbarJustify() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_sectionmenu = '.$config->getNavbarSectionmenu() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_megamenu = '.$config->getNavbarMegamenu() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_hover = '.$config->getNavbarHover() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_clickableparent = '.$config->getNavbarClickableparent() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_brand = '.$config->getNavbarBrand() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_image = '.$config->getNavbarImage() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_color = '.$config->getNavbarColor() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_background = '.$config->getNavbarBackground() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_container = '.$config->getNavbarContainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_placement = '.$config->getNavbarPlacement() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_alignment = '.$config->getNavbarAlignment() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_class = '.$config->getNavbarClass() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_toggler = '.$config->getNavbarToggler() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_breakpoint = '.$config->getNavbarBreakpoint() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_offcanvas = '.$config->getNavbarOffcanvas() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_height = '.$config->getNavbarHeight() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_searchbox = '.$config->getNavbarSearchbox() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_langmenu = '.$config->getNavbarLangmenu() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_shrinkcolorschemes = '.$config->getNavbarShrinkcolorschemes() .PHP_EOL;
+ $constants .= 'bootstrap.db.navbar_shrinkcolor = '.$config->getNavbarShrinkcolor() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.jumbotron_enable = '.$config->getJumbotronEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_bgimage = '.$config->getJumbotronBgimage() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_fluid = '.$config->getJumbotronFluid() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_slide = '.$config->getJumbotronSlide() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_position = '.$config->getJumbotronPosition() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_container = '.$config->getJumbotronContainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_containerposition = '.$config->getJumbotronContainerposition() .PHP_EOL;
+ $constants .= 'bootstrap.db.jumbotron_class = '.$config->getJumbotronClass() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.breadcrumb_enable = '.$config->getBreadcrumbEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_notonrootpage = '.$config->getBreadcrumbNotonrootpage() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_faicon = '.$config->getBreadcrumbFaicon() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_corner = '.$config->getBreadcrumbCorner() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_bottom = '.$config->getBreadcrumbBottom() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_position = '.$config->getBreadcrumbPosition() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_container = '.$config->getBreadcrumbContainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_containerposition = '.$config->getBreadcrumbContainerposition() .PHP_EOL;
+ $constants .= 'bootstrap.db.breadcrumb_class = '.$config->getBreadcrumbClass() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.sidebar_enable = '.$config->getSidebarEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.sidebar_rightenable = '.$config->getSidebarRightenable() .PHP_EOL;
+ $constants .= 'bootstrap.db.sidebar_levels = '.$config->getSidebarEntrylevel() .PHP_EOL;
+ $constants .= 'bootstrap.db.sidebar_entrylevel = '.$config->getSidebarEntrylevel() .PHP_EOL;
+ $constants .= 'bootstrap.db.sidebar_excludeuiduist = '.$config->getSidebarExcludeuiduist() .PHP_EOL;
+ $constants .= 'bootstrap.db.sidebar_includespacer = '.$config->getSidebarIncludespacer() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.footer_enable = '.$config->getFooterEnable() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_fluid = '.$config->getFooterFluid() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_slide = '.$config->getFooterSlide() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_sticky = '.$config->getFooterSticky() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_container = '.$config->getFooterContainer() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_containerposition = '.$config->getFooterContainerposition() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_class = '.$config->getFooterClass() .PHP_EOL;
+ $constants .= 'bootstrap.db.footer_pid = '.$config->getFooterPid() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.expandedcontent_enabletop = '.$config->getexpandedcontentEnabletop() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_slidetop = '.$config->getExpandedcontentSlidetop() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_containerpositiontop = '.$config->getExpandedcontentContainerpositiontop() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_containertop = '.$config->getExpandedcontentContainertop() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_classtop = '.$config->getExpandedcontentClasstop() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_enablebottom = '.$config->getExpandedcontentEnablebottom() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_slidebottom = '.$config->getExpandedcontentSlidebottom() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_containerpositionbottom = '.$config->getExpandedcontentContainerpositionbottom() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_containerbottom = '.$config->getExpandedcontentContainerbottom() .PHP_EOL;
+ $constants .= 'bootstrap.db.expandedcontent_classbottom = '.$config->getExpandedcontentClassbottom() .PHP_EOL;
+
+ $constants .= 'bootstrap.db.general_rootline = '.$config->getGeneralRootline() .PHP_EOL;
+
+ return $constants;
+ }
+
+
}
diff --git a/Classes/DataProcessing/BootstrapProcessor.php b/Classes/DataProcessing/BootstrapProcessor.php
index 3b63f4c4..467965ae 100644
--- a/Classes/DataProcessing/BootstrapProcessor.php
+++ b/Classes/DataProcessing/BootstrapProcessor.php
@@ -429,7 +429,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
##############################################################################################################################################
// container class
- $processedData['data']['configuid'] = $cObj->stdWrapValue('configuid',$processorConfiguration,'');
+ $processedData['data']['configuid'] = (int)$processorConfiguration['configuid'];
$container = $defaultHelper->getContainerClass($processedData['data']);
if ($container && $container != 'colPosContainer') {
$processedData['containerPre'] = '
';
diff --git a/Classes/DataProcessing/ConfigProcessor.php b/Classes/DataProcessing/ConfigProcessor.php
index 25749e8c..5296b002 100644
--- a/Classes/DataProcessing/ConfigProcessor.php
+++ b/Classes/DataProcessing/ConfigProcessor.php
@@ -16,7 +16,6 @@
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Page\PageRenderer;
-use TYPO3\CMS\Core\Utility\RootlineUtility;
use TYPO3\CMS\Core\Site\Entity\SiteInterface;
use TYPO3\CMS\Core\Routing\SiteMatcher;
use TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor;
@@ -96,60 +95,21 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$frontendController = self::getFrontendController();
$webp = $this->processorConfiguration['webp'];
- // the table to query
- $tableName = 'tx_t3sbootstrap_domain_model_config';
- $this->processorConfiguration['pidInList'] = $frontendController->id;
+ if ( is_numeric($this->contentObjectConfiguration['settings.']['db.']['uid']) ) {
- // execute a SQL statement to fetch the records from current page
- $records = $this->contentObjectRenderer->getRecords($tableName, $this->processorConfiguration);
+ $processedRecordVariables = $this->contentObjectConfiguration['settings.']['db.'];
- $rootLineArray = GeneralUtility::makeInstance(RootlineUtility::class, (int)$this->processedData['data']['uid'])->get();
-
- if ( empty($records) ) {
-
- if ( $this->processorConfiguration['rootline'] ) {
- // config from rootline
- // unset current page
- $rlA = $rootLineArray;
- unset($rlA[count($rlA)-1]);
-
- foreach ($rlA as $rootline) {
- $this->processorConfiguration['pidInList'] = $rootline['uid'];
- $records = $this->contentObjectRenderer->getRecords($tableName, $this->processorConfiguration);
-
- if ( !empty($records) ) break;
- }
- } else {
- // config from root page
- if ( $this->processedData['data']['is_siteroot'] ) {
- $rootPageUid = $this->processedData['data']['uid'];
- } else {
- $rootPageUid = $rootLineArray[0]['uid'];
- }
- $this->processorConfiguration['pidInList'] = $rootPageUid;
- $records = $this->contentObjectRenderer->getRecords($tableName, $this->processorConfiguration);
- }
- }
-
- if ( empty($records) ) {
-
- $this->processedData['noConfig'] = TRUE;
-
- return $this->processedData;
+ } else {
- } else {
+ $this->processedData['noConfig'] = TRUE;
- $this->contentObjectRenderer->start($records[0], $tableName);
- $processedRecordVariables = $this->contentDataProcessor->process($this->contentObjectRenderer, $this->processorConfiguration, $records[0]);
+ return $this->processedData;
}
// override config by TS
if ( $this->contentObjectConfiguration['settings.']['configOverride'] ) {
foreach ( $this->contentObjectConfiguration['settings.']['override.'] as $key=>$override ) {
-
-
if ( ($override || $override === '0' || $override === 'false') && $override[1] != '$' ) {
-
if ( $override === 'none' ) {
$processedRecordVariables[$key] = '';
} else {
@@ -159,7 +119,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
}
}
-#\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($processedRecordVariables, '$processedRecordVariables');
/**
* General
@@ -192,8 +151,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$pageRepository = GeneralUtility::makeInstance(\TYPO3\CMS\Frontend\Page\PageRepository::class);
}
- $rootlinePage = $pageRepository->getPage($frontendController->rootLine[0]['uid']);
-
+ $rootlinePage = $pageRepository->getPage($processedRecordVariables['uid']);
$smallColumnsRootline = (int)$rootlinePage['tx_t3sbootstrap_smallColumns'];
$smallColumns = $smallColumnsCurrent ?: $smallColumnsRootline;
@@ -211,7 +169,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$threeCol = $currentPage['backend_layout'] == 'pagets__ThreeCol' ? TRUE : FALSE;
} else {
- foreach ($rootLineArray as $subPage) {
+ foreach ($frontendController->rootLine as $subPage) {
$bel = $subPage['backend_layout_next_level'];
if ( !empty($subPage['backend_layout_next_level']) ) break;
}
@@ -238,11 +196,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$this->processedData['colMain'] = 9;
}
- // image from pages media
- if ( $processedRecordVariables['pagemedia'] ) {
- $this->processedData['pagemedia'] = $processedRecordVariables['pagemedia'];
- }
-
// grid breakpoint
$this->processedData['gridBreakpoint'] = $currentPage['tx_t3sbootstrap_breakpoint'] ?: 'md';
@@ -312,7 +265,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$this->processedData['config']['navbar']['enable'] = $processedRecordVariables['navbar_enable'];
$this->processedData['config']['navbar']['sectionMenu'] = $processedRecordVariables['navbar_sectionmenu'] ? ' section-menu' : '';
$this->processedData['config']['navbar']['brand'] = $processedRecordVariables['navbar_brand'];
- if ( $rootLineArray[1]['doktype'] == 4) {
+ if ( $frontendController->rootLine[1]['doktype'] == 4) {
$this->processedData['config']['navbar']['clickableparent'] = 1;
} else {
$this->processedData['config']['navbar']['clickableparent'] = $processedRecordVariables['navbar_clickableparent'];
@@ -412,7 +365,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
if ( $processedRecordVariables['jumbotron_bgimage'] == 'root' ) {
// slide in rootline
- foreach ($rootLineArray as $page) {
+ foreach ($frontendController->rootLine as $page) {
$fileObjects = $fileRepository->findByRelation('pages', 'media', $page['uid']);
$uid = $page['uid'];
if ($fileObjects) break;
@@ -447,7 +400,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
if ( $this->contentObjectConfiguration['settings.']['backgroundImageEnable'] ) {
$bgImage = $this->getBackgroundImageUtility()->getBgImage($frontendController->id, 'pages', FALSE, FALSE, [], TRUE, 0, $webp);
if ( empty($bgImage) && $this->contentObjectConfiguration['settings.']['backgroundImageSlide'] ) {
- foreach ($rootLineArray as $page) {
+ foreach ($frontendController->rootLine as $page) {
$bgImage = $this->getBackgroundImageUtility()->getBgImage($page['uid'], 'pages', FALSE, FALSE, [], TRUE, $frontendController->id, $webp);
if ($bgImage) break;
}
@@ -501,7 +454,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$footerClass .= $processedRecordVariables['footer_fluid'] ? ' jumbotron-fluid' : '';
$footerClass .= $processedRecordVariables['footer_sticky'] ? ' footer-sticky' : '';
$this->processedData['config']['footer']['class'] = trim($footerClass);
-
}
/**
@@ -520,7 +472,6 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
$this->processedData['config']['expandedcontentBottom']['container'] = $processedRecordVariables['expandedcontent_containerbottom'];
$this->processedData['config']['expandedcontentBottom']['containerposition'] = $processedRecordVariables['expandedcontent_containerpositionbottom'];
$this->processedData['config']['expandedcontentBottom']['class'] = $processedRecordVariables['expandedcontent_classbottom'];
-
}
if (!$this->processorConfiguration['disableDefaultCss']) {
@@ -694,6 +645,7 @@ private function includeRequiredFiles($processedRecordVariables, $webp) {
self::writeCustomFile($customPath, $customFileName, $js);
}
+
// include required files to fileadmin
if ($css) {
$projectCSS = GeneralUtility::makeInstance(FilePathSanitizer::class)->sanitize(
@@ -734,7 +686,6 @@ private function writeCustomFile($customPath, $customFileName, $customContent )
$contentLength = strlen(trim($customContent));
if ($customFileLength != $contentLength) {
-
unlink($customFile);
GeneralUtility::writeFile($customFile, trim($customContent));
}
@@ -752,5 +703,4 @@ private function writeCustomFile($customPath, $customFileName, $customContent )
}
-
}
diff --git a/Classes/DataProcessing/GalleryProcessor.php b/Classes/DataProcessing/GalleryProcessor.php
index c8391b19..28917748 100644
--- a/Classes/DataProcessing/GalleryProcessor.php
+++ b/Classes/DataProcessing/GalleryProcessor.php
@@ -826,7 +826,8 @@ protected function getPageContainer($pageContainer)
|| ($this->colPos === -1 && $this->processedData['data']['parentgrid_tx_gridelements_backend_layout'] == 'background_wrapper')
)
{
- $t3sbconfig = self::getContentRecord($this->getConfigurationValue('configuid'), 'tx_t3sbootstrap_domain_model_config');
+
+ $t3sbconfig = self::getContentRecord((int)$this->getConfigurationValue('configuid'), 'tx_t3sbootstrap_domain_model_config');
$jumbotronContainer = $t3sbconfig[0]['jumbotron_container'];
$footerContainer = $t3sbconfig[0]['footer_container'];
diff --git a/Classes/Domain/Model/Config.php b/Classes/Domain/Model/Config.php
index fae442fb..649a33d4 100644
--- a/Classes/Domain/Model/Config.php
+++ b/Classes/Domain/Model/Config.php
@@ -204,7 +204,6 @@ class Config extends AbstractEntity
protected $navbarBackground = '';
-
/**
* navbarShrinkcolorschemes
*
@@ -578,6 +577,15 @@ class Config extends AbstractEntity
*/
protected $expandedcontentClassbottom = '';
+
+ /**
+ * generalRootline
+ *
+ * @var bool
+ */
+ protected $generalRootline = false;
+
+
/**
* Returns the pid
*
@@ -2375,7 +2383,7 @@ public function setExpandedcontentClasstop($expandedcontentClasstop)
*
* @return bool $expandedcontentEnablebottom
*/
- public function getexpandedcontentEnablebottom()
+ public function getExpandedcontentEnablebottom()
{
return $this->expandedcontentEnablebottom;
}
@@ -2386,7 +2394,7 @@ public function getexpandedcontentEnablebottom()
* @param bool $expandedcontentEnablebottom
* @return void
*/
- public function setexpandedcontentEnablebottom($expandedcontentEnablebottom)
+ public function setExpandedcontentEnablebottom($expandedcontentEnablebottom)
{
$this->expandedcontentEnablebottom = $expandedcontentEnablebottom;
}
@@ -2396,7 +2404,7 @@ public function setexpandedcontentEnablebottom($expandedcontentEnablebottom)
*
* @return bool
*/
- public function isexpandedcontentEnablebottom()
+ public function isExpandedcontentEnablebottom()
{
return $this->expandedcontentEnablebottom;
}
@@ -2495,4 +2503,36 @@ public function setExpandedcontentClassbottom($expandedcontentClassbottom)
$this->expandedcontentClassbottom = $expandedcontentClassbottom;
}
+ /**
+ * Returns the generalRootline
+ *
+ * @return bool $generalRootline
+ */
+ public function getGeneralRootline()
+ {
+ return $this->generalRootline;
+ }
+
+ /**
+ * Sets the generalRootline
+ *
+ * @param bool $generalRootline
+ * @return void
+ */
+ public function setGeneralRootline($generalRootline)
+ {
+ $this->generalRootline = $generalRootline;
+ }
+
+ /**
+ * Returns the boolean state of generalRootline
+ *
+ * @return bool
+ */
+ public function isGeneralRootline()
+ {
+ return $this->generalRootline;
+ }
+
+
}
diff --git a/Classes/ExpressionLanguage/T3sbConditionFunctionsProvider.php b/Classes/ExpressionLanguage/T3sbConditionFunctionsProvider.php
index ee8ebdb5..655fa208 100644
--- a/Classes/ExpressionLanguage/T3sbConditionFunctionsProvider.php
+++ b/Classes/ExpressionLanguage/T3sbConditionFunctionsProvider.php
@@ -32,7 +32,7 @@ public function getFunctions(): array
];
}
-
+
protected function getExtconf(): ExpressionFunction
{
return new ExpressionFunction('t3sbootstrap', function ($str) {
@@ -66,7 +66,7 @@ protected function getBrowser(): ExpressionFunction
return $str === $browser;
});
- }
+ }
protected function getColPosList(): ExpressionFunction
@@ -76,9 +76,9 @@ protected function getColPosList(): ExpressionFunction
}, function ($arguments, $str) {
$result = FALSE;
-
+
if ( $_GET['id'] && TYPO3_MODE == 'BE' ) {
-
+
$pid = (int)$_GET['id'];
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$configRepository = $objectManager->get(ConfigRepository::class);
@@ -157,7 +157,7 @@ protected function getColPosList(): ExpressionFunction
$result = TRUE;
}
}
-
+
if ( $config->getExpandedcontentEnabletop() && $config->getExpandedcontentEnablebottom() ) {
if ($str == 'FooterandTopBottom') {
$result = TRUE;
@@ -185,7 +185,7 @@ protected function getColPosList(): ExpressionFunction
}
}
}
- }
+ }
}
return $result;
@@ -199,10 +199,10 @@ protected function getExtensionLoaded(): ExpressionFunction
return new ExpressionFunction('loaded', function () {
// Not implemented, we only use the evaluator
}, function ($arguments, $extKey) {
+
return ExtensionManagementUtility::isLoaded($extKey);
});
}
-
}
diff --git a/Classes/Tasks/CdnToLocal.php b/Classes/Tasks/CdnToLocal.php
index 2445f8ec..59062afd 100644
--- a/Classes/Tasks/CdnToLocal.php
+++ b/Classes/Tasks/CdnToLocal.php
@@ -53,17 +53,17 @@ public function execute() {
if ($settings['cdn']['bootswatch']) {
$bootswatchTheme = $settings['cdn']['bootswatch'];
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootswatch/'.$settings['cdn']['bootstrap'].'/'.$bootswatchTheme.'/bootstrap.min.css';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootswatch@'.$settings['cdn']['bootstrap'].'/dist/'.$bootswatchTheme.'/bootstrap.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath, true);
} else {
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootstrap/'.$settings['cdn']['bootstrap'].'/css/bootstrap.min.css';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootstrap@'.$settings['cdn']['bootstrap'].'/dist/css/bootstrap.min.css';
self::writeCustomFile($customPath, $customFileName, $cdnPath, true);
}
$customDir = 'fileadmin/T3SB/Resources/Public/JS/';
$customPath = GeneralUtility::getFileAbsFileName($customDir);
$customFileName = 'bootstrap.min.js';
- $cdnPath = 'https://stackpath.bootstrapcdn.com/bootstrap/'.$version.'/js/bootstrap.min.js';
+ $cdnPath = 'https://cdn.jsdelivr.net/npm/bootstrap@'.$version.'/dist/js/bootstrap.min.js';
self::writeCustomFile($customPath, $customFileName, $cdnPath);
}
diff --git a/Classes/Utility/BackgroundImageUtility.php b/Classes/Utility/BackgroundImageUtility.php
index 2831e66c..7aa808db 100644
--- a/Classes/Utility/BackgroundImageUtility.php
+++ b/Classes/Utility/BackgroundImageUtility.php
@@ -77,9 +77,7 @@ public function getBgImage($uid, $table='tt_content', $jumbotron=FALSE, $bgColor
if (!empty($filesFromRepository) ) {
$file = $filesFromRepository[0];
$image = $this->imageService()->getImage($file->getOriginalFile()->getUid(), $file->getOriginalFile(), 1);
-
$uid = $currentUid ?: $uid;
-
if ( $flexconf['bgimagePosition'] ) {
$uid = $uid . '-' . $flexconf['bgimagePosition'];
}
diff --git a/Classes/ViewHelpers/IncludeFileViewHelper.php b/Classes/ViewHelpers/IncludeFileViewHelper.php
index ee94f3e5..7613acf0 100644
--- a/Classes/ViewHelpers/IncludeFileViewHelper.php
+++ b/Classes/ViewHelpers/IncludeFileViewHelper.php
@@ -21,7 +21,7 @@
*
* # Example: Basic example
*
- *
+ *
*
*