public function getArticleOptions(CreateOptionsEvent $event) { \Controller::loadLanguageFile('tl_article'); $database = \Database::getInstance(); $dataContainer = $event->getDataContainer(); $options = $event->getOptions(); // add articles in this page to options array $resultSet = $database->prepare('SELECT a.id, a.title, a.inColumn FROM tl_article a INNER JOIN tl_article b ON a.pid = b.pid INNER JOIN tl_content c ON c.pid = b.id WHERE c.id = ? ORDER BY a.inColumn, a.sorting')->execute($dataContainer->id); while ($resultSet->next()) { if (isset($GLOBALS['TL_LANG']['tl_article'][$resultSet->inColumn])) { $sectionName = $GLOBALS['TL_LANG']['tl_article'][$resultSet->inColumn]; } else { $sectionName = $resultSet->inColumn; } if (isset($GLOBALS['TL_LANG']['tl_article'][$sectionName])) { $sectionName = $GLOBALS['TL_LANG']['tl_article'][$sectionName]; } $options[$sectionName][$resultSet->id] = $resultSet->title; } }
public function createGalleryTemplateOptions(CreateOptionsEvent $event) { $this->getGalleryTemplateOptions($event->getDataContainer(), $event->getOptions()); }
/** * @param CreateOptionsEvent $event */ public function createRecipientFieldOptions(CreateOptionsEvent $event) { $this->getRecipientFieldOptions($event->getDataContainer(), $event->getOptions()); }
/** * @param CreateOptionsEvent $event */ public function createRecipientPropertiesOptions(CreateOptionsEvent $event) { $options = $event->getOptions(); #$baseSubscriber = new \Avisota\Contao\SubscriptionRecipient\EventsSubscriber(); $baseSubscriber = new EventsSubscriber(); $options = $baseSubscriber->getRecipientPropertiesOptions($event->getDataContainer()->getEnvironment(), $options); $event->setOptions($options); }