Added feature #8349: htmlArea RTE: Clean paste feature with three options
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / ext_tables.php
index 05c16ec..62d870b 100644 (file)
@@ -1,96 +1,52 @@
 <?php
 if (!defined ('TYPO3_MODE'))   die ('Access denied.');
 
-if (TYPO3_MODE == 'BE' && t3lib_extMgm::isLoaded('lorem_ipsum'))       {
-
-               // Create wizard configuration:
-       $wizConfig = array(
-               'type' => 'userFunc',
-               'userFunc' => 'EXT:' . $_EXTKEY . '/class.tx_rtehtmlarea_loremipsum_wiz.php:tx_rtehtmlarea_loremipsum_wiz->main',
-               'params' => array()
-       );
-
-               // Load affected tables (except "pages"):
-       t3lib_div::loadTCA('tt_content');
-
-               // *********************
-               // Apply wizards to:
-               // *********************
-
-               // Titles:
-       $TCA['pages']['columns']['title']['config']['wizards']['tx_loremipsum'] =
-       $TCA['pages']['columns']['nav_title']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'title'
-               )));
-
-               // Subheaders
-       $TCA['pages']['columns']['subtitle']['config']['wizards']['tx_loremipsum'] =
-       $TCA['tt_content']['columns']['header']['config']['wizards']['tx_loremipsum'] =
-       $TCA['tt_content']['columns']['subheader']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'header'
-               )));
-
-               // Description / Abstract:
-       $TCA['pages']['columns']['description']['config']['wizards']['tx_loremipsum'] =
-       $TCA['pages']['columns']['abstract']['config']['wizards']['tx_loremipsum'] =
-       $TCA['tt_content']['columns']['imagecaption']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'description',
-                       'endSequence' => '46,32',
-                       'add' => TRUE
-               )));
-
-               // Keywords field:
-       $TCA['pages']['columns']['keywords']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'word',
-                       'endSequence' => '44,32',
-                       'add' => TRUE,
-                       'count' => 30
-               )));
-
-               // Bodytext field in Content Elements:
-       $TCA['tt_content']['columns']['bodytext']['config']['wizards']['_VERTICAL'] = 1;
-       $TCA['tt_content']['columns']['bodytext']['config']['wizards']['tx_loremipsum_2'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'loremipsum',
-                       'endSequence' => '32',
-                       'add'=>TRUE
-               )));
-       $TCA['tt_content']['columns']['bodytext']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'paragraph',
-                       'endSequence' => '10',
-                       'add'=>TRUE
-               )));
-
-       $TCA['tt_content']['columns']['image']['config']['wizards']['_POSITION'] = 'bottom';
-       $TCA['tt_content']['columns']['image']['config']['wizards']['tx_loremipsum'] =
-               array_merge($wizConfig,array('params'=>array(
-                       'type' => 'images'
-               )));
-}
+               // Add static template for Click-enlarge rendering
+       t3lib_extMgm::addStaticFile($_EXTKEY,'static/clickenlarge/','Clickenlarge Rendering');
 
+               // Add acronyms table
        $TCA['tx_rtehtmlarea_acronym'] = Array (
-       'ctrl' => Array (
-               'title' => 'LLL:EXT:rtehtmlarea/locallang_db.php:tx_rtehtmlarea_acronym',
-               'label' => 'term',
-               'default_sortby' => 'ORDER BY term',
-               'sortby' => 'sorting',
-               'rootLevel' => 1,
-               'delete' => 'deleted',
-               'enablecolumns' => Array (
-                       'disabled' => 'hidden',
-                       'starttime' => 'starttime',
-                       'endtime' => 'endtime',
+               'ctrl' => Array (
+                       'title' => 'LLL:EXT:rtehtmlarea/locallang_db.xml:tx_rtehtmlarea_acronym',
+                       'label' => 'term',
+                       'default_sortby' => 'ORDER BY term',
+                       'sortby' => 'sorting',
+                       'delete' => 'deleted',
+                       'enablecolumns' => Array (
+                               'disabled' => 'hidden',
+                               'starttime' => 'starttime',
+                               'endtime' => 'endtime',
+                       ),
+                       'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
+                       'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'extensions/Acronym/skin/images/acronym.gif',
                ),
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tca.php',
-               'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY).'htmlarea/skins/default/images/Acronym/ed_acronym.gif',
-               )
        );
-        
        t3lib_extMgm::allowTableOnStandardPages('tx_rtehtmlarea_acronym');
-       t3lib_extMgm::addToInsertRecords('tx_rtehtmlarea_acronym');
-?>
+
+               // Add contextual help files
+       foreach ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'] as $pluginName => $config) {
+               if ($config['contextHelpFile']) {
+                       t3lib_extMgm::addLLrefForTCAdescr('xEXT_' . $_EXTKEY . '_' . $pluginName, $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'][$pluginName]['contextHelpFile']);
+               }
+       }
+
+               // Extend TYPO3 User Settings Configuration
+if (TYPO3_MODE === 'BE' && t3lib_extMgm::isLoaded('setup') && is_array($GLOBALS['TYPO3_USER_SETTINGS'])) {
+       $GLOBALS['TYPO3_USER_SETTINGS']['columns'] = array_merge(
+               $GLOBALS['TYPO3_USER_SETTINGS']['columns'],
+               array(
+                       'rteCleanPasteBehaviour' => array(
+                               'type' => 'select',
+                               'label' => 'LLL:EXT:rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml:rteCleanPasteBehaviour',
+                               'items' => array(
+                                       'plainText' => 'LLL:EXT:rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml:plainText',
+                                       'pasteStructure' => 'LLL:EXT:rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml:pasteStructure',
+                                       'pasteFormat' => 'LLL:EXT:rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml:pasteFormat',
+                               ),
+                               'csh' => 'xEXT_rtehtmlarea_PlainText:behaviour',
+                       ),
+               )
+       );
+       $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] .= ',--div--;LLL:EXT:rtehtmlarea/locallang.xml:rteSettings,rteResize,rteMaxHeight,rteCleanPasteBehaviour';
+}
+?>
\ No newline at end of file