Что я могу сделать? сделал до сих пор:
- Я создал расширение my_seminar с предварительным условием нового поля.
Поле отображается в серверной части. - Я расширил модель событий семинаров в файле my_seminar/Classes/Domain/Model/Event.php:
< /li>
Код: Выделить всё
namespace MyVendor\MySeminar\Domain\Model;
class Event extends \OliverKlee\Seminars\Model\Event
{
/**
* precondition
*
* @var string
*/
protected $precondition = '';
/**
* Returns the precondition
*
* @return string $precondition
*/
public function getPrecondition()
{
return $this->precondition;
}
/**
* Sets the precondition
*
* @param string $precondition
* @return void
*/
public function setPrecondition($precondition)
{
$this->precondition = $precondition;
}
}
- Я создал перехватчик EventSingleView в файле my_seminar/Classes/Hooks/EventSingleView.php:
< /ол>Код: Выделить всё
namespace MyVendor\MySeminar\Hooks; use \OliverKlee\Seminars\Hooks\Interfaces\SeminarSingleView; class EventSingleView implements SeminarSingleView { public function modifySingleView(\OliverKlee\Seminars\FrontEnd\DefaultController $controller): void { // deprecated // $data = $controller->pi_getRecord('tx_seminars_seminars', $controller->piVars['showUid']); $precondition = $controller->getPrecondition(); $controller->setMarker('PRECONDITION', $precondition); } - Я зарегистрировал оба класса в файле ext_localconf.php:
Код: Выделить всё
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars'][\OliverKlee\Seminars\Hooks\Interfaces\SeminarSingleView::class][] = \MyVendor\MySeminar\Hooks\EventSingleView::class; $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\OliverKlee\Seminars\Model\Event::class] = \MyVendor\MySeminar\Domain\Model\Event::class; Подробнее здесь: https://stackoverflow.com/questions/790 ... n-seminars