/** * Return if there are no files * @return string */ public function generate() { // Use the home directory of the current user as file source if ($this->useHomeDir && FE_USER_LOGGED_IN) { $this->import('FrontendUser', 'User'); if ($this->User->assignDir && $this->User->homeDir) { $this->folderSRC = $this->User->homeDir; } } // Return if there is no folder defined if (empty($this->folderSRC)) { return ''; } // Get the folders from the database $this->objFolder = \FilesModel::findByUuid($this->folderSRC); if ($this->objFolder === null) { if (!\Validator::isUuid($this->folderSRC[0])) { return '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>'; } return ''; } $file = \Input::get('file', true); // Send the file to the browser and do not send a 404 header (see #4632) if ($file != '' && !preg_match('/^meta(_[a-z]{2})?\\.txt$/', basename($file))) { if (strpos(dirname($file), $this->objFolder->path) !== FALSE) { \Controller::sendFileToBrowser($file); } } return parent::generate(); }
/** * Return if there are no files * @return string */ public function generate() { $this->arrItems = deserialize($this->visJsTimeline_items); // Return if there is no data defined if (empty($this->visJsTimeline_items)) { return ''; } return parent::generate(); }
/** * Extend the parent method * * @return string */ public function generate() { if ($this->vimeo_albumId == '') { return ''; } if (TL_MODE === 'BE') { return '<p><a href="https://vimeo.com/album/' . $this->vimeo_albumId . '" target="_blank">https://vimeo.com/album/' . $this->vimeo_albumId . '</a></p>'; } 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']['comments'][0]) . ' ###'; $objTemplate->title = $this->headline; return $objTemplate->parse(); } return parent::generate(); }
/** * Display a wildcard in the back end * @return string */ public function generate() { if (TL_MODE == 'BE') { $this->strTemplate = 'be_wildcard'; $this->Template = new \BackendTemplate($this->strTemplate); $this->Template->wildcard = '### SLICK SLIDER START ###'; $this->Template->title = $this->headline; return $this->Template->parse(); } return parent::generate(); }
/** * Show the raw markdown code in the back end * * @return string */ public function generate() { if (TL_MODE == 'BE') { $return = '<pre>' . \StringUtil::specialchars($this->code) . '</pre>'; if ($this->headline != '') { $return = '<' . $this->hl . '>' . $this->headline . '</' . $this->hl . '>' . $return; } return $return; } return parent::generate(); }
public function generate() { /* if (TL_MODE == 'BE') { $objTemplate = new \BackendTemplate('be_wildcard'); $objTemplate->wildcard = "### MEye Newsletter-Header (be_mode) ###"; $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 parent::generate(); }
/** * Extend the parent method * * @return string */ public function generate() { if ($this->vimeo_videoId == '') { return ''; } // Generate the backend buffer if (TL_MODE === 'BE') { $buffer = '<p><a href="https://vimeo.com/' . $this->vimeo_videoId . '" target="_blank">https://vimeo.com/' . $this->vimeo_videoId . '</a>'; // Display the hint that the video is linked to URL if ($this->vimeo_link) { $buffer .= ' - ' . sprintf($GLOBALS['TL_LANG']['MSC']['vimeo.video_link'], $this->url); } $buffer .= '</p>'; // Display the video image if (($video = $this->getVideo()) !== null) { $buffer .= '<figure><img src="' . $video->getPoster() . '" width="160" height="" alt=""></figure>'; } return $buffer; } return parent::generate(); }
/** * Return if there are no files * * @return string */ public function generate() { // Use the home directory of the current user as file source if ($this->useHomeDir && FE_USER_LOGGED_IN) { $this->import('FrontendUser', 'User'); if ($this->User->assignDir && $this->User->homeDir) { $this->multiSRC = array($this->User->homeDir); } } else { $this->multiSRC = \StringUtil::deserialize($this->multiSRC); } // Return if there are no files if (!is_array($this->multiSRC) || empty($this->multiSRC)) { return ''; } // Get the file entries from the database $this->objFiles = \FilesModel::findMultipleByUuids($this->multiSRC); if ($this->objFiles === null) { return ''; } return parent::generate(); }