Project

General

Profile

Feature #23740 ยป login_news_with_rte.diff

Administrator Admin, 2010-10-15 17:33

View differences:

t3lib/stddb/tbl_be.php (Arbeitskopie)
'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'
)
)
typo3/index.php (Arbeitskopie)
// 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;
    (1-1/1)