Added feature #16004: Add RTE to login news to give users the possibility to format...
authorSusanne Moog <typo3@susannemoog.de>
Fri, 15 Oct 2010 16:44:34 +0000 (16:44 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Fri, 15 Oct 2010 16:44:34 +0000 (16:44 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9073 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/stddb/tbl_be.php
typo3/index.php

index f39059a..71b0a1c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
 2010-10-15  Susanne Moog  <typo3@susanne-moog.de>
 
        * Fixed bug #8980: unlink of non existant lockfiles generates warnings in frontend (Thanks to André Stösel)
+       * Added feature #16004:  Add RTE to login news to give users the possibility to format the news and to add links etc.
 
 2010-10-14  Jeff Segars  <jeff@webempoweredchurch.org>
 
index 37b53f7..7a985a2 100644 (file)
@@ -878,13 +878,25 @@ $TCA['sys_news'] = array(
                        'config' => array(
                                'type' => 'text',
                                'cols' => '48',
-                               'rows' => '5'
-                       )
-               )
+                               'rows' => '5',
+                               'wizards' => array(
+                                       '_PADDING' => 4,
+                                       '_VALIGN' => 'middle',
+                                       'RTE' => array(
+                                               'notNewRecords' => 1,
+                                               'RTEonly' => 1,
+                                               'type' => 'script',
+                                               'title' => 'LLL:EXT:cms/locallang_ttc.php:bodytext.W.RTE',
+                                               'icon' => 'wizard_rte2.gif',
+                                               'script' => 'wizard_rte.php'
+                                       ),
+                               ),
+                       ),
+               ),
        ),
        'types' => array(
                '1' => array('showitem' => '
-                       hidden, title, content,
+                       hidden, title, content;;9;richtext:rte_transform[flag=rte_enabled|mode=ts_css];3-3-3,
                        --div--;LLL:EXT:lang/locallang_tca.xml:sys_news.tabs.access, starttime, endtime'
                )
        )
index f17f471..501bc6c 100644 (file)
@@ -575,35 +575,37 @@ class SC_index {
 
                        // Traverse news array IF there are records in it:
                if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && !t3lib_div::_GP('loginRefresh')) {
-
+                       $htmlParser = t3lib_div::makeInstance('t3lib_parsehtml_proc');
                                // get the main news template, and replace the subpart after looped through
                        $newsContent      = t3lib_parsehtml::getSubpart($GLOBALS['TBE_TEMPLATE']->moduleTemplate, '###LOGIN_NEWS###');
                        $newsItemTemplate = t3lib_parsehtml::getSubpart($newsContent, '###NEWS_ITEM###');
 
-                       $newsItemContent = '';
+                       $newsItem = '';
                        $count = 1;
-                       foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem) {
+                       foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItemData) {
                                $additionalClass = '';
                                if ($count == 1) {
                                        $additionalClass = ' first-item';
                                } elseif($count == count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'])) {
                                        $additionalClass = ' last-item';
                                }
+
+                               $newsItemContent = $htmlParser->TS_transform_rte($htmlParser->TS_links_rte($newsItemData['content']));
                                $newsItemMarker = array(
-                                       '###HEADER###'  => htmlspecialchars($newsItem['header']),
-                                       '###DATE###'    => htmlspecialchars($newsItem['date']),
-                                       '###CONTENT###' => nl2br(htmlspecialchars(trim($newsItem['content']))),
+                                       '###HEADER###'  => htmlspecialchars($newsItemData['header']),
+                                       '###DATE###'    => htmlspecialchars($newsItemData['date']),
+                                       '###CONTENT###' => $newsItemContent,
                                        '###CLASS###'   => $additionalClass
                                );
 
                                $count++;
-                               $newsItemContent .= t3lib_parsehtml::substituteMarkerArray($newsItemTemplate, $newsItemMarker);
+                               $newsItem .= t3lib_parsehtml::substituteMarkerArray($newsItemTemplate, $newsItemMarker);
                        }
 
                        $title = ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] ? $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] : $GLOBALS['LANG']->getLL('newsheadline'));
 
                        $newsContent = t3lib_parsehtml::substituteMarker($newsContent,  '###NEWS_HEADLINE###', htmlspecialchars($title));
-                       $newsContent = t3lib_parsehtml::substituteSubpart($newsContent, '###NEWS_ITEM###', $newsItemContent);
+                       $newsContent = t3lib_parsehtml::substituteSubpart($newsContent, '###NEWS_ITEM###', $newsItem);
                }
 
                return $newsContent;