PHP-Code:
<?php
//Anzeige im Backend
$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace("alias,author","alias,newsSecondAuthor,author;{newsLinks_legend:hide},newsFacebook,newsTwitter,newsDonation;{newsContact_legend:hide},newsMail,newsPhone,newsContactPerson,", $GLOBALS['TL_DCA']['tl_news']['palettes']['default']);
array_insert($GLOBALS['TL_DCA']['tl_news'], 1, array
(
// Config
'config' => array
(
'onload_callback' => array(
array('pressClass', 'pressemethode')
)
)
));
class pressClass extends Backend
{
public function pressemethode(Datacontainer $dc)
{
// Prüfen ob pid (ID des Archivs) gleich 1 (Archiv "Aktulles" hat die ID 1)
$objNews = \NewsModel::findById(\Input::get(id));
if ($objNews->pid != '5') {
$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace
(
"author",
"author;{newsMedium_legend:hide},newsMedium,newsLanguage,newsPlace;",
$GLOBALS['TL_DCA']['tl_news']['palettes']['default']
);
}
}
}
//Beschreibung des Feldes
$GLOBALS['TL_DCA']['tl_news']['fields']['newsSecondAuthor'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsSecondAuthor'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'clr w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsMedium'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsMedium'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsLanguage'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsLanguage'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsPlace'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsPlace'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsFacebook'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsFacebook'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsTwitter'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsTwitter'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsDonation'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsDonation'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsMail'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsMail'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsPhone'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsPhone'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_news']['fields']['newsContactPerson'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsContactPerson'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
Lesezeichen