get('contao.security.token_checker')->hasBackendUser())
{
$News = NewsModel::findByPk($dc->id);
$User = BackendUser::getInstance();
list($admin_name,$admin_email) = StringUtil::splitFriendlyEmail(Config::get('adminEmail'));
if ($News !== null && ($Archive = $News->getRelated('pid')) !== null && ($Notification = Notification::findByPk($Archive->nc_notification)) !== null)
{
$strText = '';
$objContentElement = ContentModel::findPublishedByPidAndTable($News->id, 'tl_news');
if ($objContentElement !== null)
{
while ($objContentElement->next())
{
$strText .= Controller::getContentElement($objContentElement->current());
}
}
$arrRow = array(
'date' => date('d.m.Y',$News->date),
'headline' => $News->headline,
'teaser' => $News->teaser ? StringUtil::substr(strip_tags(str_ireplace(array('
','
','
','
'),' ',$News->teaser)),128) : '',
'text_plain' => $strText ? strip_tags(str_ireplace(array('
','
','
','
'),' ',$strText)) : ($News->teaser ? strip_tags(str_ireplace(array('
','
','
','
'),' ',$News->teaser)) : ''), 'text_html' => $strText ?: $News->teaser ); if (($objJumpTo = $Archive->getRelated('jumpTo')) !== null) { // $arrRow['url'] = $objJumpTo->getAbsoluteUrl(sprintf((Config::get('useAutoItem') ? '/%s' : '/items/%s'),$News->alias)).'?ltoken=%%_TOKEN_%%'; $arrRow['url'] = $objJumpTo->getAbsoluteUrl(sprintf((Config::get('useAutoItem') ? '/%s' : '/items/%s'),$News->alias)); } $arrNewsPlain[] = date('d.m.Y',$News->date).' - '.$News->headline; $arrNewsHtml[] = '
'.$arrRow['teaser'].'
'. ($arrRow['url'] ? '' : '') .'