Compare commits

...

9 Commits

Author SHA1 Message Date
786c200609 [MERGE] Branch 'master' of ssh://phabricator.glanzstueck.agency/source/typo3-template_aide 2024-11-28 15:21:46 +01:00
7f3123b61a [TASK] Work on compatibility for TYPO3 11 2024-11-28 15:19:38 +01:00
wadichaabene
d9e0ae6c44 [BUGFIX] Upgrade extension registerPlugin 2024-11-21 17:46:57 +01:00
fb54d608a6 [TASK] Start compatibility for TYPO3 11 2024-08-29 18:16:52 +02:00
94296d4a4d [TASK] Add style options to html mail partial 2024-07-19 11:35:21 +02:00
1a3aab9f36 [REVERT][TASK] new changes Mail
This reverts commit 14b3a54a9960f485f28ab0c529d3a6d45d0536eb.
2024-07-19 11:30:27 +02:00
wadichaabene
14b3a54a99 [TASK] new changes Mail 2024-07-18 14:20:51 +01:00
0045f87815 [REVERT][TASK] new changes Mail
This reverts commit 9ba671cfd0ce4cd245933225b645f7761291cb8e.
2024-07-18 10:56:02 +02:00
wadichaabene
9ba671cfd0 [TASK] new changes Mail 2024-07-17 23:58:53 +01:00
11 changed files with 142 additions and 68 deletions

View File

@ -170,22 +170,6 @@ class ActionController extends BaseController
$this->environmentService = $environmentService; $this->environmentService = $environmentService;
} }
/**
* propertyMapper
*
* @var PropertyMapper
*/
protected $propertyMapper;
/**
* @param
*/
public function injectPropertyMapper(
PropertyMapper $propertyMapper
) {
$this->propertyMapper = $propertyMapper;
}
/** /**
* propertyMappingConfigurationBuilder * propertyMappingConfigurationBuilder
* *
@ -776,11 +760,36 @@ class ActionController extends BaseController
} }
if ($this->pageType) { if ($this->pageType) {
if (is_array($this->responseStatus)) { if (is_array($this->responseStatus)) {
$this->response->setStatus( if (version_compare(TYPO3_branch, '10.0', '>=')) {
array_key_first($this->responseStatus) $response = $this
); ->responseFactory
->createResponse()
->withHeader(
'Content-Type',
'application/json; charset=utf-8'
)
->withStatus(
array_key_first($this->responseStatus),
''
);
} else {
$this->response->setStatus(
array_key_first($this->responseStatus)
);
}
} else { } else {
$this->response->setStatus($this->responseStatus); if (version_compare(TYPO3_branch, '10.0', '>=')) {
$response = $this
->responseFactory
->createResponse()
->withHeader(
'Content-Type',
'application/json; charset=utf-8'
)
->withStatus($this->responseStatus, '');
} else {
$this->response->setStatus($this->responseStatus);
}
} }
if ($this->pageType == $this->ajaxPageType) { if ($this->pageType == $this->ajaxPageType) {
if ($this->environmentService->isEnvironmentInBackendMode()) { if ($this->environmentService->isEnvironmentInBackendMode()) {

View File

@ -41,9 +41,14 @@ class TranslationController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
$languageFactory = GeneralUtility::makeInstance( $languageFactory = GeneralUtility::makeInstance(
LocalizationFactory::class LocalizationFactory::class
); );
$language = $this->request->getAttribute('language');
$locale = $language->getLocale();
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
// $locale, '$locale', 3, true, false
//);
$langfileContent = $languageFactory->getParsedData( $langfileContent = $languageFactory->getParsedData(
$langfilePath, $langfilePath,
$GLOBALS['LANG']->lang $locale
); );
$langfileResult = []; $langfileResult = [];
foreach (reset($langfileContent) as $key => $row) { foreach (reset($langfileContent) as $key => $row) {

View File

@ -102,11 +102,17 @@ trait DependencyInjectionTrait
$frameworkConfiguration['persistence']['storagePid'] $frameworkConfiguration['persistence']['storagePid']
) )
); );
$this->reflectionService = GeneralUtility::makeInstance( if (version_compare(TYPO3_branch, '10.0', '>=')) {
ReflectionService::class, GeneralUtility::makeInstance( $this->reflectionService = GeneralUtility::makeInstance(
CacheManager::class ReflectionService::class
) );
); } else {
$this->reflectionService = GeneralUtility::makeInstance(
ReflectionService::class, GeneralUtility::makeInstance(
CacheManager::class
)
);
}
$classInfo = $this->reflectionService->getClassSchema( $classInfo = $this->reflectionService->getClassSchema(
get_class($this) get_class($this)
); );

View File

@ -66,7 +66,7 @@ class TranslationViewHelper extends AbstractViewHelper
$translation = LocalizationUtility::translate( $translation = LocalizationUtility::translate(
$arguments['key'], $arguments['key'],
$arguments['extensionKey'], $arguments['extensionKey'],
$arguments['arguments'] (array) $arguments['arguments']
); );
if ($translation) { if ($translation) {
return $translation; return $translation;

View File

@ -0,0 +1,14 @@
<?php
defined('TYPO3') || die();
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'TemplatesAide',
'Dummy',
'dummy'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'TemplatesAide',
'Translationplugin',
'translation'
);

View File

@ -18,6 +18,16 @@
<f:variable name="buttonBackgroundcolor" value="#8ABF6F" /> <f:variable name="buttonBackgroundcolor" value="#8ABF6F" />
</f:else> </f:else>
</f:if> </f:if>
<f:if condition="{styleH1}">
<f:else>
<f:variable name="styleH1" value="" />
</f:else>
</f:if>
<f:if condition="{styleButton}">
<f:else>
<f:variable name="styleButton" value="padding: 10px 15px; border-radius: 3px;" />
</f:else>
</f:if>
<f:variable name="widthPadded" value="{width - padding - padding}" /> <f:variable name="widthPadded" value="{width - padding - padding}" />
<f:variable name="widthTableColumn" value="{widthPadded / 2}" /> <f:variable name="widthTableColumn" value="{widthPadded / 2}" />
@ -81,7 +91,7 @@
<div style="font-family:Arial, sans-serif;font-size:16px;line-height:1.4;text-align:{align};color:#000000;"> <div style="font-family:Arial, sans-serif;font-size:16px;line-height:1.4;text-align:{align};color:#000000;">
<f:switch expression="{row.type}"> <f:switch expression="{row.type}">
<f:case value="headline"> <f:case value="headline">
<h1>{row.data -> f:format.nl2br() -> f:format.raw()}</h1> <h1 style="{styleH1}">{row.data -> f:format.nl2br() -> f:format.raw()}</h1>
</f:case> </f:case>
<f:case value="headline2"> <f:case value="headline2">
<h2>{row.data -> f:format.nl2br() -> f:format.raw()}</h2> <h2>{row.data -> f:format.nl2br() -> f:format.raw()}</h2>
@ -103,7 +113,7 @@
<span style="display: inline-block;" class="buttonwrapper"> <span style="display: inline-block;" class="buttonwrapper">
<f:variable name="rowData">{row.data -> v:format.json.decode()}</f:variable> <f:variable name="rowData">{row.data -> v:format.json.decode()}</f:variable>
<a style="display: inline-block; color: {buttonColor}" target="_blank" href="{rowData.0}"> <a style="display: inline-block; color: {buttonColor}" target="_blank" href="{rowData.0}">
<span style="display: inline-block; padding: 10px 15px; border-radius: 3px; background-color: {buttonBackgroundcolor};"> <span style="display: inline-block; background-color: {buttonBackgroundcolor}; {styleButton}">
{rowData.1} {rowData.1}
</span> </span>
</a> </a>

View File

@ -1,6 +1,3 @@
#options.pageTree.showPageIdWithTitle = 1
options.pageTree.showNavTitle = 1
options { options {
folderTree { folderTree {
uploadFieldsInLinkBrowser = 0 uploadFieldsInLinkBrowser = 0

View File

@ -9,7 +9,7 @@
} }
], ],
"require": { "require": {
"typo3/cms-core": "8.7.0 - 10.99.99", "typo3/cms-core": "8.7.0 - 11.99.99",
"sarhan/php-flatten": "^4.0" "sarhan/php-flatten": "^4.0"
}, },
"autoload": { "autoload": {

View File

@ -23,7 +23,6 @@ $EM_CONF[$_EXTKEY] = [
'version' => '0.0.1', 'version' => '0.0.1',
'constraints' => [ 'constraints' => [
'depends' => [ 'depends' => [
'typo3' => '8.7.0-10.99.99',
], ],
'conflicts' => [], 'conflicts' => [],
'suggests' => [], 'suggests' => [],

View File

@ -1,36 +1,59 @@
<?php <?php
defined('TYPO3_MODE') || die('Access denied.'); defined('TYPO3_MODE') || die('Access denied.');
(static function() {
})();
call_user_func( call_user_func(
function() function()
{ {
if (version_compare(TYPO3_branch, '10.0', '>=')) {
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cjel.TemplatesAide', 'TemplatesAide',
'Dummy', 'Translationplugin',
[ [
'Dummy' => 'list', \Cjel\TemplatesAide\Controller\TranslationController::class => 'translations'
'Translation' => 'translations' ],
], // non-cacheable actions
// non-cacheable actions [
[ \Cjel\TemplatesAide\Controller\TranslationController::class => ''
'Dummy' => '', ]
'Translation' => '' );
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin( } else {
'Cjel.TemplatesAide',
'Translationplugin', \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
[ 'Cjel.TemplatesAide',
'Translation' => 'translations' 'Dummy',
], [
// non-cacheable actions 'Dummy' => 'list',
[ 'Translation' => 'translations'
'Dummy' => '', ],
'Translation' => '' // non-cacheable actions
] [
); 'Dummy' => '',
'Translation' => ''
]
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'Cjel.TemplatesAide',
'Translationplugin',
[
'Translation' => 'translations'
],
// non-cacheable actions
[
'Dummy' => '',
'Translation' => ''
]
);
}
// wizards // wizards
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig( \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
@ -119,4 +142,4 @@ call_user_func(
} }
); );

View File

@ -39,14 +39,25 @@ call_user_func(
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'][] = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'][] =
\Cjel\TemplatesAide\Hooks\WizardItems::class; \Cjel\TemplatesAide\Hooks\WizardItems::class;
if(\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->isDevelopment()) {
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] =
'EXT:templates_aide/Resources/Public/Css/backend/dev';
}
if(\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->__toString() === 'Production/Stage') { if (version_compare(TYPO3_branch, '10.0', '>=')) {
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] = if (\TYPO3\CMS\Core\Core\Environment::getContext()->isDevelopment()) {
'EXT:templates_aide/Resources/Public/Css/backend/production-stage'; $GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] =
'EXT:templates_aide/Resources/Public/Css/backend/dev';
}
if(\TYPO3\CMS\Core\Core\Environment::getContext()->__toString() === 'Production/Stage') {
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] =
'EXT:templates_aide/Resources/Public/Css/backend/production-stage';
}
} else {
if (\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->isDevelopment()) {
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] =
'EXT:templates_aide/Resources/Public/Css/backend/dev';
}
if(\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()->__toString() === 'Production/Stage') {
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['dev'] =
'EXT:templates_aide/Resources/Public/Css/backend/production-stage';
}
} }
$GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['templates_aide_default'] = $GLOBALS['TBE_STYLES']['skins']['backend']['stylesheetDirectories']['templates_aide_default'] =
@ -83,4 +94,4 @@ $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] = str_replace(
'recursiveDelete', 'recursiveDelete',
'recursiveDelete,disableDragModal', 'recursiveDelete,disableDragModal',
$GLOBALS['TYPO3_USER_SETTINGS']['showitem'], $GLOBALS['TYPO3_USER_SETTINGS']['showitem'],
); );