[BUGFIX] Wizard in HTML element moved to t3editor
authorGeorg Ringer <mail@ringerge.org>
Thu, 9 Feb 2012 13:32:08 +0000 (14:32 +0100)
committerGeorg Ringer <mail@ringerge.org>
Fri, 10 Feb 2012 12:03:24 +0000 (13:03 +0100)
If HTML element is used and t3editor is not
installed, an error is thrown.

Solution is to move the wizard code to t3editor
itself.

Change-Id: I967aac22a14bf0fc39e9c424398ac46ac913ce1f
Fixes: #33813
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/8929
Reviewed-by: Francois Suter
Tested-by: Francois Suter
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/t3editor/ext_tables.php

index a3d0f96..b858457 100755 (executable)
@@ -470,7 +470,6 @@ $TCA['tt_content'] = array(
                                                'notNewRecords' => 1,
                                                'enableByTypeConfig' => 1,
                                                'type' => 'script',
-#                                              'hideParent' => array('rows' => 4),
                                                'title' => 'LLL:EXT:cms/locallang_ttc.xml:bodytext.W.forms',
                                                'icon' => 'wizard_forms.gif',
                                                'script' => 'wizard_forms.php?special=formtype_mail',
@@ -478,17 +477,6 @@ $TCA['tt_content'] = array(
                                                        'xmlOutput' => 0,
                                                ),
                                        ),
-                                       't3editor' => array(
-                                               'enableByTypeConfig' => 1,
-                                               'type' => 'userFunc',
-                                               'userFunc' => 'EXT:t3editor/classes/class.tx_t3editor_tceforms_wizard.php:tx_t3editor_tceforms_wizard->main',
-                                               'title' => 't3editor',
-                                               'icon' => 'wizard_table.gif',
-                                               'script' => 'wizard_table.php',
-                                               'params' => array(
-                                                       'format' => 'html',
-                                               ),
-                                       ),
                                ),
                                'softref' => 'typolink_tag,images,email[subst],url',
                                'search' => array(
@@ -1982,7 +1970,7 @@ $TCA['tt_content'] = array(
                        'showitem' =>
                                        '--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.general;general,
                                        header;LLL:EXT:cms/locallang_ttc.xml:header.ALT.html_formlabel,
-                                       bodytext;LLL:EXT:cms/locallang_ttc.xml:bodytext.ALT.html_formlabel;;nowrap:wizards[t3editor],
+                                       bodytext,
                                --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.appearance,
                                        --palette--;LLL:EXT:cms/locallang_ttc.xml:palette.frames;frames,
                                --div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,
index 90c0151..266bbd3 100644 (file)
@@ -3,12 +3,27 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 
-if (TYPO3_MODE == 'BE') {
-       // Register AJAX handlers:
+if (TYPO3_MODE === 'BE') {
+               // Register AJAX handlers:
        $TYPO3_CONF_VARS['BE']['AJAX']['tx_t3editor::saveCode'] = 'EXT:t3editor/classes/class.tx_t3editor.php:tx_t3editor->ajaxSaveCode';
        $TYPO3_CONF_VARS['BE']['AJAX']['tx_t3editor::getPlugins'] = 'EXT:t3editor/classes/class.tx_t3editor.php:tx_t3editor->getPlugins';
        $TYPO3_CONF_VARS['BE']['AJAX']['tx_t3editor_TSrefLoader::getTypes'] = 'EXT:t3editor/classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php:tx_t3editor_TSrefLoader->processAjaxRequest';
        $TYPO3_CONF_VARS['BE']['AJAX']['tx_t3editor_TSrefLoader::getDescription'] = 'EXT:t3editor/classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php:tx_t3editor_TSrefLoader->processAjaxRequest';
        $TYPO3_CONF_VARS['BE']['AJAX']['tx_t3editor_codecompletion::loadTemplates'] = 'EXT:t3editor/classes/ts_codecompletion/class.tx_t3editor_codecompletion.php:tx_t3editor_codecompletion->processAjaxRequest';
+
+               // Add the t3editor wizard on the bodytext field of tt_content
+       $TCA['tt_content']['columns']['bodytext']['config']['wizards']['t3editor'] = array(
+               'enableByTypeConfig' => 1,
+               'type' => 'userFunc',
+               'userFunc' => 'EXT:t3editor/classes/class.tx_t3editor_tceforms_wizard.php:tx_t3editor_tceforms_wizard->main',
+               'title' => 't3editor',
+               'icon' => 'wizard_table.gif',
+               'script' => 'wizard_table.php',
+               'params' => array(
+                       'format' => 'html',
+               ),
+       );
+               // Activate the t3editor only for type html
+       $TCA['tt_content']['types']['html']['showitem'] = str_replace('bodytext,', 'bodytext;LLL:EXT:cms/locallang_ttc.xml:bodytext.ALT.html_formlabel;;nowrap:wizards[t3editor],', $TCA['tt_content']['types']['html']['showitem']);
 }
 ?>
\ No newline at end of file