Exemplo n.º 1
0
 /**
  * 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']['eventreader'][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['events']) && \Config::get('useAutoItem') && isset($_GET['auto_item'])) {
         \Input::setGet('events', \Input::get('auto_item'));
     }
     // Do not index or cache the page if no event has been specified
     if (!\Input::get('events')) {
         /** @var PageModel $objPage */
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     $this->cal_calendar = $this->sortOutProtected(\StringUtil::deserialize($this->cal_calendar));
     // Do not index or cache the page if there are no calendars
     if (!is_array($this->cal_calendar) || empty($this->cal_calendar)) {
         /** @var PageModel $objPage */
         global $objPage;
         $objPage->noSearch = 1;
         $objPage->cache = 0;
         return '';
     }
     return parent::generate();
 }
Exemplo n.º 2
0
 /**
  * Do not show the module if no calendar has been selected
  *
  * @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']['calendar'][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->cal_calendar = $this->sortOutProtected(\StringUtil::deserialize($this->cal_calendar, true));
     // Return if there are no calendars
     if (!is_array($this->cal_calendar) || empty($this->cal_calendar)) {
         return '';
     }
     $this->strUrl = preg_replace('/\\?.*$/', '', \Environment::get('request'));
     $this->strLink = $this->strUrl;
     if ($this->jumpTo && ($objTarget = $this->objModel->getRelated('jumpTo')) instanceof PageModel) {
         /** @var PageModel $objTarget */
         $this->strLink = $objTarget->getFrontendUrl();
     }
     return parent::generate();
 }
Exemplo n.º 3
0
 /**
  * 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']['eventlist'][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->cal_calendar = $this->sortOutProtected(deserialize($this->cal_calendar, true));
     // Return if there are no calendars
     if (!is_array($this->cal_calendar) || empty($this->cal_calendar)) {
         return '';
     }
     // Show the event reader if an item has been selected
     if ($this->cal_readerModule > 0 && (isset($_GET['events']) || \Config::get('useAutoItem') && isset($_GET['auto_item']))) {
         return $this->getFrontendModule($this->cal_readerModule, $this->strColumn);
     }
     return parent::generate();
 }