Skip to content
Snippets Groups Projects
Commit 7009e3ac authored by Stefan Galinski's avatar Stefan Galinski :video_game:
Browse files

Merge remote-tracking branch 'origin/master' into feature_security_update

parents 4ed316f5 56a2d3b1
No related branches found
No related tags found
1 merge request!11Feature security update
Showing
with 552 additions and 20 deletions
<?php
namespace SGalinski\SgMail\Controller;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgMail\Service\BackendService;
use SGalinski\SgMail\Service\MailTemplateService;
use SGalinski\SgMail\Service\TypoScriptSettingsService;
use SGalinski\SgMail\Session\PhpSession;
use TYPO3\CMS\Backend\Template\Components\DocHeaderComponent;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\Exception\StopActionException;
use TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
/**
* Controller for the configuration mode of the backend module
*/
class ConfigurationController extends ActionController {
const DEFAULT_EXTENSION_KEY = 'sg_mail';
/**
* DocHeaderComponent
*
* @var DocHeaderComponent
*/
protected $docHeaderComponent;
/**
* @var \SGalinski\SgMail\Session\PhpSession
*/
protected $session;
/**
*
* @param string $selectedTemplate
* @param string $selectedExtension
* @param array $filters
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
*/
public function indexAction($selectedTemplate = NULL, $selectedExtension = NULL, array $filters = []) {
if ($this->request->hasArgument('message')) {
$this->addFlashMessage($this->request->getArgument('message'), '', FlashMessage::ERROR);
}
$pageUid = (int) GeneralUtility::_GP('id');
$registerArray = BackendService::getNonBlacklistedTemplates($pageUid);
if ($selectedTemplate === NULL || $selectedTemplate === '') {
if (!empty($registerArray)) {
$selectedExtension = \key($registerArray);
}
if (!empty($registerArray)) {
$selectedTemplate = \key($registerArray[$selectedExtension]);
}
}
// make docheader
$this->docHeaderComponent = GeneralUtility::makeInstance(DocHeaderComponent::class);
$pageInfo = BackendUtility::readPageAccess($pageUid, $GLOBALS['BE_USER']->getPagePermsClause(1));
if ($pageInfo === FALSE) {
$pageInfo = ['uid' => $pageUid];
}
$this->docHeaderComponent->setMetaInformation($pageInfo);
BackendService::makeButtons($this->docHeaderComponent, $this->request);
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
$this->view->assign('selectedTemplateFilter', $filters['filterTemplate']);
$this->view->assign('selectedExtensionFilter', $filters['filterExtension']);
$this->view->assign('typo3Version', VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version));
$this->view->assign('selectedTemplateKey', $selectedTemplate);
$this->view->assign('selectedExtensionKey', $selectedExtension);
$this->view->assign('mode', 'editor');
}
/**
* Create the template or display errors that occured
*
* @throws StopActionException
* @throws UnsupportedRequestTypeException
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
*/
public function createAction() {
if (!$this->request->hasArgument('configuration')) {
$this->redirect(
'index', 'Configuration', NULL,
['message' => LocalizationUtility::translate('backend.create_error', 'sg_mail')]
);
}
/** @var array $configuration */
$configuration = $this->request->getArgument('configuration');
$templateName = $configuration['templateName'];
$csv = str_replace("\r", '', $configuration['csv']);
$subject = $configuration['subject'];
$description = $configuration['description'];
$markersCsv = \explode("\n", $csv);
$markers = [];
foreach ($markersCsv as $markerCsv) {
$rowArray = str_getcsv($markerCsv, ';');
if (!$rowArray[0]) {
continue;
}
$markers[] = [
'identifier' => $rowArray[0],
'value' => $rowArray[1],
'description' => $rowArray[2]
];
}
$this->writeRegisterFile($templateName, self::DEFAULT_EXTENSION_KEY, $markers, $subject, $description);
MailTemplateService::registerExtensions();
$this->clearCaches();
// store selected template & extension key in the session
if (!($this->session instanceof PhpSession)) {
$this->session = $this->objectManager->get(PhpSession::class);
$this->session->setSessionKey('sg_mail_controller_session');
} else {
$this->session->setSessionKey('sg_mail_controller_session');
}
$this->session->setDataByKey('selectedTemplate', $templateName);
$this->session->setDataByKey('selectedExtension', self::DEFAULT_EXTENSION_KEY);
$this->redirect(
'index', 'Mail', NULL,
['message' => LocalizationUtility::translate('backend.create_message', 'sg_mail')]
);
}
/**
* Write the mail registration file
*
* @TODO move this to the register service class when security update is merged. refactor in FormEditorController xclass as well
*
* @param string $templateKey
* @param string $extensionKey
* @param array $markers
* @param string $subject
* @param string $description
*/
private function writeRegisterFile($templateKey, $extensionKey, $markers, $subject, $description) {
// get the location where registrations should be stored
$configurationLocation = $this->getRegistrationPath();
$registerFolder = GeneralUtility::getFileAbsFileName(
$configurationLocation
);
// create folder
GeneralUtility::mkdir($registerFolder);
$registerFile = GeneralUtility::getFileAbsFileName(
$registerFolder . '/' . $templateKey . '.php'
);
// build the register array
$newRegisterArray = [
'extension_key' => $extensionKey,
'template_key' => $templateKey,
'description' => $description,
'subject' => $subject,
'markers' => []
];
// add the markers for this template
foreach ($markers as $marker) {
$markerName = $marker['identifier'];
$newRegisterArray['markers'][] = [
'marker' => $markerName,
'type' => MailTemplateService::MARKER_TYPE_STRING,
'value' => $marker['value'],
'description' => $marker['description']
];
}
file_put_contents($registerFile, '<?php return ' . var_export($newRegisterArray, TRUE) . ';');
}
/**
* Returns the path to the configured location where automatic mail template registrations should be
*
* @TODO move this to the register service class when security update is merged. refactor in FormEditorController xclass as well
*
* @return string
*/
private function getRegistrationPath(): string {
// get typoscript settings from sg mail
/** @var TypoScriptSettingsService $typoScriptSettingsService */
$typoScriptSettingsService = $this->objectManager->get(TypoScriptSettingsService::class);
$tsSettings = $typoScriptSettingsService->getSettings(0, 'tx_sgmail');
// get the location where automatic registrations should be stored
return 'EXT:' . $tsSettings['mail']['configurationLocation'] . '/' . MailTemplateService::CONFIG_PATH;
}
/**
* Clear the sgmail register cache
*
* @TODO move this to the register service class when security update is merged. refactor in FormEditorController xclass as well
*
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
private function clearCaches() {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$cacheManager = $objectManager->get(CacheManager::class);
/** @var FrontendInterface $cache */
$cache = $cacheManager->getCache(MailTemplateService::CACHE_NAME);
/** @var FrontendInterface $cache */
$cache->flush();
}
}
......@@ -82,6 +82,10 @@ class MailController extends ActionController {
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException
*/
public function indexAction(array $parameters = []) {
if ($this->request->hasArgument('message')) {
$this->addFlashMessage($this->request->getArgument('message'), '', FlashMessage::INFO);
}
$pid = (int) GeneralUtility::_GP('id');
if (!($this->session instanceof PhpSession)) {
......
......@@ -153,8 +153,8 @@ class QueueController extends ActionController {
$pageInfo = ['uid' => $pageUid];
}
$this->docHeaderComponent->setMetaInformation($pageInfo);
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
BackendService::makeButtons($this->docHeaderComponent, $this->request);
$this->view->assign('docHeader', $this->docHeaderComponent->docHeaderContent());
$this->view->assign('typo3Version', VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version));
}
......
......@@ -84,9 +84,9 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
foreach ($finishers as $finisher) {
// if one finisher prevents automatic registration, exit this function
// if the current finisher prevents automatic registration, exit this iteration
if (!$finisher['options']['automaticRegistration']) {
return;
continue;
}
if (!\in_array($finisher['identifier'], self::MAIL_FINISHER, TRUE)) {
......
<?php
namespace SGalinski\SgMail\XClass\Form;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/** @noinspection LongInheritanceChainInspection */
use SGalinski\SgMail\Service\MailTemplateService;
use SGalinski\SgMail\Service\TypoScriptSettingsService;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
/**
* Displays the form editor. Enables hooking into the save process of the form to handle automatic sg mail registration
*/
class FormManagerController extends \TYPO3\CMS\Form\Controller\FormManagerController {
/**
* Delete the SgMail Registration file for the deleted form and clear the cache afterwards
*
* @param string $formPersistenceIdentifier persistence identifier to delete
* @internal
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
public function deleteAction(string $formPersistenceIdentifier) {
// build the path to the register file
$filePath = \str_replace(
'.form.yaml', '.php', \substr($formPersistenceIdentifier, \strrpos($formPersistenceIdentifier, '/') + 1)
);
$fileName = GeneralUtility::getFileAbsFileName($this->getRegistrationPath() . '/' . $filePath);
// delete the file if found
if (\file_exists($fileName)) {
\unlink($fileName);
$this->clearCaches();
}
// needs to be done last because of the internal redirect
parent::deleteAction($formPersistenceIdentifier);
}
/**
* Returns the path to the configured location where automatic mail template registrations should be
*
* @return string
*/
private function getRegistrationPath(): string {
// get typoscript settings from sg mail
/** @var TypoScriptSettingsService $typoScriptSettingsService */
$typoScriptSettingsService = $this->objectManager->get(TypoScriptSettingsService::class);
$tsSettings = $typoScriptSettingsService->getSettings(0, 'tx_sgmail');
// get the location where automatic registrations should be stored
return 'EXT:' . $tsSettings['mail']['configurationLocation'] . '/' . MailTemplateService::CONFIG_PATH;
}
/**
* Clear the sgmail register cache
*
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException
*/
private function clearCaches() {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$cacheManager = $objectManager->get(CacheManager::class);
/** @var FrontendInterface $cache */
$cache = $cacheManager->getCache(MailTemplateService::CACHE_NAME);
/** @var FrontendInterface $cache */
$cache->flush();
}
}
......@@ -13,7 +13,7 @@ TYPO3:
options:
extension: 'sg_mail'
template: ''
automaticRegistration: ''
automaticRegistration: true
ignoreMailQueue: true
mailTo: ''
userName: ''
......@@ -29,7 +29,7 @@ TYPO3:
options:
extension: 'sg_mail'
template: ''
automaticRegistration: ''
automaticRegistration: true
ignoreMailQueue: true
mailTo: ''
mailFrom: ''
......
......@@ -29,6 +29,10 @@
<source><![CDATA[Show mails from blacklisted templates]]></source>
<target><![CDATA[Mails basierend auf gesperrten Templates anzeigen]]></target>
</trans-unit>
<trans-unit id="backend.button_create" approved="yes">
<source><![CDATA[Register new template]]></source>
<target><![CDATA[Neues Template registrieren]]></target>
</trans-unit>
<trans-unit id="backend.button_download_csv" approved="yes">
<source><![CDATA[Export CSV]]></source>
<target><![CDATA[CSV exportieren]]></target>
......@@ -53,6 +57,50 @@
<source><![CDATA[Text]]></source>
<target><![CDATA[Text]]></target>
</trans-unit>
<trans-unit id="backend.create.csv" approved="yes">
<source><![CDATA[Marker (csv format)]]></source>
<target><![CDATA[Marker (csv Format)]]></target>
</trans-unit>
<trans-unit id="backend.create.description" approved="yes">
<source><![CDATA[Description]]></source>
<target><![CDATA[Beschreibung]]></target>
</trans-unit>
<trans-unit id="backend.create.info" approved="yes">
<source><![CDATA[Please insert the template marker in the following format: markerName; exampleValue; description <br /><br />Whitespaces in marker names are ignored. <br />If you have multiple markers, seperate them with a new line: markerName1; exampleValue1; description1<br />markerName2; exampleValue2; description2 <br /><br />Example: first_name; Max; The first name of the client <br />last_name; Mustermann; The last name of the client]]></source>
<target><![CDATA[Bitte geben Sie die Template Marker im folgenden Format ein: markerName; beispiel; beschreibung <br /><br />Leerzeichen in Markernamen werden ignoriert. <br /><br />Mehrere Marker werden mit der Eingabetaste getrennt: markerName1; beispiel1; beschreibung1<br />markerName2; beispiel2; beschreibung2 <br /><br />Beispiel: first_name; Max; Der Vorname des Kunden<br /> last_name; Mustermann; Der Nachname des Kunden]]></target>
</trans-unit>
<trans-unit id="backend.create.info_header" approved="yes">
<source><![CDATA[Usage Information]]></source>
<target><![CDATA[Hinweise zur Benutzung]]></target>
</trans-unit>
<trans-unit id="backend.create.markers" approved="yes">
<source><![CDATA[Template marker]]></source>
<target><![CDATA[Template Marker]]></target>
</trans-unit>
<trans-unit id="backend.create.save" approved="yes">
<source><![CDATA[Save]]></source>
<target><![CDATA[Speichern]]></target>
</trans-unit>
<trans-unit id="backend.create.subject" approved="yes">
<source><![CDATA[Subject]]></source>
<target><![CDATA[Betreff]]></target>
</trans-unit>
<trans-unit id="backend.create.templateName" approved="yes">
<source><![CDATA[Template name]]></source>
<target><![CDATA[Template Name]]></target>
</trans-unit>
<trans-unit id="backend.create_error" approved="yes">
<source><![CDATA[Something went wrong.. Please try again!]]></source>
<target><![CDATA[Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.]]></target>
</trans-unit>
<trans-unit id="backend.create_message" approved="yes">
<source><![CDATA[Mail template was successfully registered. You can now edit the content below.]]></source>
<target><![CDATA[Die Registrierung war erfolgreich. Sie können nun den Inhalt der Mails im Editor (siehe unten) bearbeiten.]]></target>
</trans-unit>
<trans-unit id="backend.default_extension_name" approved="yes">
<source><![CDATA[Own templates]]></source>
<target><![CDATA[Eigene Templates]]></target>
</trans-unit>
<trans-unit id="backend.delete_template" approved="yes">
<source><![CDATA[Do you really want to reset this template?]]></source>
<target><![CDATA[Möchten Sie wirklich den Ursprungszustand wiederherstellen?]]></target>
......@@ -407,4 +455,4 @@ Die Templates declined und approved der Extension sg_comments sind für alle Dom
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
......@@ -24,6 +24,9 @@
<trans-unit id="backend.blacklisted">
<source><![CDATA[Show mails from blacklisted templates]]></source>
</trans-unit>
<trans-unit id="backend.button_create">
<source><![CDATA[Register new template]]></source>
</trans-unit>
<trans-unit id="backend.button_download_csv">
<source><![CDATA[Export CSV]]></source>
</trans-unit>
......@@ -49,6 +52,48 @@
<source><![CDATA[Some template configurations have been registered in an old way and won`t work in future versions.
Please register your configurations in the according ext_local_conf.php.]]></source>
</trans-unit>
<trans-unit id="backend.configuration">
<source><![CDATA[Configuration editor]]></source>
</trans-unit>
<trans-unit id="backend.content">
<source><![CDATA[Text]]></source>
</trans-unit>
<trans-unit id="backend.create.csv">
<source><![CDATA[Marker (csv format)]]></source>
</trans-unit>
<trans-unit id="backend.create.description">
<source><![CDATA[Description]]></source>
</trans-unit>
<trans-unit id="backend.create.info">
<source><![CDATA[Please insert the template marker in the following format: markerName; exampleValue; description <br /><br />Whitespaces in marker names are ignored. <br />If you have multiple markers, seperate them with a new line: markerName1; exampleValue1; description1<br />markerName2; exampleValue2; description2 <br /><br />Example: first_name; Max; The first name of the client <br />last_name; Mustermann; The last name of the client]]></source>
</trans-unit>
<trans-unit id="backend.create.info_header">
<source><![CDATA[Usage Information]]></source>
</trans-unit>
<trans-unit id="backend.create.markers">
<source><![CDATA[Template marker]]></source>
</trans-unit>
<trans-unit id="backend.create.save">
<source><![CDATA[Save]]></source>
</trans-unit>
<trans-unit id="backend.create.subject">
<source><![CDATA[Subject]]></source>
</trans-unit>
<trans-unit id="backend.create.templateName">
<source><![CDATA[Template name]]></source>
</trans-unit>
<trans-unit id="backend.create_error">
<source><![CDATA[Something went wrong.. Please try again!]]></source>
</trans-unit>
<trans-unit id="backend.create_message">
<source><![CDATA[Mail template was successfully registered. You can now edit the content below.]]></source>
</trans-unit>
<trans-unit id="backend.default_extension_name">
<source><![CDATA[Own templates]]></source>
</trans-unit>
<trans-unit id="backend.delete_template">
<source><![CDATA[Do you really want to reset this template?]]></source>
</trans-unit>
<trans-unit id="backend.description">
<source><![CDATA[Description]]></source>
</trans-unit>
......@@ -301,4 +346,4 @@ The templates declined and approved of the sg_comments extension are blacklisted
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
......@@ -85,7 +85,7 @@
</f:if>
<f:else>
<f:if condition="{mode} == 'editor'">
<sgm:be.menus.actionMenuOptionGroup label="{extensionKey}">
<sgm:be.menus.actionMenuOptionGroup label="{f:if(condition: '{extensionKey} == \'sg_mail\'', then: '{f:translate(key: \'backend.default_extension_name\')}', else: '{extensionKey}')}">
<f:for each="{template}" as="currentTemplate" key="templateKey">
<sgm:extendedIf condition="{selectedTemplateKey} == {templateKey}"
and="{selectedExtensionKey} == {extensionKey}">
......@@ -111,6 +111,7 @@
</f:be.menus.actionMenu>
</f:if>
</div>
<f:render section="iconButtons" />
<div class="module-docheader-bar-column-right">
<f:render partial="ButtonBar" arguments="{buttons:docHeader.buttons.right}" />
</div>
......
{namespace sgm=SGalinski\SgMail\ViewHelpers}
<f:be.container enableClickMenu="FALSE" loadExtJs="FALSE" includeCssFiles="{0: '{f:uri.resource(path: \'StyleSheets/backend.css\')}'}"
includeRequireJsModules="{
0: 'TYPO3/CMS/Backend/AjaxDataHandler',
1: '{f:if(condition: \'{typo3Version} < 8000000 \', then: \'TYPO3/CMS/Backend/ClickMenu\', else: \'TYPO3/CMS/Backend/ContextMenu\')}',
2: 'TYPO3/CMS/Backend/Tooltip',
3: 'TYPO3/CMS/Backend/DateTimePicker'}">
<sgm:addJavaScriptFile javaScriptFile="{f:uri.resource(path: 'Scripts/Backend.js')}" />
<sgm:inlineLanguageLabels labels="backend.delete_template, backend.send_mail_manually, backend.send_mail_again" />
<div class="module" data-module-id="" data-module-name="">
<div class="module-docheader t3js-module-docheader">
<div class="module-docheader-bar module-docheader-bar-navigation t3js-module-docheader-bar t3js-module-docheader-bar-navigation">
<div class="module-docheader-bar-column-right">
<span class="typo3-docheader-pagePath"><f:translate key="LLL:EXT:lang/locallang_core.xlf:labels.path" />: <f:format.raw>{docHeader.metaInformation.path}</f:format.raw></span>
<f:format.raw>{docHeader.metaInformation.recordInformation}</f:format.raw>
</div>
</div>
</div>
</div>
<div id="typo3-docbody">
<div id="typo3-inner-docbody">
<f:render section="content" />
</div>
</div>
</f:be.container>
......@@ -20,14 +20,14 @@
<sgm:be.menus.actionMenuItem label="{f:translate(key:'backend.mail_queue')}"
controller="Queue"
action="index"
additionalAttributes="{selected: 'selected'}"
arguments="{parameters: {selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}}" />
arguments="{selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{f:translate(key:'backend.mail_queue')}"
controller="Queue"
action="index"
arguments="{parameters: {selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}}" />
arguments="{selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}" />
</f:else>
</f:if>
<f:if condition="{mode} == 'editor'">
......@@ -35,14 +35,14 @@
<sgm:be.menus.actionMenuItem label="{f:translate(key:'backend.template_editor')}"
controller="Mail"
action="index"
arguments="{parameters: {selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}}"
arguments="{selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<sgm:be.menus.actionMenuItem label="{f:translate(key:'backend.template_editor')}"
controller="Mail"
action="index"
arguments="{parameters: {selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}}" />
arguments="{selectedTemplate: selectedTemplateKey, selectedExtension: selectedExtensionKey}" />
</f:else>
</f:if>
</f:be.menus.actionMenu>
......
{namespace sgm=SGalinski\SgMail\ViewHelpers}
<f:layout name="NoMenu" />
<f:section name="iconButtons">
</f:section>
<f:section name="content">
<f:flashMessages />
<br>
<div class="row">
<div class="col-xs-12 col-md-10 col-md-offset-1">
<div class="panel panel-info">
<div class="panel-heading">
<f:translate key="backend.create.info_header" />
</div>
<div class="panel-body">
<f:format.html>
<f:translate key="backend.create.info" />
</f:format.html>
</div>
</div>
</div>
</div>
<f:form action="create" controller="Configuration" method="post" objectName="configuration" object="{configuration}">
<div class="row">
<div class="col-xs-12 col-md-10 col-md-offset-1">
<div class="form-group">
<label for="templateName"><f:translate key="backend.create.templateName" /></label>
<f:form.textfield class="form-control" property="templateName" id="templateName" required="TRUE" />
</div>
<div class="form-group">
<label for="csv"><f:translate key="backend.create.csv" /></label>
<f:form.textarea rows="5" class="form-control" property="csv" id="csv" />
</div>
<div class="form-group">
<label for="subject"><f:translate key="backend.create.subject" /></label>
<f:form.textfield class="form-control" property="subject" id="subject" />
</div>
<div class="form-group">
<label for="description"><f:translate key="backend.create.description" /></label>
<f:form.textarea rows="5" class="form-control" property="description" id="description" />
</div>
<f:form.submit class="btn-primary btn form-group col-xs-12 col-md-2 col-md-offset-10" value="{f:translate(key:'backend.create.save')}" />
</div>
</div>
</f:form>
</f:section>
{namespace sgm=SGalinski\SgMail\ViewHelpers}
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Default" />
<f:section name="iconButtons">
&nbsp;
<f:link.action class="btn btn-default btn-sm" controller="Configuration" action="index" arguments="{template: selectedTemplateKey, extensionKey: selectedTemplate.extension}">
<core:icon identifier="actions-document-new" />
</f:link.action>
</f:section>
<f:section name="content">
<f:flashMessages />
<f:if condition="{selectedTemplate}">
<f:then>
<div class="row form-group col-md-12">
<div class="editor-description col-md-9">
<div class="row form-group col-md-12 ">
<div class="editor-description col-md-6">
<p>{templateDescription}</p>
</div>
<div class=" col-md-3">
<div class="col-md-3 col-md-offset-3">
<f:link.action class="reset-btn reset-all-btn btn-danger btn col-md-12" action="reset" arguments="{template: selectedTemplateKey, extensionKey: selectedTemplate.extension}">{f:translate(key:'backend.button_reset_all')}</f:link.action>
</div>
</div>
......@@ -67,12 +73,16 @@
</f:for>
</f:then>
<f:else>
<f:translate key="{marker.value}">{marker.value}</f:translate>
<f:if condition="{marker.value}">
<f:translate key="{marker.value}">{marker.value}</f:translate>
</f:if>
</f:else>
</f:if>
</td>
<td>
<f:translate key="{marker.description}">{marker.description}</f:translate>
<f:if condition="{marker.description}">
<f:translate key="{marker.description}">{marker.description}</f:translate>
</f:if>
</td>
</tr>
</f:for>
......
......@@ -6,7 +6,7 @@
"license": [
"GPL-2.0-or-later"
],
"version": "4.6.3",
"version": "4.6.4",
"repositories": [
{
"type": "composer",
......
......@@ -8,7 +8,7 @@ $EM_CONF['sg_mail'] = array (
'title' => 'Mail Templates',
'description' => 'Mail Templates',
'category' => 'module',
'version' => '4.6.3',
'version' => '4.6.4',
'state' => 'stable',
'uploadfolder' => false,
'createDirs' => '',
......
......@@ -52,6 +52,11 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Form\Controller\FormEdi
'className' => \SGalinski\SgMail\XClass\Form\FormEditorController::class,
];
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\TYPO3\CMS\Form\Controller\FormManagerController::class] = [
'className' => \SGalinski\SgMail\XClass\Form\FormManagerController::class,
];
// Cache registration
$cacheName = \SGalinski\SgMail\Service\RegisterService::CACHE_NAME;
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'][$cacheName])) {
......
......@@ -12,6 +12,7 @@ if (!defined('TYPO3_MODE')) {
[
'Mail' => 'index, sendTestMail, empty, reset',
'Queue' => 'index, sendMail, export',
'Configuration' => 'index, create',
],
[
'access' => 'user,group',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment