Commit 81b2a9d4 authored by Stefan Busemann's avatar Stefan Busemann

Merge branch 'master' into '597-prototype-add-case-study-list-view-2'

# Conflicts:
#   ext_tables.sql
parents 4f861a72 294fc148
......@@ -8,6 +8,15 @@ stages:
- test
- build
test:typoscript:
stage: test
image: composer:1
before_script:
- composer global require helmich/typo3-typoscript-lint
script:
- /tmp/vendor/bin/typoscript-lint -c typoscript-lint.yml --fail-on-warnings
allow_failure: true
test:php:
stage: test
image: ekreative/php-cs-fixer:2
......
......@@ -5,6 +5,7 @@
// .btn-primary - Primary styling
// .btn-secondary - Secondary styling
// .btn-light - Light styling
// .btn-outline - Outline styling
//
// Styleguide 4.4
......
<?php
namespace T3o\T3olayout\Utility;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class MenuUtility
*/
class CheckMenuUtility
{
/**
* Check if we are on the detail view of a record and if the record is translated.
* If the record is not translated, the ITEM_STATE of the language menu item is set to USERDEF1 or USERDEF2
* as it is also done for pages (see AbstractMenuContentObject::prepareMenuItemsForLanguageMenu() "Checking if the
* "disabled" state should be set.").
* @param array $menuArr
* @param array $conf
* @return array $menuArr
* @see \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::prepareMenuItemsForLanguageMenu()
*/
public function checkForRecordTranslations($menuArr, $conf)
{
$check = $this->shouldCheck($conf['getParameters.'], GeneralUtility::_GET());
if ($check !== false) {
/** @var \TYPO3\CMS\Frontend\ContentObject\Menu\TextMenuContentObject $parentObject */
$parentObject = $conf['parentObj'];
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */
$tsfe = $this->getTypoScriptFrontendController();
/** @var \TYPO3\CMS\Core\Database\DatabaseConnection $db */
$db = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_news_domain_model_news');
foreach ($menuArr as &$menuItem) {
/** @var int $sUid current menu item language id */
$sUid = intval($menuItem['_PAGES_OVERLAY_LANGUAGE']);
// Find overlay record:
if ($sUid) {
$res = $db->select('*')
->from('tx_news_domain_model_news')
->where(
$db->expr()->eq('uid', intval($check['recordUid']))
)
->execute();
$currentRecord = $res->fetch();
$overlayMode = $GLOBALS['TSFE']->sys_language_mode === 'strict' ? 'hideNonTranslated' : '';
$lRecs = $parentObject->sys_page->getRecordOverlay($check['table'], $currentRecord, $sUid, $overlayMode);
} else {
$lRecs = [];
}
// Checking if the "disabled" state should be set.
if (GeneralUtility::hideIfNotTranslated($tsfe->page['l18n_cfg']) && $sUid &&
empty($lRecs) || GeneralUtility::hideIfDefaultLanguage($tsfe->page['l18n_cfg']) &&
(!$sUid || empty($lRecs)) ||
!$parentObject->conf['special.']['normalWhenNoLanguage'] && $sUid && empty($lRecs)
) {
$menuItem['ITEM_STATE'] = $tsfe->sys_language_uid == $sUid ? 'USERDEF2' : 'USERDEF1';
}
}
}
if ($menuArr['1']['ITEM_STATE'] == 'USERDEF1' && $menuArr['2']['ITEM_STATE'] == 'USERDEF1') {
$menuArr = [];
}
return $menuArr;
}
/**
* Walk through GET-Parameters and TypoScript-Configuration to check if we should do something.
* If we should do something this function returns the tablename and uid of the record to check.
* Else it returns false.
*
* @param array $parameter
* @return mixed
*/
protected function shouldCheck($configuration, $getParameters)
{
$result = false;
foreach ($configuration as $key => $configuratedParameter) {
$getParameterKey = $key;
if (is_array($configuratedParameter)) {
$getParameterKey = rtrim($key, '.');
}
if (isset($getParameters[$getParameterKey])) {
if (is_array($getParameters[$getParameterKey]) && is_array($configuratedParameter)) {
$result = $this->shouldCheck($configuratedParameter, $getParameters[$getParameterKey]);
} elseif (is_string($configuratedParameter) && $configuratedParameter !== 0 && isset($getParameters[$getParameterKey])) {
$result = [
'table' => $configuratedParameter,
'recordUid' => $getParameters[$getParameterKey],
];
}
}
}
return $result;
}
/**
* @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
*/
protected function getTypoScriptFrontendController()
{
return $GLOBALS['TSFE'];
}
/**
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
print_r($GLOBALS['TYPO3_DB']['0']['ITEM_STATE']);
return $GLOBALS['TYPO3_DB'];
}
}
<?php
namespace T3o\T3olayout\Utility;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Class MenuUtility
*/
class MenuUtility
{
/**
* Check if we are on the detail view of a record and if the record is translated.
* If the record is not translated, the ITEM_STATE of the language menu item is set to USERDEF1 or USERDEF2
* as it is also done for pages (see AbstractMenuContentObject::prepareMenuItemsForLanguageMenu() "Checking if the
* "disabled" state should be set.")
*
* @param array $menuArr
* @param array $conf
* @return array $menuArr
* @see \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::prepareMenuItemsForLanguageMenu()
*/
public function checkForRecordTranslations($menuArr, $conf)
{
$check = $this->shouldCheck($conf['getParameters.'], GeneralUtility::_GET());
if ($check !== false) {
/** @var \TYPO3\CMS\Frontend\ContentObject\Menu\TextMenuContentObject $parentObject */
$parentObject = $conf['parentObj'];
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */
$tsfe = $this->getTypoScriptFrontendController();
/** @var \TYPO3\CMS\Core\Database\DatabaseConnection $db */
$db = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_news_domain_model_news');
foreach ($menuArr as &$menuItem) {
/** @var int $sUid current menu item language id */
$sUid = intval($menuItem['_PAGES_OVERLAY_LANGUAGE']);
// Find overlay record:
if ($sUid) {
$res = $db->select('*')
->from('tx_news_domain_model_news')
->where(
$db->expr()->eq('uid', intval($check['recordUid']))
)
->execute();
$currentRecord = $res->fetch();
$overlayMode = $GLOBALS['TSFE']->sys_language_mode === 'strict' ? 'hideNonTranslated' : '';
$lRecs = $parentObject->sys_page->getRecordOverlay($check['table'], $currentRecord, $sUid, $overlayMode);
} else {
$lRecs = [];
}
// Checking if the "disabled" state should be set.
if (GeneralUtility::hideIfNotTranslated($tsfe->page['l18n_cfg']) && $sUid &&
empty($lRecs) || GeneralUtility::hideIfDefaultLanguage($tsfe->page['l18n_cfg']) &&
(!$sUid || empty($lRecs)) ||
!$parentObject->conf['special.']['normalWhenNoLanguage'] && $sUid && empty($lRecs)
) {
$menuItem['ITEM_STATE'] = $tsfe->sys_language_uid == $sUid ? 'USERDEF2' : 'USERDEF1';
}
}
}
return $menuArr;
}
/**
* Walk through GET-Parameters and TypoScript-Configuration to check if we should do something.
* If we should do something this function returns the tablename and uid of the record to check.
* Else it returns false.
*
* @param array $parameter
* @return mixed
*/
protected function shouldCheck($configuration, $getParameters)
{
$result = false;
foreach ($configuration as $key => $configuratedParameter) {
$getParameterKey = $key;
if (is_array($configuratedParameter)) {
$getParameterKey = rtrim($key, '.');
}
if (isset($getParameters[$getParameterKey])) {
if (is_array($getParameters[$getParameterKey]) && is_array($configuratedParameter)) {
$result = $this->shouldCheck($configuratedParameter, $getParameters[$getParameterKey]);
} elseif (is_string($configuratedParameter) && $configuratedParameter !== 0 && isset($getParameters[$getParameterKey])) {
$result = [
'table' => $configuratedParameter,
'recordUid' => $getParameters[$getParameterKey],
];
}
}
}
return $result;
}
/**
* @return \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
*/
protected function getTypoScriptFrontendController()
{
return $GLOBALS['TSFE'];
}
/**
* @return \TYPO3\CMS\Core\Database\DatabaseConnection
*/
protected function getDatabaseConnection()
{
print_r($GLOBALS['TYPO3_DB']['0']['ITEM_STATE']);
return $GLOBALS['TYPO3_DB'];
}
}
......@@ -12,6 +12,15 @@ stages:
- layout
- deploy
test:typoscript:
stage: test
image: composer:1
before_script:
- composer global require helmich/typo3-typoscript-lint
script:
- /tmp/vendor/bin/typoscript-lint -c typoscript-lint.yml --fail-on-warnings
allow_failure: true
test:php:
stage: test
image: ekreative/php-cs-fixer:2
......@@ -75,7 +84,7 @@ layout:
- composer global require deployer/deployer
- composer global require deployer/recipes
script:
- /tmp/vendor/bin/dep --file=./.gitlab-ci/deployer/deploy.php deploy ${CI_BUILD_REF_NAME}
- /tmp/vendor/bin/dep --file=./.gitlab-ci/deployer/deploy.php deploy -vv ${CI_BUILD_REF_NAME}
dependencies:
- layout
except:
......
This diff is collapsed.
......@@ -2,5 +2,5 @@
#### RTE BASICS ####
################################################
RTE.default {
contentCSS = typo3conf/ext/t3olayout/Resources/Public/Css/rte.css
contentCSS = typo3conf/ext/t3olayout/Resources/Public/Css/rte.css
}
......@@ -13,9 +13,9 @@ TCEFORM.tt_content.CType.removeItems := addToList(bullets,div,header)
TCEFORM.tt_content.CType.removeItems := addToList(shortcut,table,textpic)
mod.web_layout.tt_content.preview {
ce_jumplinkbox = EXT:t3olayout/Resources/Private/Preview/JumpLinkBox.html
ce_teaserbox = EXT:t3olayout/Resources/Private/Preview/TeaserBox.html
textmedia = EXT:t3olayout/Resources/Private/Preview/TextMedia.html
ce_jumplinkbox = EXT:t3olayout/Resources/Private/Preview/JumpLinkBox.html
ce_teaserbox = EXT:t3olayout/Resources/Private/Preview/TeaserBox.html
textmedia = EXT:t3olayout/Resources/Private/Preview/TextMedia.html
}
RTE.default.preset = custom
......@@ -25,6 +25,6 @@ RTE.config.tx_news_domain_model_news.bodytext.preset = custom
RTE.config.tt_content.bodytext.types.ce_actionbox.preset = nolink
tx_news.templateLayouts {
#label the self-created "Latest view" for EXT:News
latestHeaders = Latest news
#label the self-created "Latest view" for EXT:News
latestHeaders = Latest news
}
TCEFORM {
pages {
alias.disabled = 1
author.disabled = 1
author_email.disabled = 1
cache_tags.disabled = 1
cache_timeout.disabled = 1
categories.disabled = 1
content_from_pid.disabled = 1
editlock.disabled = 1
extendToSubpages.disabled = 0
is_siteroot.disabled = 1
l18n_cfg.disabled = 1
lastUpdated.disabled = 1
layout.disabled = 1
module.disabled = 0
newUntil.disabled = 1
no_cache.disabled = 1
php_tree_stop.disabled = 1
storage_pid.disabled = 1
target.disabled = 1
TSconfig.disabled = 0
tsconfig_includes.disabled = 0
pages {
alias.disabled = 1
author.disabled = 1
author_email.disabled = 1
cache_tags.disabled = 1
cache_timeout.disabled = 1
categories.disabled = 1
content_from_pid.disabled = 1
editlock.disabled = 1
extendToSubpages.disabled = 0
is_siteroot.disabled = 1
l18n_cfg.disabled = 1
lastUpdated.disabled = 1
layout.disabled = 1
module.disabled = 0
newUntil.disabled = 1
no_cache.disabled = 1
php_tree_stop.disabled = 1
storage_pid.disabled = 1
target.disabled = 1
TSconfig.disabled = 0
tsconfig_includes.disabled = 0
}
tt_content {
accessibility_bypass.disabled = 1
accessibility_bypass_text.disabled = 1
accessibility_title.disabled = 1
categories.disabled = 0
cols.disabled = 1
colPos.disabled = 0
date.disabled = 1
disable_stretching.disabled = 0
editlock.disabled = 1
sys_language_uid.disabled = 1
layout.disabled = 1
header_layout.altLabels {
0 = default headline (H2)
1 = page title (H1)
3 = headline (H3)
4 = headline (H4)
5 = headline (H5)
}
tt_content {
CType {
removeItems = ce_accordion
}
header_layout.removeItems = 2
frame_class {
disabled = 1
types {
ce_teaserbox {
disabled = 0
label = Card Styles
altLabels {
none = No Card
}
accessibility_bypass.disabled = 1
accessibility_bypass_text.disabled = 1
accessibility_title.disabled = 1
categories.disabled = 0
cols.disabled = 1
colPos.disabled = 0
date.disabled = 1
disable_stretching.disabled = 0
editlock.disabled = 1
sys_language_uid.disabled = 1
layout.disabled = 1
header_layout.altLabels {
0 = default headline (H2)
1 = page title (H1)
3 = headline (H3)
4 = headline (H4)
5 = headline (H5)
}
header_layout.removeItems = 2
frame_class {
disabled = 1
types {
ce_teaserbox {
disabled = 0
label = Card Styles
altLabels {
none = No Card
}
addItems {
200 = Card small
201 = Card medium
202 = Card large
}
removeItems := addToList(default,ruler-before,ruler-after,indent,indent-left,indent-right)
}
addItems {
200 = Card small
201 = Card medium
202 = Card large
}
gridelements_pi1 {
disabled = 0
label = Card Container
addItems {
200 = Card Container
}
altLabels {
none = No Card Container
}
removeItems := addToList(default,ruler-before,ruler-after,indent,indent-left,indent-right)
}
}
removeItems := addToList(default,ruler-before,ruler-after,indent,indent-left,indent-right)
}
header_position.disabled = 1
header_link.disabled = 0
image_zoom.disabled = 0
imageborder.disabled = 1
image_compression.disabled = 1
image_effects.disabled = 1
imagecols {
removeItems = 8,7,6,5
}
gridelements_pi1 {
disabled = 0
label = Card Container
addItems {
200 = Card Container
}
imageorient {
removeItems := addToList(1,2,9,10)
}
altLabels {
none = No Card Container
}
imagewidth.disabled = 1
imageheight.disabled = 1
image_noRows.disabled = 1
imagecaption_position.disabled = 1
linkToTop.disabled = 1
recursive.disabled = 1
rowDescription.disabled = 1
rte_enabled.disabled = 1
sectionIndex.disabled = 0
select_key.disabled = 1
space_after_class.disabled = 1
space_before_class.disabled = 1
spaceAfter.disabled = 1
spaceBefore.disabled = 1
subheader.disabled = 0
removeItems := addToList(default,ruler-before,ruler-after,indent,indent-left,indent-right)
}
}
}
tx_news_domain_model_news {
sys_language_uid.disabled = 1
header_position.disabled = 1
header_link.disabled = 0
image_zoom.disabled = 0
imageborder.disabled = 1
image_compression.disabled = 1
image_effects.disabled = 1
imagecols {
removeItems = 8,7,6,5
}
tx_sfeventmgt_domain_model_event {
sys_language_uid.disabled = 1
enable_registration.disabled = 1
top_event.disabled = 1
price.disabled = 1
currency.disabled = 1
price_options.disabled = 1
organisator.disabled = 1
speaker.disabled = 1
related.disabled = 1
imageorient {
removeItems := addToList(1,2,9,10)
}
imagewidth.disabled = 1
imageheight.disabled = 1
image_noRows.disabled = 1
imagecaption_position.disabled = 1
linkToTop.disabled = 1
recursive.disabled = 1
rowDescription.disabled = 1
rte_enabled.disabled = 1
sectionIndex.disabled = 0
select_key.disabled = 1
space_after_class.disabled = 1
space_before_class.disabled = 1
spaceAfter.disabled = 1
spaceBefore.disabled = 1
subheader.disabled = 0
}
tx_news_domain_model_news {
sys_language_uid.disabled = 1
}
tx_sfeventmgt_domain_model_event {
sys_language_uid.disabled = 1
enable_registration.disabled = 1
top_event.disabled = 1
price.disabled = 1
currency.disabled = 1
price_options.disabled = 1
organisator.disabled = 1
speaker.disabled = 1
related.disabled = 1
}
}
TCEMAIN.permissions {
everybody = show
user = show
group = show
}
\ No newline at end of file
everybody = show
user = show
group = show
}
......@@ -2,68 +2,68 @@
#### BACKENDLAYOUT: DEFAULT ####
################################
mod {
web_layout {
BackendLayouts {
t3olayout_default {
title = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default
config {
backend_layout {
colCount = 4
rowCount = 3
rows {
1 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.normal
colPos = 0
colspan = 4
}
}
}
2 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer1
colPos = 82
colspan = 1
}
web_layout {
BackendLayouts {
t3olayout_default {
title = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default
config {
backend_layout {
colCount = 4
rowCount = 3
rows {
1 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.normal
colPos = 0
colspan = 4
}
}
}
2 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer2
colPos = 83
colspan = 1
}
2 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer1
colPos = 82
colspan = 1
}
3 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer3
colPos = 84
colspan = 1
}
2 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer2
colPos = 83
colspan = 1
}
4 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer4
colPos = 85
colspan = 1
}
}
}
3 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer3
colPos = 84
colspan = 1
}
3 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.collection
colPos = 99
colspan = 4
}
}
}
}
}
4 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.footer4
colPos = 85
colspan = 1
}
}
}
icon = EXT:t3olayout/Resources/Public/Images/BackendLayouts/default.png
3 {
columns {
1 {
name = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.default.column.collection
colPos = 99
colspan = 4
}
}
}
}
}
}
icon = EXT:t3olayout/Resources/Public/Images/BackendLayouts/default.png
}
}
}
\ No newline at end of file
}
}
......@@ -2,77 +2,78 @@
#### BACKENDLAYOUT: DEFAULT ####
################################
mod {
web_layout {
BackendLayouts {
t3olayout_subnavigation {
title = LLL:EXT:t3olayout/Resources/Private/Language/locallang.xlf:backend_layout.subnavigation
config {
backend_layout {
colCount = 4
rowCount = 4
rows {
1 {
columns {
1 {