From 17dc1eb84746e8433be6cb709bbe325e1ba76afe Mon Sep 17 00:00:00 2001 From: Benni Mack Date: Sun, 21 Jun 2009 14:50:18 +0000 Subject: [PATCH] Fixed #11356: Backend Login News is not templateable git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5605 709f56b5-9817-0410-a4d7-c38de5d9e867 --- ChangeLog | 4 ++++ typo3/index.php | 44 +++++++++++++++++++------------------- typo3/templates/login.html | 10 +++++++++ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9ab41588c9f..a0339e30a553 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-21 Benjamin Mack + + * Fixed #11356: Backend Login News is not templateable + 2009-06-21 Rupert Germann * Fixed bug #11358: typoLink() perfomance improvement (thanks to Vladimir Podkovanov) diff --git a/typo3/index.php b/typo3/index.php index 923cf09a4ce1..87872f73e930 100644 --- a/typo3/index.php +++ b/typo3/index.php @@ -533,38 +533,38 @@ class SC_index { } /** - * Make login news - renders the HTML content for a list of news shown under the login form. News data is added through $TYPO3_CONF_VARS + * Make login news - renders the HTML content for a list of news shown under + * the login form. News data is added through $TYPO3_CONF_VARS * * @return string HTML content * @credits Idea by Jan-Hendrik Heuing */ - function makeLoginNews() { - - // Reset output variable: - $newsContent= ''; + function makeLoginNews() { + $newsContent = ''; // 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'])) { - foreach($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem) { - $newsContent .= '
'.htmlspecialchars($newsItem['header']).' '.htmlspecialchars($newsItem['date']).'
'; - $newsContent .= '
'.trim($newsItem['content']).'
'; + if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']) && count($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'])) { + + // 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 = ''; + foreach ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] as $newsItem) { + $newsItemMarker = array( + '###HEADER###' => htmlspecialchars($newsItem['header']), + '###DATE###' => htmlspecialchars($newsItem['date']), + '###CONTENT###' => trim($newsItem['content']) + ); + $newsItemContent .= t3lib_parsehtml::substituteMarkerArray($newsItemTemplate, $newsItemMarker); } - $title = ($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle'] ? htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNewsTitle']) : $GLOBALS['LANG']->getLL('newsheadline', true)); - // Wrap - $newsContent = ' - - -

'.$title.'

-
- '.$newsContent.' -
- '; + $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); } - // Return content: return $newsContent; } diff --git a/typo3/templates/login.html b/typo3/templates/login.html index 13f4fd5fab7a..bab7adb5bafb 100644 --- a/typo3/templates/login.html +++ b/typo3/templates/login.html @@ -82,3 +82,13 @@ + + +

###NEWS_HEADLINE###

+
+ +
###HEADER### ###DATE###
+
###CONTENT###
+ +
+ \ No newline at end of file -- 2.20.1