[TASK] Use new way to register rte wizard 51/27951/4
authorAlexander Schnitzler <typo3@alexanderschnitzler.de>
Fri, 28 Feb 2014 16:07:23 +0000 (17:07 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 28 Feb 2014 21:11:48 +0000 (22:11 +0100)
Resolves: #56437
Releases: 6.2
Change-Id: I0eea59f46c74fe50eb2554898a9f64fa2a26a9b1
Reviewed-on: https://review.typo3.org/27951
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Modules/Wizards/RteWizard/conf.php [new file with mode: 0644]
typo3/sysext/backend/Modules/Wizards/RteWizard/index.php [new file with mode: 0644]
typo3/sysext/backend/ext_tables.php
typo3/sysext/core/Configuration/TCA/sys_news.php
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/wizard_rte.php

index 5e8e14e..087b980 100644 (file)
@@ -93,7 +93,7 @@ class RteController {
                $this->popView = GeneralUtility::_GP('popView');
                $this->R_URI = GeneralUtility::linkThisScript(array('popView' => ''));
                // "Module name":
-               $this->MCONF['name'] = 'xMOD_wizard_rte.php';
+               $this->MCONF['name'] = 'wizard_rte';
                // Starting the document template object:
                $this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
                $this->doc->backPath = $GLOBALS['BACK_PATH'];
index c67d309..a587fae 100644 (file)
@@ -663,7 +663,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
                        case 'xMOD_file_edit.php':
                                $icon = 'gfx/edit_file.gif';
                                break;
-                       case 'xMOD_wizard_rte.php':
+                       case 'wizard_rte':
                                $icon = 'gfx/edit_rtewiz.gif';
                                break;
                        default:
index 8484f2a..63edde0 100644 (file)
@@ -1509,7 +1509,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                $params['pid'] = $row['pid'];
                $params['field'] = 'bodytext';
                $params['returnUrl'] = GeneralUtility::linkThisScript();
-               $RTEonClick = 'window.location.href=\'' . $this->backPath . 'wizard_rte.php?' . GeneralUtility::implodeArrayForUrl('', array('P' => $params)) . '\';return false;';
+               $RTEonClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_rte', array('P' => $params))) . ';return false;';
                $addButton = $this->option_showBigButtons && $this->doEdit ? $GLOBALS['SOBE']->doc->t3Button($RTEonClick, $GLOBALS['LANG']->getLL('editInRTE')) : '';
                return $addButton;
        }
diff --git a/typo3/sysext/backend/Modules/Wizards/RteWizard/conf.php b/typo3/sysext/backend/Modules/Wizards/RteWizard/conf.php
new file mode 100644 (file)
index 0000000..3fe4f88
--- /dev/null
@@ -0,0 +1,6 @@
+<?php
+//required for mod.php
+$MCONF['name'] = 'wizard_rte';
+$MCONF['script'] = '_DISPATCH';
+$MCONF['access'] = '';
+?>
diff --git a/typo3/sysext/backend/Modules/Wizards/RteWizard/index.php b/typo3/sysext/backend/Modules/Wizards/RteWizard/index.php
new file mode 100644 (file)
index 0000000..a6092c1
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2014 Alexander Schnitzler (typo3@alexanderschnitzler.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.
+ *  A copy is found in the text file GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  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!
+ ***************************************************************/
+
+/**
+ * Wizard to display the RTE in "full screen" mode
+ */
+\TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
+
+$rteController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\Wizard\\RteController');
+$rteController->main();
+$rteController->printContent();
index 87a427d..901d6f2 100644 (file)
@@ -33,4 +33,10 @@ if (TYPO3_MODE === 'BE') {
                'wizard_forms',
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Wizards/FormsWizard/'
        );
+
+       // Register rte wizard
+       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addModulePath(
+               'wizard_rte',
+               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Modules/Wizards/RteWizard/'
+       );
 }
\ No newline at end of file
index ea4f852..82e6c38 100644 (file)
@@ -78,7 +78,9 @@ return array(
                                                'type' => 'script',
                                                'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.RTE',
                                                'icon' => 'wizard_rte2.gif',
-                                               'script' => 'wizard_rte.php'
+                                               'module' => array(
+                                                       'name' => 'wizard_rte'
+                                               )
                                        )
                                )
                        )
index 91b713d..bb976cd 100644 (file)
@@ -475,7 +475,9 @@ return array(
                                                'type' => 'script',
                                                'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.RTE',
                                                'icon' => 'wizard_rte2.gif',
-                                               'script' => 'wizard_rte.php'
+                                               'module' => array(
+                                                       'name' => 'wizard_rte'
+                                               )
                                        ),
                                        'table' => array(
                                                'notNewRecords' => 1,
index d546fe2..93aac01 100644 (file)
@@ -449,7 +449,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                         * =======================================
                         */
                        // Check if wizard_rte called this for fullscreen edtition
-                       if (basename(PATH_thisScript) == 'wizard_rte.php') {
+                       if (GeneralUtility::_GP('M') === 'wizard_rte') {
                                $this->fullScreen = TRUE;
                                $RTEWidth = '100%';
                                $RTEHeight = '100%';
index 8102b8c..78ee14b 100644 (file)
@@ -33,6 +33,9 @@
 require __DIR__ . '/init.php';
 \TYPO3\CMS\Backend\Utility\BackendUtility::lockRecords();
 
+\TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('The way registering a wizard in TCA has chan
+ged in 6.2. Please set module[name]=wizard_rte instead of script=wizard_rte.php in your TCA. This
+script will be removed in two versions.');
 $rteController = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Controller\\Wizard\\RteController');
 $rteController->main();
 $rteController->printContent();