Index: typo3/sysext/cms/ext_tables.php
===================================================================
--- typo3/sysext/cms/ext_tables.php (revision 8888)
+++ typo3/sysext/cms/ext_tables.php (working copy)
@@ -784,6 +784,34 @@
);
// ******************************************************************
+// sys_news
+// ******************************************************************
+$TCA['sys_news'] = array(
+ 'ctrl' => array(
+ 'title' => 'LLL:EXT:cms/locallang_tca.xml:sys_news',
+ 'label' => 'title',
+ 'tstamp' => 'tstamp',
+ 'crdate' => 'crdate',
+ 'cruser_id' => 'cruser_id',
+ 'adminOnly' => TRUE,
+ 'rootLevel' => '1',
+ 'delete' => 'deleted',
+ 'enablecolumns' => array(
+ 'disabled' => 'hidden',
+ 'starttime' => 'starttime',
+ 'endtime' => 'endtime'
+ ),
+ 'default_sortby' => 'crdate DESC',
+ 'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'x-sys_news.png',
+ 'typeicon_classes' => array(
+ 'default' => 'mimetypes-x-sys_news',
+ ),
+ 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tbl_cms.php',
+ 'dividers2tabs' => TRUE
+ )
+);
+
+// ******************************************************************
// pages_language_overlay
// ******************************************************************
$TCA['pages_language_overlay'] = array (
Index: typo3/sysext/cms/ext_tables.sql
===================================================================
--- typo3/sysext/cms/ext_tables.sql (revision 8888)
+++ typo3/sysext/cms/ext_tables.sql (working copy)
@@ -302,6 +302,26 @@
);
+#
+# Table structure for table 'sys_news'
+#
+CREATE TABLE sys_news (
+ uid int(11) unsigned NOT NULL auto_increment,
+ pid int(11) unsigned DEFAULT '0' NOT NULL,
+ tstamp int(11) unsigned DEFAULT '0' NOT NULL,
+ crdate int(11) unsigned DEFAULT '0' NOT NULL,
+ cruser_id int(11) unsigned DEFAULT '0' NOT NULL,
+ deleted tinyint(3) unsigned DEFAULT '0' NOT NULL,
+ hidden tinyint(4) unsigned DEFAULT '0' NOT NULL,
+ starttime int(11) unsigned DEFAULT '0' NOT NULL,
+ endtime int(11) unsigned DEFAULT '0' NOT NULL,
+ title varchar(255) DEFAULT '' NOT NULL,
+ content mediumtext,
+
+ PRIMARY KEY (uid),
+ KEY parent (pid)
+);
+
#
# Table structure for table 'sys_template'
Index: typo3/sysext/cms/tbl_cms.php
===================================================================
--- typo3/sysext/cms/tbl_cms.php (revision 8888)
+++ typo3/sysext/cms/tbl_cms.php (working copy)
@@ -508,6 +508,77 @@
// ******************************************************************
+// sys_news
+// ******************************************************************
+$TCA['sys_news'] = array(
+ 'ctrl' => $TCA['sys_news']['ctrl'],
+ 'interface' => array(
+ 'showRecordFieldList' => 'hidden,title,content,starttime,endtime'
+ ),
+ 'columns' => array(
+ 'hidden' => array(
+ 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.disable',
+ 'exclude' => 1,
+ 'config' => array(
+ 'type' => 'check',
+ 'default' => '0'
+ )
+ ),
+ 'starttime' => array(
+ 'exclude' => 1,
+ 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.starttime',
+ 'config' => array(
+ 'type' => 'input',
+ 'size' => '8',
+ 'max' => '20',
+ 'eval' => 'date',
+ 'checkbox' => '0',
+ 'default' => '0'
+ )
+ ),
+ 'endtime' => array(
+ 'exclude' => 1,
+ 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.endtime',
+ 'config' => array(
+ 'type' => 'input',
+ 'size' => '8',
+ 'max' => '20',
+ 'eval' => 'date',
+ 'checkbox' => '0',
+ 'default' => '0'
+ )
+ ),
+ 'title' => array(
+ 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.title',
+ 'config' => array(
+ 'type' => 'input',
+ 'size' => '30',
+ 'max' => '255',
+ 'eval' => 'required'
+ )
+ ),
+ 'content' => array(
+ 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.text',
+ 'config' => array(
+ 'type' => 'text',
+ 'cols' => '48',
+ 'rows' => '5'
+ )
+ )
+ ),
+ 'types' => array(
+ '1' => array('showitem' => '
+ hidden, title, content,
+ --div--;LLL:EXT:cms/locallang_tca.xml:sys_news.tabs.access, starttime, endtime'
+ )
+ )
+);
+
+
+
+
+
+// ******************************************************************
// pages_language_overlay
// ******************************************************************
$TCA['pages_language_overlay'] = array(
Index: typo3/sysext/cms/locallang_tca.xml
===================================================================
--- typo3/sysext/cms/locallang_tca.xml (revision 8888)
+++ typo3/sysext/cms/locallang_tca.xml (working copy)
@@ -105,6 +105,8 @@
+
+
Index: typo3/index.php
===================================================================
--- typo3/index.php (revision 8888)
+++ typo3/index.php (working copy)
@@ -560,6 +560,16 @@
function makeLoginNews() {
$newsContent = '';
+ $systemNews = $this->getSystemNews();
+ if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'])) {
+ $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] = array_merge(
+ $systemNews,
+ $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews']
+ );
+ } else {
+ $GLOBALS['TYPO3_CONF_VARS']['BE']['loginNews'] = $systemNews;
+ }
+
// 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')) {
@@ -597,6 +607,40 @@
}
/**
+ * Gets news from sys_news and converts them into a format suitable for
+ * showing them at the login screen.
+ *
+ * @return array An array of login news.
+ */
+ protected function getSystemNews() {
+ $systemNewsTable = 'sys_news';
+ $systemNews = array();
+
+ $systemNewsRecords = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+ 'title, content, crdate',
+ $systemNewsTable,
+ 'deleted = 0' . t3lib_BEfunc::BEenableFields($systemNewsTable),
+ '',
+ 'crdate DESC'
+ );
+
+ foreach ($systemNewsRecords as $systemNewsRecord) {
+ $content = nl2br(strip_tags($systemNewsRecord['content']));
+
+ $systemNews[] = array(
+ 'date' => date(
+ $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'],
+ $systemNewsRecord['crdate']
+ ),
+ 'header' => strip_tags($systemNewsRecord['title']),
+ 'content' => $content
+ );
+ }
+
+ return $systemNews;
+ }
+
+ /**
* Returns the form tag
*
* @return string Opening form tag string