Commit adc7e5e3 authored by Stefan Busemann's avatar Stefan Busemann

Merge branch 'develop-v10' into 'master'

Working with version 10

See merge request !580
parents 785446e8 7abc0593
......@@ -26,7 +26,7 @@ test:php:
- php-cs-fixer fix --dry-run --config=Build/.php_cs --diff --diff-format=udiff
build:
image: node:9
image: node:12
stage: build
before_script:
- npm config set cache cache/npm/ --global
......
......@@ -59,7 +59,7 @@ FlyOutAjaxLogin.prototype.authenticationRequest = function(event, form) {
FlyOutAjaxLogin.prototype.initMenuBar = function() {
const returnUrl = encodeURIComponent(window.location.href);
FlyOutAjaxLogin.callAjax('/index.php?eID=FlyOutAjaxLoginController&returnUrl=' + returnUrl, function (response) {
FlyOutAjaxLogin.callAjax('/index.php?load=FlyOutAjaxLogin&returnUrl=' + returnUrl, function (response) {
if (response !== null || response !== undefined || response !== '') {
const login = JSON.parse(response);
const container = document.querySelector('._login');
......
This diff is collapsed.
......@@ -4,21 +4,21 @@
"private": true,
"main": "Gulpfile.js",
"dependencies": {
"@fancyapps/fancybox": "^3.2.5",
"@fortawesome/fontawesome-free": "^5.5.0",
"baguettebox.js": "^1.9.1",
"bootstrap": "^4.4.1",
"bootstrap4-notify": "^4.0.3",
"cookieconsent": "^3.1.0",
"datatables.net-bs4": "^1.10.19",
"gravatar": "^1.6.0",
"h5bp-print-styles": "^4.3.2",
"jquery": "^3.4",
"jquery-typeahead": "^2.10.4",
"popper.js": "^1.14.4",
"slick-carousel": "^1.8.1",
"source-sans-pro": "^2.40.0",
"tether": "^1.4.3"
"@fancyapps/fancybox": "3.2.5",
"@fortawesome/fontawesome-free": "5.5.0",
"baguettebox.js": "1.9.1",
"bootstrap": "4.4.1",
"bootstrap4-notify": "4.0.3",
"cookieconsent": "3.1.0",
"datatables.net-bs4": "1.10.19",
"gravatar": "1.6.0",
"h5bp-print-styles": "4.3.2",
"jquery": "3.4.1",
"jquery-typeahead": "2.10.4",
"popper.js": "1.14.4",
"slick-carousel": "1.8.1",
"source-sans-pro": "2.40.0",
"tether": "1.4.3"
},
"devDependencies": {
"babel-core": "^6.26.3",
......@@ -53,9 +53,9 @@
}
},
"scripts": {
"build": "./node_modules/.bin/gulp build",
"build-prod": "./node_modules/.bin/gulp build-prod",
"start": "./node_modules/.bin/gulp default",
"ci": "./node_modules/.bin/gulp ci"
"build": "npx gulp build",
"build-prod": "npx gulp build-prod",
"start": "npx gulp default",
"ci": "npx gulp ci"
}
}
......@@ -2,9 +2,13 @@
namespace T3o\T3olayout\Backend\ViewHelpers;
class ResolveFileReferenceViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class ResolveFileReferenceViewHelper extends AbstractViewHelper
{
use \TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
use CompileWithRenderStatic;
/**
* Initialize arguments
......@@ -22,9 +26,9 @@ class ResolveFileReferenceViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\Ab
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
* @throws Exception
* @throws \Exception
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
return \TYPO3\CMS\Backend\Utility\BackendUtility::resolveFileReferences('tt_content', 'assets', $arguments['row']);
}
......
<?php
namespace T3o\T3olayout\Controller;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Extbase\Mvc\Web\Response;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Utility\EidUtility;
/**
* Class AjaxFrontendLoginController
*
* @target Frontend
*/
class FlyOutAjaxLoginController
{
public static function processLogin()
{
EidUtility::initTCA();
self::getTypoScriptFrontendController();
$feUser = EidUtility::initFeUser();
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$response = $objectManager->get(Response::class);
$response->setHeader('Content-Type', 'application/json; charset=utf-8');
$configurationManager = $objectManager->get(ConfigurationManager::class);
$typoScriptSetup = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
$contentObjectRenderer = $objectManager->get(ContentObjectRenderer::class);
$loginPid = $contentObjectRenderer->cObjGetSingle(
$typoScriptSetup['lib.']['loginPid'],
$typoScriptSetup['lib.']['loginPid.']
);
$loginFormPid = $contentObjectRenderer->cObjGetSingle(
$typoScriptSetup['lib.']['loginFormPid'],
$typoScriptSetup['lib.']['loginFormPid.']
);
$menuBarTemplate = $objectManager->get(StandaloneView::class);
$menuBarTemplate->setTemplatePathAndFilename('EXT:t3olayout/Resources/Private/Templates/Felogin/MenuBarAjaxLogin.html');
$menuBarTemplate->assign('user', $feUser->user);
$menuBarTemplate->assign('loginPid', $loginPid);
$menuBarTemplate->assign('loginFormPid', $loginFormPid);
echo json_encode(
[
'loginPid' => $loginPid,
'loginFormPid' => $loginFormPid,
'loggedIn' => $feUser->user['ses_userid'] > 0,
'menuBarTemplate' => $menuBarTemplate->render()
]
);
$response->send();
exit;
}
/**
* Initialize the typoscript frontend controller
*
* @param int $pid
*/
private static function getTypoScriptFrontendController($pid = 1)
{
/** @var \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $frontend */
$frontend = GeneralUtility::makeInstance(
\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class,
null,
$pid,
0
);
$GLOBALS['TSFE'] = $frontend;
$frontend->initFEuser();
$frontend->determineId();
$frontend->initTemplate();
$frontend->getConfigArray();
}
}
This diff is collapsed.
<?php
namespace T3o\T3olayout\Middleware;
/*
* This file is part of a TYPO3 extension.
*
* 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 GuzzleHttp\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
class FlyOutAjaxLogin implements MiddlewareInterface
{
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
if (!$request->getQueryParams()['load'] && $request->getQueryParams()['load'] !== 'FlyOutAjaxLogin') {
return $handler->handle($request);
}
$extensionConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('t3olayout');
$feUser = $request->getAttribute('frontend.user');
$menuBarTemplate = GeneralUtility::makeInstance(StandaloneView::class);
$menuBarTemplate->setTemplatePathAndFilename('EXT:t3olayout/Resources/Private/Templates/Felogin/MenuBarAjaxLogin.html');
$menuBarTemplate->assign('user', $feUser->user);
$menuBarTemplate->assign('loginPid', $extensionConfiguration['loginPid']);
$menuBarTemplate->assign('loginFormPid', $extensionConfiguration['loginFormPid']);
$returnValue = [
'loginPid' => $extensionConfiguration['loginPid'],
'loginFormPid' => $extensionConfiguration['loginFormPid'],
'loggedIn' => $feUser->user['ses_userid'] > 0,
'menuBarTemplate' => $menuBarTemplate->render()
];
$response = new Response();
$response->getBody()->write(json_encode($returnValue));
return $response;
}
}
......@@ -13,8 +13,8 @@ namespace T3o\T3olayout\ViewHelpers;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
......@@ -34,6 +34,7 @@ class GravatarViewHelper extends AbstractViewHelper
parent::initializeArguments();
$this->registerArgument('emailAddress', 'string', 'The email address to use for gravatar', true);
$this->registerArgument('size', 'int', 'The size of the gravatar image');
$this->registerArgument('class', 'string', 'The class for the image', false, 'rounded-circle');
}
/**
......@@ -50,6 +51,6 @@ class GravatarViewHelper extends AbstractViewHelper
$emailAddress = $arguments['emailAddress'];
$size = (int)$arguments['size'] > 0 ? '?s=' . $arguments['size'] : '';
return '<img alt="" class="rounded-circle" src="https://www.gravatar.com/avatar/' . md5(strtolower($emailAddress)) . $size . '" />';
return '<img alt="" class="' . $arguments['class'] . '" src="https://www.gravatar.com/avatar/' . md5(strtolower($emailAddress)) . $size . '" />';
}
}
variables:
GIT_STRATEGY: "none"
GIT_SSL_NO_VERIFY: "true"
ADDITIONAL_TABLE_EXCLUDES: ""
cache:
key: "$CI_COMMIT_REF_NAME-$CI_JOB_STAGE"
......@@ -11,6 +12,7 @@ before_script:
- apk add bash --no-cache
stages:
- maintenance
- test
- build
- layout
......@@ -26,8 +28,6 @@ test:typoscript:
script:
- /tmp/vendor/bin/typoscript-lint -c typoscript-lint.yml --fail-on-warnings
allow_failure: true
except:
- assets
test:php:
stage: test
......@@ -36,8 +36,6 @@ test:php:
GIT_STRATEGY: "clone"
script:
- php-cs-fixer fix --dry-run --config=.gitlab-ci/build/.php_cs --diff
except:
- assets
build:
stage: build
......@@ -59,13 +57,11 @@ build:
paths:
- ./
expire_in: '1h'
except:
- assets
layout:
stage: layout
image: node:8
image: node:12
before_script:
- cd private/typo3conf/ext/t3olayout/Build
script:
......@@ -79,8 +75,6 @@ layout:
expire_in: '4h'
dependencies:
- build
except:
- assets
.deploy-template: &deploy_template
stage: deploy
......@@ -91,7 +85,7 @@ layout:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY_STAGE" | ssh-add -
- echo "$SSH_PRIVATE_KEY_PRODUCTION" | ssh-add -
- ssh-keyscan -p ${STAGE_PORT} ${STAGE_HOST} >> /root/.ssh/known_hosts
- ssh-keyscan ${STAGE_HOST} >> /root/.ssh/known_hosts
- ssh-keyscan -p ${PRODUCTION_PORT} ${PRODUCTION_HOST} >> /root/.ssh/known_hosts
- composer config cache-dir /cache/composer
- composer global require deployer/deployer:6.6.0 --update-with-dependencies
......@@ -119,3 +113,28 @@ deploy-develop:
only:
- develop
.maintenance: &maintenance_template
variables:
GIT_STRATEGY: none
stage: maintenance
when: manual
image:
name: composer:1
entrypoint: ["/bin/sh", "-c"]
before_script:
- apk add rsync --update
- mkdir -p /root/.ssh/
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY_STAGE" | ssh-add -
- ssh-keyscan ${STAGE_HOST} >> /root/.ssh/known_hosts
Get dump for local environment:
<<: *maintenance_template
script:
- mkdir dump
- ssh ${STAGE_USER}@${STAGE_HOST} "php ./ci/current/vendor/bin/typo3cms database:export -c Default -e 'cf_*' -e 'cache_*' -e '[bf]e_sessions' -e '[bf]e_users' -e 'sys_log' -e 'sys_history' -e 'sys_registry' -e 'tx_solr_*' -e 'tx_igldapssoauth_config' ${ADDITIONAL_TABLE_EXCLUDES} | gzip -9 -c" > ./dump/dump.sql.gz
artifacts:
paths:
- ./dump/
expire_in: 1d
<?php
return [
'frontend' => [
't3olayout-ajaxlogin' => [
'target' => \T3o\T3olayout\Middleware\FlyOutAjaxLogin::class,
'after' => [
'typo3/cms-frontend/prepare-tsfe-rendering'
]
]
]
];
# Deployment TypoScript inclusion
This folder needs to stay as the remote servers have specific TypoScript configuration
[globalVar = GP:type = 4444]
[request.getQueryParams()['type'] == 4444]
config {
disableAllHeaderCode = 1
xhtml_cleaning = none
......
......@@ -40,7 +40,7 @@ config {
}
}
[globalVar = GP:L=1]
[siteLanguage("languageId") == 1]
config {
sys_language_uid = 1
language = de
......@@ -49,7 +49,7 @@ config {
}
[global]
[globalVar = GP:L=2]
[siteLanguage("languageId") == 2]
config {
sys_language_uid = 2
language = es
......
......@@ -79,7 +79,7 @@ page {
}
}
[globalVar = GP:type = 789]
[request.getQueryParams()['type'] == 789]
config {
disableAllHeaderCode = 1
forceTypeValue = 0
......
[applicationContext == "Production"]
page {
headerData.670 = TEXT
headerData.670 {
......@@ -19,3 +20,4 @@ page {
if.isTrue = {$tx_t3olayout.page.enableGoogleTagManager}
}
}
[global]
# loaded ts after install the ext:gridelements
[userFunc = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('gridelements')]
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:gridelements/Configuration/TypoScript/setup.typoscript">
[global]
lib.gridelements.defaultGridSetup.cObject =< lib.contentElement
tt_content {
gridelements_pi1 =< lib.contentElement
gridelements_pi1 {
templateName = Generic
variables {
content = COA
content {
10 = USER
10 {
userFunc = GridElementsTeam\Gridelements\Plugin\Gridelements->main
setup {
# Grid Elements
# @see EXT:t3olayout/Configuration/PageTS/Gridelements.tsconfig
1 < lib.gridelements.defaultGridSetup
1 {
cObject {
templateName = OneColumn
templateRootPaths {
20 = EXT:t3olayout/Resources/Private/Templates/GridElements/
}
}
}
2 < .1
2.cObject.templateName = TwoColumns_50-50
3 < .1
3.cObject.templateName = TwoColumns_70-30
4 < .1
4.cObject.templateName = TwoColumns_30-70
5 < .1
5.cObject.templateName = ThreeColumns
6 < .1
6.cObject.templateName = FourColumns
7 < .1
7.cObject.templateName = Collapse
8 < .1
8.cObject.templateName = TwoColumns_2-10
9 < .1
9.cObject.templateName = TwoColumns_10-2
10 < .1
10.cObject.templateName = TwoColumns_3-9
11 < .1
11.cObject.templateName = TwoColumns_9-3
default < lib.gridelements.defaultGridSetup
}
}
}
@import 'EXT:gridelements/Configuration/TypoScript/DataProcessingLibContentElement/setup.typoscript'
tt_content.gridelements_pi1 {
templateRootPaths.2 = EXT:t3olayout/Resources/Private/Templates/GridElements/
templateName {
override >
cObject = CASE
cObject {
key.field = tx_gridelements_backend_layout
1 = TEXT
1.value = OneColumn
2 = TEXT
2.value = TwoColumns5050
3 = TEXT
3.value = TwoColumns7030
4 = TEXT
4.value = TwoColumns3070
5 = TEXT
5.value = ThreeColumns
6 = TEXT
6.value = FourColumns
7 = TEXT
7.value = Collapse
8 = TEXT
8.value = TwoColumns210
9 = TEXT
9.value = TwoColumns102
10 = TEXT
10.value = TwoColumns39
11 = TEXT
11.value = TwoColumns93
default = GridElement
}
}
dataProcessing.10.default.options {
resolveFlexFormData = 1
resolveChildFlexFormData = 0
}
}
tt_content.gridelements_view < tt_content.gridelements_pi1
lib {
newsdetaillangmenu = COA
newsdetaillangmenu {
if.isTrue.data = GP:tx_news_pi1|news
10 = HMENU
10 {
wrap = <ul class="detail-language-menu list-unstyled list-inline">|</ul>
special = language
special {
value = 0,1,2
normalWhenNoLanguage = 0
}
addQueryString = 1
1 = TMENU
1 {
expAll = 0
wrap = |
NO = 1
NO {
stdWrap.cObject = TEXT
stdWrap.cObject {
value = English || German || Spanish
}
allWrap = <li class="list-inline-item">|</li>
}
ACT < .NO
ACT = 1
ACT {
ATagParams = class="active"
doNotLinkIt = 1
allWrap = <li class="active list-inline-item d-none">|</li>
}
CUR < .ACT
USERDEF1 = 1
USERDEF1 {
doNotLinkIt = 1
stdWrap {
cObject = TEXT
cObject.value =
}
}
USERDEF2 = 1
USERDEF2 {
doNotLinkIt = 1
stdWrap {
cObject = TEXT
cObject.value =
}
}
itemArrayProcFunc = T3o\T3olayout\Utility\MenuUtility->checkForRecordTranslations
itemArrayProcFunc.getParameters {
tx_news_pi1.news = tx_news_domain_model_news
}
}
}
}
languageSelector = HMENU
languageSelector {
special = language
special {
value = 0,1,2
normalWhenNoLanguage = 0
}
addQueryString = 1
1 = TMENU
1 {
itemArrayProcFunc = T3o\T3olayout\Utility\CheckMenuUtility->checkForRecordTranslations
itemArrayProcFunc.getParameters {
tx_news_pi1.news = tx_news_domain_model_news
}
}
}
}
plugin.tx_nsyoutube {
view {
templateRootPaths.180 = EXT:t3olayout/Resources/Private/Templates/NsYoutube/Templates/
partialRootPaths.180 = EXT:t3olayout/Resources/Private/Templates/NsYoutube/Partials/
layoutRootPaths.180 = EXT:t3olayout/Resources/Private/Templates/NsYoutube/Layouts/
}
settings {