[!!!][TASK] Drop dedicated edit view in EXT:tstemplate 96/52696/9
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 3 May 2017 18:19:24 +0000 (20:19 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 18 May 2017 11:54:11 +0000 (13:54 +0200)
Triggering ext:t3editor out-of-bound of FormEngine is pretty tricky and
blocks further development of t3editor. To streamline this, the
current implementation of t3editor within ext:tstemplate is revamped
and now uses FormEngine directly to edit "constants" and "setup" of
template records.
Some hooks are now obsolete and dropped along the way.

Resolves: #81171
Releases: master
Change-Id: Iab62a15828bfb82bc9f8ad11f705bb4529a38734
Reviewed-on: https://review.typo3.org/52696
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Documentation/Changelog/master/Breaking-81171-EditAbilityOfTypoScriptTemplateInEXTtstemplateRemoved.rst [new file with mode: 0644]
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php [deleted file]
typo3/sysext/t3editor/ext_localconf.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
typo3/sysext/tstemplate/Resources/Private/Language/locallang_info.xlf
typo3/sysext/tstemplate/Resources/Private/Templates/InformationModule.html

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-81171-EditAbilityOfTypoScriptTemplateInEXTtstemplateRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-81171-EditAbilityOfTypoScriptTemplateInEXTtstemplateRemoved.rst
new file mode 100644 (file)
index 0000000..6c84266
--- /dev/null
@@ -0,0 +1,47 @@
+.. include:: ../../Includes.txt
+
+================================================================================
+Breaking: #81171 - Edit ability of TypoScript template in EXT:tstemplate removed
+================================================================================
+
+See :issue:`81171`
+
+Description
+===========
+
+Editing "Constants" and "Setup" of templates in the backend template module has been
+refactored to use FormEngine field rendering instead of and own baked solution.
+
+
+Impact
+======
+
+Rendering the edit form for the fields "Constants" and "Setup" is now done by FormEngine, triggered
+by EditDocumentController. The following code has been removed without substitution:
+
+* Public method :php:`TypoScriptTemplateInformationModuleFunctionController:: processTemplateRowAfterLoading()`
+* Public method :php:`TypoScriptTemplateInformationModuleFunctionController:: processTemplateRowBeforeSaving()`
+* Hook :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook']`
+* Hook :php:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook']`
+* Public property :php:`TypoScriptTemplateModuleController::$e`
+* Hook class :php:`\TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook`
+
+Due to code removal the following features were removed without substitution:
+
+* "Include TypoScript file content" functionality
+* Saving the form via CTRL/CMD+S keystroke
+
+
+Affected Installations
+======================
+
+All installations are affected.
+
+
+Migration
+=========
+
+As the hooks `postTCEProcessingHook` and `postOutputProcessingHook` were removed without
+substitution, any functionality may be migrated to custom FormEngine render types.
+
+.. index:: Backend
diff --git a/typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php b/typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php
deleted file mode 100644 (file)
index 17d97f8..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-namespace TYPO3\CMS\T3editor\Hook;
-
-/*
- * 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!
- */
-
-/**
- * Hook for tstemplate info
- */
-class TypoScriptTemplateInfoHook
-{
-    /**
-     * @var \TYPO3\CMS\T3editor\T3editor
-     */
-    protected $t3editor = null;
-
-    /**
-     * @var string
-     */
-    protected $ajaxSaveType = 'TypoScriptTemplateInformationModuleFunctionController';
-
-    /**
-     * @return \TYPO3\CMS\T3editor\T3editor
-     */
-    protected function getT3editor()
-    {
-        if ($this->t3editor == null) {
-            $this->t3editor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\T3editor\T3editor::class)->setMode(\TYPO3\CMS\T3editor\T3editor::MODE_TYPOSCRIPT)->setAjaxSaveType($this->ajaxSaveType);
-        }
-        return $this->t3editor;
-    }
-
-    /**
-     * Hook-function: inject t3editor JavaScript code before the page is compiled
-     * called in \TYPO3\CMS\Backend\Template\DocumentTemplate:startPage
-     *
-     * @see \TYPO3\CMS\Backend\Template\DocumentTemplate::startPage
-     */
-    public function preStartPageHook()
-    {
-        // Enable editor in Template-Modul
-        if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GET('M') === 'web_ts') {
-            $t3editor = $this->getT3editor();
-            // Insert javascript code
-            $t3editor->getJavascriptCode();
-        }
-    }
-
-    /**
-     * Hook-function:
-     * called in typo3/sysext/tstemplate_info/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
-     *
-     * @param array $parameters
-     * @param \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController $pObj
-     */
-    public function postOutputProcessingHook($parameters, $pObj)
-    {
-        $t3editor = $this->getT3editor();
-        $t3editor->getJavascriptCode();
-        foreach (['constants', 'config'] as $type) {
-            if ($parameters['e'][$type]) {
-                $attributes = 'rows="' . (int)$parameters['numberOfRows'] . '" wrap="off" style="width:98%;height:60%"';
-                $title = $GLOBALS['LANG']->getLL('template') . ' ' . $parameters['tplRow']['title'] . $GLOBALS['LANG']->getLL('delimiter') . ' ' . $GLOBALS['LANG']->getLL($type);
-                $outCode = $t3editor->getCodeEditor('data[' . $type . ']', 'text-monospace enable-tab', '$1', $attributes, $title, [
-                    'pageId' => (int)$pObj->pObj->id
-                ]);
-                $parameters['theOutput'] = preg_replace('/\\<textarea name="data\\[' . $type . '\\]".*\\>([^\\<]*)\\<\\/textarea\\>/mi', $outCode, $parameters['theOutput']);
-            }
-        }
-    }
-
-    /**
-     * Process saving request like in class.tstemplateinfo.php (TCE processing)
-     *
-     * @return bool TRUE if successful
-     */
-    public function save($parameters, $pObj)
-    {
-        $savingsuccess = false;
-        if ($parameters['type'] == $this->ajaxSaveType) {
-            $pageId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pageId');
-            if (!is_numeric($pageId) || $pageId < 1) {
-                return false;
-            }
-            // If given use the requested template_uid
-            // if not, use the first template-record on the page (in this case there should only be one record!)
-            $set = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET');
-            $template_uid = $set['templatesOnPage'] ?: 0;
-            // Defined global here!
-            $tmpl = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::class);
-            $tmpl->init();
-            // Get the first template record on the page, which might be hidden as well
-            // (for instance the TypoScript constant editor is persisting to the first template)
-            $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
-            $existTemplate = is_array($tplRow);
-            if ($existTemplate) {
-                $saveId = $tplRow['_ORIG_uid'] ?: $tplRow['uid'];
-                // Update template ?
-                $POST = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
-                if ($POST['submit']) {
-                    // Set the data to be saved
-                    $recData = [];
-                    if (is_array($POST['data'])) {
-                        foreach ($POST['data'] as $field => $val) {
-                            switch ($field) {
-                                case 'constants':
-                                case 'config':
-                                    // Replace Windows- and Mac linebreaks
-                                    $val = str_replace([CRLF, CR], LF, $val);
-                                    $recData['sys_template'][$saveId][$field] = $val;
-                                    break;
-                            }
-                        }
-                    }
-                    if (!empty($recData)) {
-                        // process template row before saving
-                        $tstemplateinfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController::class);
-                        /* @var $tstemplateinfo \TYPO3\CMS\Tstemplate\Controller\TypoScriptTemplateInformationModuleFunctionController */
-                        // load the MOD_SETTINGS in order to check if the includeTypoScriptFileContent is set
-                        $tstemplateinfo->pObj = $pObj;
-                        $tstemplateinfo->pObj->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData(['includeTypoScriptFileContent' => true], [], 'web_ts');
-                        $recData['sys_template'][$saveId] = $tstemplateinfo->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]);
-                        // Create new tce-object
-                        $tce = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\DataHandling\DataHandler::class);
-                        // Initialize
-                        $tce->start($recData, []);
-                        // Saved the stuff
-                        $tce->process_datamap();
-                        // Clear the cache (note: currently only admin-users can clear the
-                        // cache in tce_main.php)
-                        $tce->clear_cacheCmd('all');
-                        $savingsuccess = true;
-                    }
-                }
-            }
-        }
-        return $savingsuccess;
-    }
-}
index 4dfb77c..52b5279 100644 (file)
@@ -3,9 +3,6 @@ defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'BE') {
     // Register hooks for tstemplate module
-    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->preStartPageHook';
-    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'][] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->postOutputProcessingHook';
-    $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['tx_tstemplateinfo'] = \TYPO3\CMS\T3editor\Hook\TypoScriptTemplateInfoHook::class . '->save';
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/t3editor/classes/class.tx_t3editor.php']['ajaxSaveCode']['file_edit'] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->save';
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preStartPageHook'][] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->preStartPageHook';
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'][] = \TYPO3\CMS\T3editor\Hook\FileEditHook::class . '->preOutputProcessingHook';
index 242c080..1133b6b 100644 (file)
@@ -16,10 +16,8 @@ namespace TYPO3\CMS\Tstemplate\Controller;
 
 use TYPO3\CMS\Backend\Module\AbstractFunctionModule;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
-use TYPO3\CMS\Core\DataHandling\DataHandler;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
-use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Fluid\View\StandaloneView;
@@ -63,32 +61,23 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
      */
     public function tableRowData($label, $data, $field, $id)
     {
-        if ($field === 'config' || $field === 'constants') {
-            $urlParameters = [
-                'id' => $this->pObj->id,
-                'e' => [
-                    $field => 1
+        $urlParameters = [
+            'edit' => [
+                'sys_template' => [
+                    $id => 'edit'
                 ]
-            ];
-            $url = BackendUtility::getModuleUrl('web_ts', $urlParameters);
-        } else {
-            $urlParameters = [
-                'edit' => [
-                    'sys_template' => [
-                        $id => 'edit'
-                    ]
-                ],
-                'columnsOnly' => $field,
-                'createExtension' => 0,
-                'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
-            ];
-            $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
-        }
-        $row = [];
-        $row['url'] = $url;
-        $row['data'] = $data;
-        $row['label'] = $label;
-        return $row;
+            ],
+            'columnsOnly' => $field,
+            'createExtension' => 0,
+            'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
+        ];
+        $url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
+
+        return [
+            'url' => $url,
+            'data' => $data,
+            'label' => $label
+        ];
     }
 
     /**
@@ -110,44 +99,12 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
         // Get the row of the first VISIBLE template of the page. where clause like the frontend.
         $this->templateRow = $this->templateService->ext_getFirstTemplate($pageId, $template_uid);
         if (is_array($this->templateRow)) {
-            $this->templateRow = $this->processTemplateRowAfterLoading($this->templateRow);
             return true;
         }
         return false;
     }
 
     /**
-     * Process template row after loading
-     *
-     * @param array $tplRow Template row
-     * @return array Preprocessed template row
-     */
-    public function processTemplateRowAfterLoading(array $tplRow)
-    {
-        if ($this->pObj->MOD_SETTINGS['includeTypoScriptFileContent']) {
-            // Let the recursion detection counter start at 91, so that only 10 recursive calls will be resolved
-            // Otherwise the editor will be bloated with way to many lines making it hard the break the cyclic recursion.
-            $tplRow['config'] = TypoScriptParser::checkIncludeLines($tplRow['config'], 91);
-            $tplRow['constants'] = TypoScriptParser::checkIncludeLines($tplRow['constants'], 91);
-        }
-        return $tplRow;
-    }
-
-    /**
-     * Process template row before saving
-     *
-     * @param array $tplRow Template row
-     * @return array Preprocessed template row
-     */
-    public function processTemplateRowBeforeSaving(array $tplRow)
-    {
-        if ($this->pObj->MOD_SETTINGS['includeTypoScriptFileContent']) {
-            $tplRow = TypoScriptParser::extractIncludes_array($tplRow);
-        }
-        return $tplRow;
-    }
-
-    /**
      * @return LanguageService
      */
     protected function getLanguageService()
@@ -162,8 +119,6 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
      */
     public function main()
     {
-        $this->pObj->MOD_MENU['includeTypoScriptFileContent'] = true;
-        $e = $this->pObj->e;
         // Checking for more than one template an if, set a menu...
         $manyTemplatesMenu = $this->pObj->templateMenu();
         $template_uid = 0;
@@ -193,79 +148,13 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
             $lang->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang_info.xlf');
             $assigns = [];
             $assigns['LLPrefix'] = 'LLL:EXT:tstemplate/Resources/Private/Language/locallang_info.xlf:';
-            // Update template ?
-            $POST = GeneralUtility::_POST();
-            if (
-                isset($POST['_savedok'])
-                || isset($POST['_saveandclosedok'])
-            ) {
-                // Set the data to be saved
-                $recData = [];
-                $alternativeFileName = [];
-                if (is_array($POST['data'])) {
-                    foreach ($POST['data'] as $field => $val) {
-                        switch ($field) {
-                            case 'constants':
-                            case 'config':
-                                $recData['sys_template'][$saveId][$field] = $val;
-                            break;
-                        }
-                    }
-                }
-                if (!empty($recData)) {
-                    $recData['sys_template'][$saveId] = $this->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]);
-                    // Create new  tce-object
-                    $tce = GeneralUtility::makeInstance(DataHandler::class);
-                    $tce->alternativeFileName = $alternativeFileName;
-                    // Initialize
-                    $tce->start($recData, []);
-                    // Saved the stuff
-                    $tce->process_datamap();
-                    // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
-                    $tce->clear_cacheCmd('all');
-                    // tce were processed successfully
-                    $this->tce_processed = true;
-                    // re-read the template ...
-                    $this->initialize_editor($this->pObj->id, $template_uid);
-                    // reload template menu
-                    $manyTemplatesMenu = $this->pObj->templateMenu();
-                }
-            }
-            // Hook post updating template/TCE processing
-            if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'])) {
-                $postTCEProcessingHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'];
-                if (is_array($postTCEProcessingHook)) {
-                    $hookParameters = [
-                        'POST' => $POST,
-                        'tce' => $tce
-                    ];
-                    foreach ($postTCEProcessingHook as $hookFunction) {
-                        GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                    }
-                }
-            }
+
             $assigns['title'] = trim($this->templateRow['title']);
             $assigns['siteTitle'] = trim($this->templateRow['sitetitle']);
             $assigns['templateRecord'] = $this->templateRow;
             if ($manyTemplatesMenu) {
                 $assigns['manyTemplatesMenu'] = $manyTemplatesMenu;
             }
-            $numberOfRows = 35;
-            $assigns['numberOfRows'] = $numberOfRows;
-            // If abort pressed, nothing should be edited:
-            if (isset($POST['_saveandclosedok'])) {
-                unset($e);
-            }
-            if (isset($e['constants'])) {
-                $assigns['showConstantsEditor'] = true;
-                $assigns['constants'] = $this->templateRow['constants'];
-                $assigns['constantsLabel'] = BackendUtility::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], '', '&e[constants]=1', 'id="checkIncludeTypoScriptFileContent"');
-            }
-            if (isset($e['config'])) {
-                $assigns['showConfigEditor'] = true;
-                $assigns['config'] = $this->templateRow['config'];
-                $assigns['configLabel'] = BackendUtility::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], '', '&e[config]=1', 'id="checkIncludeTypoScriptFileContent"');
-            }
 
             // Processing:
             $tableRows = [];
@@ -295,23 +184,6 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
             ));
             $view->assignMultiple($assigns);
             $theOutput = $view->render();
-
-            // hook after compiling the output
-            if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'])) {
-                $postOutputProcessingHook = &$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postOutputProcessingHook'];
-                if (is_array($postOutputProcessingHook)) {
-                    $hookParameters = [
-                        'theOutput' => &$theOutput,
-                        'POST' => $POST,
-                        'e' => $e,
-                        'tplRow' => $this->templateRow,
-                        'numberOfRows' => $numberOfRows
-                    ];
-                    foreach ($postOutputProcessingHook as $hookFunction) {
-                        GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
-                    }
-                }
-            }
         } else {
             $theOutput = $this->pObj->noTemplate(1);
         }
index 411cfee..95b2378 100644 (file)
@@ -44,11 +44,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
     /**
      * @var string
      */
-    public $e;
-
-    /**
-     * @var string
-     */
     public $sObj;
 
     /**
@@ -134,7 +129,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
     {
         parent::init();
         $this->id = (int)GeneralUtility::_GP('id');
-        $this->e = GeneralUtility::_GP('e');
         $this->sObj = GeneralUtility::_GP('sObj');
         $this->edit = GeneralUtility::_GP('edit');
         $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1);
@@ -298,8 +292,6 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
 
     /**
      * Create the panel of buttons for submitting the form or otherwise perform operations.
-     *
-     * @return array All available buttons as an assoc. array
      */
     protected function getButtons()
     {
@@ -318,6 +310,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
                 ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.showPage'))
                 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL));
             $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 99);
+
             if ($this->extClassConf['name'] === TypoScriptTemplateInformationModuleFunctionController::class) {
                 // NEW button
                 $urlParameters = [
@@ -326,52 +319,14 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
                     'createExtension' => 'new'
                 ];
 
-                if (!empty($this->e) && !GeneralUtility::_POST('_saveandclosedok')) {
-                    $saveButton = $buttonBar->makeInputButton()
-                        ->setName('_savedok')
-                        ->setValue('1')
-                        ->setForm('TypoScriptTemplateModuleController')
-                        ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
-                            'actions-document-save',
-                            Icon::SIZE_SMALL
-                        ))
-                        ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.saveDoc'));
-
-                    $saveAndCloseButton = $buttonBar->makeInputButton()
-                        ->setName('_saveandclosedok')
-                        ->setValue('1')
-                        ->setForm('TypoScriptTemplateModuleController')
-                        ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.saveCloseDoc'))
-                        ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
-                            'actions-document-save-close',
-                            Icon::SIZE_SMALL
-                        ));
-
-                    $splitButtonElement = $buttonBar->makeSplitButton()
-                        ->addItem($saveButton)
-                        ->addItem($saveAndCloseButton);
-
-                    $buttonBar->addButton($splitButtonElement, ButtonBar::BUTTON_POSITION_LEFT, 3);
-
-                    // CLOSE button
-                    $closeButton = $buttonBar->makeLinkButton()
-                        ->setHref(BackendUtility::getModuleUrl('web_ts', ['id' => $this->id]))
-                        ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.closeDoc'))
-                        ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
-                            'actions-close',
-                            Icon::SIZE_SMALL
-                        ));
-                    $buttonBar->addButton($closeButton);
-                } else {
-                    $newButton = $buttonBar->makeLinkButton()
-                        ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
-                        ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:db_new.php.pagetitle'))
-                        ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
-                            'actions-document-new',
-                            Icon::SIZE_SMALL
-                        ));
-                    $buttonBar->addButton($newButton);
-                }
+                $newButton = $buttonBar->makeLinkButton()
+                    ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
+                    ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:db_new.php.pagetitle'))
+                    ->setIcon($this->moduleTemplate->getIconFactory()->getIcon(
+                        'actions-document-new',
+                        Icon::SIZE_SMALL
+                    ));
+                $buttonBar->addButton($newButton);
             } elseif ($this->extClassConf['name'] === TypoScriptTemplateConstantEditorModuleFunctionController::class
                 && !empty($this->MOD_MENU['constant_editor_cat'])) {
                 // SAVE button
index bacb0a4..12de019 100644 (file)
@@ -72,9 +72,6 @@
                        <trans-unit id="editTemplateRecord">
                                <source>Edit the whole template record</source>
                        </trans-unit>
-                       <trans-unit id="includeTypoScriptFileContent">
-                               <source>Include TypoScript file content</source>
-                       </trans-unit>
                </body>
        </file>
 </xliff>
index 9dd17fc..a42d276 100644 (file)
         </div>
     </f:if>
     <f:format.raw>{formResult}</f:format.raw>
-    <f:if condition="{showConstantsEditor}">
-        <h3><f:translate key="{LLPrefix}constants"/></h3>
-        <textarea name="data[constants]" rows="{numberOfRows}" wrap="off" class="text-monospace enable-tab" style="width:98%;height:70%" class="text-monospace">{constants}</textarea>
-        <input type="hidden" name="e[constants]" value="1">
-        <div class="checkbox">
-            <label for="checkIncludeTypoScriptFileContent">
-                <f:format.raw>{constantsLabel}</f:format.raw>
-                <f:translate key="{LLPrefix}includeTypoScriptFileContent"/>
-            </label>
-        </div>
-    </f:if>
-    <f:if condition="{showConfigEditor}">
-        <h3><f:translate key="{LLPrefix}setup"/></h3>
-        <textarea name="data[config]" rows="{numberOfRows}" wrap="off" class="text-monospace enable-tab" style="width:98%;height:70%" class="text-monospace">{config}</textarea>
-        <input type="hidden" name="e[config]" value="1">
-        <div class="checkbox">
-            <label for="checkIncludeTypoScriptFileContent">
-                <f:format.raw>{configLabel}</f:format.raw>
-                <f:translate key="{LLPrefix}includeTypoScriptFileContent"/>
-            </label>
-        </div>
-    </f:if>
-    <br />
     <div class="table-fit">
         <table class="table table-striped table-hover">
             <f:for each="{tableRows}" as="line">