/** * @return string */ public function generate() { if (TL_MODE === 'BE') { $template = new \BackendTemplate('be_wildcard'); $template->wildcard = '### ANTRAGO Event-Details ###'; $template->title = 'Event Details'; //"Kategorien: " . implode(', ',deserialize($this->arrData['ac_categories'])); return $template->parse(); } // hole event details; $url = $_SERVER["REQUEST_URI"]; $id = explode("veranstaltung=", $url)[1]; $this->configuration = AntragoConnector::getAntragoConfiguration($this->arrData['ac_event_details_config']); $db = \Database::getInstance(); $this->product = $db->prepare("SELECT * FROM tl_antrago_products WHERE productId=?")->execute($id)->fetchAssoc(); $this->formConfig = array('showRegisterForm' => $this->arrData['ac_event_details_show_register'], 'showApplicationForm' => $this->arrData['ac_event_details_show_applicationform']); // contact $this->contact = $db->prepare("SELECT * FROM tl_antrago_contacts WHERE id =?")->execute($this->product['productContact'])->fetchAssoc(); $oContactImage = \FilesModel::findByPk($this->contact['image']); // Add cover image if ($oContactImage !== null) { $sImage = \Image::get($oContactImage->path, '80', '100', 'center_center'); } $this->contact['image'] = $sImage; return parent::generate(); }
/** * @return string */ public function generate() { $this->configuration = AntragoConnector::getAntragoConfiguration($this->arrData['ac_configuration']); $this->categoryIds = deserialize($this->arrData['ac_categories']); $antragoCategories = json_decode(AntragoConnector::getContentFromApi($this->configuration['api_host'] . "/categories", $this->configuration['api_user'], $this->configuration['api_password']), true); foreach ($antragoCategories as $val) { $this->antragoCategories[$val['id']] = $val; } // wildcard backend if (TL_MODE === 'BE') { $template = new \BackendTemplate('be_wildcard'); $template->wildcard = '### ANTRAGO EVENT-LISTE ###'; $template->title = "Kategorien: " . implode(', ', deserialize($this->arrData['ac_categories'])); return $template->parse(); } // EventList Frontend // Data der vorhandenen Kategorien holen $arrCategoryData = array(); // hole Kategorien foreach ($this->categoryIds as $key => $catId) { $arrCategoryData[$key] = array("categoryName" => $this->antragoCategories[$catId]['name'], "categoryId" => $this->antragoCategories[$catId]['id'], "eventData" => $this->getAntragoEventsById($catId)); } $this->eventData = $arrCategoryData; return parent::generate(); }
/** * @param $connectionId */ public function setConnection($connectionId) { $this->connection = AntragoConnector::getAntragoConfiguration($connectionId); }