Project

General

Profile

Feature #23615 » 15812.diff

Administrator Admin, 2010-09-25 17:38

View differences:

typo3/sysext/cms/ext_tables.php (working copy)
);
// ******************************************************************
// 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 (
typo3/sysext/cms/ext_tables.sql (working copy)
);
#
# 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'
typo3/sysext/cms/tbl_cms.php (working copy)
// ******************************************************************
// 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(
typo3/sysext/cms/locallang_tca.xml (working copy)
<label index="sys_domain.redirectHttpStatusCode.307">Moved temporarily (307)</label>
<label index="sys_domain.prepend_params">Transfer parameters to Redirect URL:</label>
<label index="sys_domain.forced">Always prepend this domain in links:</label>
<label index="sys_news">System News</label>
<label index="sys_news.tabs.access">Access</label>
<label index="sys_template">Template</label>
<label index="sys_template.title">Template title:</label>
<label index="sys_template.root">Rootlevel:</label>
typo3/index.php (working copy)
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')) {
......
}
/**
* 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
(1-1/2)