/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### NEWS READER ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } // Return if no news item has been specified if (!$this->Input->get('items')) { global $objPage; // Do not index the page $objPage->noSearch = 1; $objPage->cache = 0; return ''; } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); // Return if there are no archives if (!is_array($this->news_archives) || count($this->news_archives) < 1) { global $objPage; // Do not index the page $objPage->noSearch = 1; $objPage->cache = 0; return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * * @return string */ public function generate() { if (TL_MODE == 'BE') { /** @var \BackendTemplate|object $objTemplate */ $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newsreader'][0]) . ' ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } // Set the item from the auto_item parameter if (!isset($_GET['items']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) { \Input::setGet('items', \Input::get('auto_item')); } // Do not index or cache the page if no news item has been specified if (!\Input::get('items')) { /** @var \PageModel $objPage */ global $objPage; $objPage->noSearch = 1; $objPage->cache = 0; return ''; } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); // Do not index or cache the page if there are no archives if (!is_array($this->news_archives) || empty($this->news_archives)) { /** @var \PageModel $objPage */ global $objPage; $objPage->noSearch = 1; $objPage->cache = 0; return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### NEWS READER ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } // Set the item from the auto_item parameter if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) { $this->Input->setGet('items', $this->Input->get('auto_item')); } // Do not index or cache the page if no news item has been specified if (!$this->Input->get('items')) { global $objPage; $objPage->noSearch = 1; $objPage->cache = 0; return ''; } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); // Do not index or cache the page if there are no archives if (!is_array($this->news_archives) || empty($this->news_archives)) { global $objPage; $objPage->noSearch = 1; $objPage->cache = 0; return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * * @return string */ public function generate() { if (TL_MODE == 'BE') { /** @var \BackendTemplate|object $objTemplate */ $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newsarchive'][0]) . ' ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); // No news archives available if (!is_array($this->news_archives) || empty($this->news_archives)) { return ''; } // Show the news reader if an item has been selected if ($this->news_readerModule > 0 && (isset($_GET['items']) || \Config::get('useAutoItem') && isset($_GET['auto_item']))) { return $this->getFrontendModule($this->news_readerModule, $this->strColumn); } // Hide the module if no period has been selected if ($this->news_jumpToCurrent == 'hide_module' && !isset($_GET['year']) && !isset($_GET['month']) && !isset($_GET['day'])) { return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### NEWS CATEGORIES MENU ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); // Return if there are no archives if (!is_array($this->news_archives) || empty($this->news_archives)) { return ''; } $param = 'items'; // Use the auto_item parameter if enabled if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) { $param = 'auto_item'; } $newsModel = \NewsModel::findPublishedByParentAndIdOrAlias(\Input::get($param), $this->news_archives); // Get the category IDs of the active news item if ($newsModel !== null) { $this->activeNewsCategories = deserialize($newsModel->categories, true); } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newsmenu'][0]) . ' ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); if (!is_array($this->news_archives) || empty($this->news_archives)) { return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### NEWS ARCHIVE MENU ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); if (!is_array($this->news_archives) || empty($this->news_archives)) { return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $objTemplate = new BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### NEWS ARCHIVE ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); if (!is_array($this->news_archives) || count($this->news_archives) < 1 || $this->news_jumpToCurrent == 'hide_module' && !isset($_GET['year']) && !isset($_GET['month']) && !isset($_GET['day'])) { return ''; } return parent::generate(); }
/** * Display a wildcard in the back end * * @return string */ public function generate() { if (TL_MODE == 'BE') { /** @var \BackendTemplate|object $objTemplate */ $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['newsmenu'][0]) . ' ###'; $objTemplate->title = $this->headline; $objTemplate->id = $this->id; $objTemplate->link = $this->name; $objTemplate->href = 'contao/main.php?do=themes&table=tl_module&act=edit&id=' . $this->id; return $objTemplate->parse(); } $this->news_archives = $this->sortOutProtected(deserialize($this->news_archives)); if (!is_array($this->news_archives) || empty($this->news_archives)) { return ''; } $this->strUrl = preg_replace('/\\?.*$/', '', \Environment::get('request')); if ($this->jumpTo && ($objTarget = $this->objModel->getRelated('jumpTo')) !== null) { $this->strUrl = $this->generateFrontendUrl($objTarget->row()); } return parent::generate(); }