/** * Generate the module */ protected function compile() { global $objPage; $this->import('Sermoner'); $this->Template->sermons = ''; // Get the sermon item $objSermon = \SermonerItemsModel::findPublishedByParentAndIdOrAlias(\Input::get('items'), $this->serm_sermonarchive); if ($objSermon === null) { // Do not index or cache the page $objPage->noSearch = 1; $objPage->cache = 0; // Send a 404 header header('HTTP/1.1 404 Not Found'); $this->Template->sermons = '<p class="error">' . sprintf($GLOBALS['TL_LANG']['MSC']['invalidPage'], \Input::get('items')) . '</p>'; return; } //Add OG-Tags for Facebook to Head $GLOBALS['TL_HEAD'][] = '<meta property="og:title" content="' . $objSermon->title . '"/>'; $GLOBALS['TL_HEAD'][] = '<meta property="og:description" content="Eine Predigt der Kirche Lindenwiese mit ' . $objSermon->speaker . '"/>'; // Add an image if ($objSermon->addImage && $objSermon->singleSRC != '') { $objModel = \FilesModel::findByUuid($objSermon->singleSRC); if (is_file(TL_ROOT . '/' . $objModel->path)) { $GLOBALS['TL_HEAD'][] = '<meta property="og:image" content="' . \Environment::get('base') . $objModel->path . '"/>'; } } //Configuration $objConfig = new \stdClass(); $objConfig->template = $this->serm_template; $strSermon = $this->Sermoner->parseSermon($objSermon, false, '', 0, $objConfig); $this->Template->sermons = $strSermon; // Overwrite the page title (see #2853 and #4955) if ($objSermon->title != '') { $objPage->pageTitle = strip_tags(strip_insert_tags($objSermon->title)); } //Weiterleitung auf Predigtarchiv, wenn in Moduleeinstellungen gesetzt (Ausnahme: Facebook-Crawler) if ($this->skipReader) { if (\Environment::get('httpUserAgent') != "facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)") { if (($objNextPage = \PageModel::findPublishedById($this->jumpToList)) !== null) { $this->redirect($this->generateFrontendUrl($objNextPage->row()) . "#" . standardize(\String::restoreBasicEntities($objSermon->title))); } } } return; }