Skip to content

Commit

Permalink
Merge pull request #390 from t3solution/5.3.9
Browse files Browse the repository at this point in the history
New release v5.3.9
  • Loading branch information
t3solution committed Apr 22, 2024
2 parents 99d3d84 + 4c5aead commit 2039621
Show file tree
Hide file tree
Showing 25 changed files with 88 additions and 111 deletions.
Binary file added Classes/.DS_Store
Binary file not shown.
Binary file added Classes/Backend/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions Classes/Controller/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,4 +607,20 @@ protected function getTreeList($id, $depth, $begin = 0, $permsClause = ''): stri

return (string)$theList;
}


protected function setDefaultBackendLayout() {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('pages');
$queryBuilder
->update('pages')
->where(
$queryBuilder->expr()->eq('is_siteroot', $queryBuilder->createNamedParameter(1, Connection::PARAM_INT)),
$queryBuilder->expr()->eq('backend_layout', $queryBuilder->createNamedParameter('', Connection::PARAM_STR)),
$queryBuilder->expr()->eq('backend_layout_next_level', $queryBuilder->createNamedParameter('', Connection::PARAM_STR))
)
->set('backend_layout', 'pagets__OneCol')
->set('backend_layout_next_level', 'pagets__OneCol')
->executeStatement();
}

}
1 change: 1 addition & 0 deletions Classes/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ public function createAction(Config $newConfig): ResponseInterface
$newConfig->setHomepageUid($this->rootPageId);
$newConfig->setPid($this->currentUid);
$this->configRepository->add($newConfig);
parent::setDefaultBackendLayout();
parent::writeConstants();
return $this->redirect('list', null, null, array('created' => true));
}
Expand Down
5 changes: 4 additions & 1 deletion Classes/DataProcessing/BootstrapProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
return $processedData;
}

/** @var \Psr\Http\Message\ServerRequestInterface $request */
$request = $cObj->getRequest();
$extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3sbootstrap');
$cType = $processedData['data']['CType'];
$parentCType = '';
Expand Down Expand Up @@ -113,7 +115,8 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
}

if (!empty($contentObjectConfiguration['settings.']['shortcutsremove'])) {
$currentUid = (int) $GLOBALS['TSFE']->id;
$pageArguments = $request->getAttribute('routing');
$currentUid = $pageArguments->getPageId();
$footerPid = !empty($processorConfiguration['footerPid']) ? (int) $processorConfiguration['footerPid'] : 0;
$removeArr = GeneralUtility::trimExplode(',', $contentObjectConfiguration['settings.']['shortcutsremove']);
if ($processedData['data']['pid'] !== $currentUid && $processedData['data']['pid'] !== $footerPid) {
Expand Down
16 changes: 2 additions & 14 deletions Classes/DataProcessing/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ class ConfigProcessor implements DataProcessorInterface
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
$request = $GLOBALS['TYPO3_REQUEST'];
/** @var \Psr\Http\Message\ServerRequestInterface $request */
$request = $cObj->getRequest();
$settings = $contentObjectConfiguration['settings.'];
$frontendController = $request->getAttribute('frontend.controller');
if (!$frontendController) {
$frontendController = self::getFrontendController();
}
if (!empty($contentObjectConfiguration['settings.']['config.']['uid'])
&& is_numeric($contentObjectConfiguration['settings.']['config.']['uid'])) {
$processedRecordVariables = $contentObjectConfiguration['settings.']['config.'];
Expand Down Expand Up @@ -831,14 +829,4 @@ protected function getChildItems($children)
return $mainMenu;
}


/**
* Returns $typoScriptFrontendController TypoScriptFrontendController
*
* @return TypoScriptFrontendController
*/
protected function getFrontendController(): TypoScriptFrontendController
{
return $GLOBALS['TSFE'];
}
}
12 changes: 10 additions & 2 deletions Classes/DataProcessing/LastModifiedProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use Psr\Http\Message\ServerRequestInterface;

/*
* This file is part of the TYPO3 extension t3sbootstrap.
Expand All @@ -20,6 +21,9 @@
*/
class LastModifiedProcessor implements DataProcessorInterface
{

protected $request;

/**
* Fetches records from the database as an array
*
Expand All @@ -32,6 +36,9 @@ class LastModifiedProcessor implements DataProcessorInterface
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
/** @var ServerRequestInterface $request */
$this->request = $cObj->getRequest();

if (!empty($processorConfiguration['lastModifiedContentElement'])) {
$processorConfiguration = [];
$processorConfiguration['pidInList'] = self::getCurrentUid();
Expand Down Expand Up @@ -64,7 +71,7 @@ public function process(ContentObjectRenderer $cObj, array $contentObjectConfigu
/**
* Returns true if is page w/ content.cType == menu_recently_updated
*
* @return bool $mdtm
* @return bool
*/
protected function isMenuRecentlyUpdatedOnPage(): bool
{
Expand Down Expand Up @@ -160,6 +167,7 @@ protected function getPageTitle($uid): string
*/
protected function getCurrentUid(): int
{
return (int) $GLOBALS['TSFE']->id;
$pageArguments = $this->request->getAttribute('routing');
return $pageArguments->getPageId();
}
}
Binary file added Classes/Domain/.DS_Store
Binary file not shown.
10 changes: 9 additions & 1 deletion Classes/ViewHelpers/GetUsernameViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Utility\GeneralUtility;

/**
* This file is part of the TYPO3 extension t3sbootstrap.
Expand All @@ -20,7 +22,13 @@ public static function renderStatic(
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$context = GeneralUtility::makeInstance(Context::class);
$frontendUserUsername = $context->getPropertyFromAspect(
'frontend.user',
'username',
''
);

return strval($GLOBALS['TSFE']->fe_user->user['username']);
return strval($frontendUserUsername);
}
}
Binary file added Configuration/.DS_Store
Binary file not shown.
20 changes: 10 additions & 10 deletions Configuration/TCA/Overrides/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,17 @@

$menuheader = 198;

// Add new page type as possible select item:
// Add new page type:
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
'pages',
'doktype',
[
'Dropdownmenu header',
$menuheader,
'content-header'
],
'2',
'after'
'pages',
'doktype',
[
'label' => 'Dropdownmenu header',
'value' => $menuheader,
'icon' => 'content-header',
],
'2',
'after'
);

// Add icon for new page type:
Expand Down
Binary file added Configuration/TSConfig/.DS_Store
Binary file not shown.
Binary file added Configuration/TypoScript/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions Configuration/TypoScript/ContentElement/Bootstrap.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ tt_content {
t3sbs_card {
templateName = Card
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = assets
}
Expand All @@ -51,7 +51,7 @@ tt_content {
templateName = Carousel
settings.defaultHeaderType = 3
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = assets
}
Expand All @@ -66,7 +66,7 @@ tt_content {
t3sbs_mediaobject {
templateName = Mediaobject
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = assets
}
Expand Down Expand Up @@ -127,7 +127,7 @@ tt_content {
templateName = Toast

dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = assets
}
Expand Down
8 changes: 4 additions & 4 deletions Configuration/TypoScript/ContentElement/Default.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ tt_content {
menu_section {
dataProcessing >
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 = menu
10 {
special = list
special {
Expand All @@ -139,19 +139,19 @@ tt_content {
}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = media
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 = database-query
20 {
table = tt_content
pidInList.field = uid
as = content
where = sectionIndex = 1 AND ( colPos = 0 OR colPos > 199 )
orderBy = {$bootstrap.extconf.sectionOrder}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = media
}
Expand Down
5 changes: 2 additions & 3 deletions Configuration/TypoScript/Lib/_main.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ lib.currentDate {

lib.currentDomain = TEXT
lib.currentDomain {
dataWrap = {getIndpEnv:TYPO3_REQUEST_HOST}|
typolink.parameter.current = 1
typolink.returnLast = url
stdWrap.data = getIndpEnv : TYPO3_REQUEST_HOST
stdWrap.htmlSpecialChars = 1
}

lib.printButton = COA
Expand Down
27 changes: 16 additions & 11 deletions Configuration/TypoScript/Page/Template.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ page {
#
# NavBar / Main Navigation
#
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 = menu
10 {
entryLevel.cObject = TEXT
entryLevel.cObject.value = {$bootstrap.config.navbarEntrylevel}
Expand Down Expand Up @@ -132,7 +132,7 @@ page {
#
# NavBar-RIGHT / Main Navigation
#
11 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
11 = menu
11 {
special = list
special.value = {$bootstrap.config.navbarRightMenuUidList}
Expand All @@ -143,7 +143,7 @@ page {
#
# Pagebrowser
#
12 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
12 = menu
12 {
special = browse
special.items = {$bootstrap.pagebrowser.nextItem}
Expand All @@ -153,7 +153,7 @@ page {
}
12.if.isTrue = {$bootstrap.pagebrowser.enable}

13 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
13 = menu
13 {
special = browse
special.items = {$bootstrap.pagebrowser.prevItem}
Expand All @@ -166,7 +166,7 @@ page {
#
# Sub Navigation in Sidebar
#
20 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
20 = menu
20 {
entryLevel.cObject = TEXT
entryLevel.cObject {
Expand Down Expand Up @@ -212,7 +212,7 @@ page {
#
# Breadcrumb
#
30 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
30 = menu
30 {
special = rootline
special.range = 0|-1
Expand All @@ -233,7 +233,7 @@ page {
#
# Language Navigation
#
40 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor
40 = language-menu
40 {
languages = auto
as = languageNavigation
Expand All @@ -244,7 +244,7 @@ page {
#
# Meta Navigation
#
50 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
50 = menu
50 {
special = list
special.value.cObject = TEXT
Expand All @@ -261,7 +261,7 @@ page {
#
# Section Menu
#
60 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
60 = menu
60 {
special = list
special {
Expand All @@ -277,11 +277,11 @@ page {
}
as = sectionMenu
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 = files
10 {
references.fieldName = media
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 = database-query
20 {
table = tt_content
pidInList.field = uid
Expand Down Expand Up @@ -331,6 +331,11 @@ page {
# Main Config
#
90 = T3SBS\T3sbootstrap\DataProcessing\ConfigProcessor

#
# Site Config
#
#91 = site
}
}
}
Expand Down
Binary file added Contrib/scssphp/.DS_Store
Binary file not shown.
Binary file added Resources/.DS_Store
Binary file not shown.
Binary file added Resources/Private/.DS_Store
Binary file not shown.
Loading

0 comments on commit 2039621

Please sign in to comment.