[TYPO3-dev] TCA condition for input type

Florian Schwaiger fschwaiger at gmail.com
Tue Apr 22 18:21:37 CEST 2014


Thank you so much, this is what did the trick:

ext_localconf.php
--------------------
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'][$_EXTKEY] =
    'EXT:' . $_EXTKEY . '/Classes/Hooks/Tceforms.php:Tx_Calendar_Hooks_Tceforms';


Classes/Hooks/Tceforms.php
--------------------
class Tx_Calendar_Hooks_Tceforms
{

    public function getSingleField_beforeRender($table, $field, &$row, &$PA)
    {
        if ($table === 'tx_calendar_domain_model_event' && ($field == 'event_start' || $field == 'event_end')) {
            if ($row['full_day']) {
                $PA['fieldConf']['config']['eval'] = 'date,required';
            } else {
                $PA['fieldConf']['config']['eval'] = 'datetime,required';
            }
        }
    }
}



More information about the TYPO3-dev mailing list