Esempio n. 1
0
 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     $objElement = $this->Database->prepare("SELECT * FROM `tl_content` WHERE id = ?")->limit(1)->execute($this->id);
     $strAdditional = '';
     if ($this->sh5_additional) {
         foreach (deserialize($this->sh5_additional) as $arrAdditional) {
             if ($arrAdditional['property']) {
                 $strAdditional .= ' ' . $arrAdditional['property'] . (strlen($arrAdditional['value']) > 0 ? '="' . specialchars($arrAdditional['value']) . '"' : '');
             }
         }
     }
     $this->sh5_additional = $strAdditional;
     if (TL_MODE == 'BE') {
         $objTemplate = new BackendTemplate('be_wildcard');
         $objTemplate->wildcard = vsprintf("<%s%s%s%s>", array(($this->sh5_tag == 'end' ? '/' : '') . $objElement->sh5_type, $this->sh5_tag == 'start' && strlen($this->cssID[0]) ? ' id="' . $this->cssID[0] . '"' : '', $this->sh5_tag == 'start' && strlen($this->cssID[1]) ? ' class="' . $this->cssID[1] . '"' : '', $this->sh5_additional));
         $strReturn = $objTemplate->parse();
         // Add script to toggle wrong wrapper class in backend
         $strReturn .= $this->sh5_tag == 'end' && version_compare(VERSION, 3, '>=') ? '<script>
             if(document.getElementById("li_' . $this->id . '")) {
                 var elem = document.getElementById("li_' . $this->id . '").firstElementChild;
                 elem.className = elem.className.replace("wrapper_start", "wrapper_stop");
             }
         </script>' : '';
         // Add script to remove all indent classes as quick workaround
         $strReturn .= version_compare(VERSION, 3, '>=') ? '<script>
             var el = document.getElementById("li_' . $this->id . '");
             if(el) {
                 var elem = el.firstElementChild;
                 elem.className = elem.className.replace(" indent ", "");
             }
         </script>' : '';
         return $strReturn;
     }
     return parent::generate();
 }
 /**
  * generate function.
  *
  * @access public
  * @return void
  */
 public function generate()
 {
     // Set Pa2 Type
     $this->pa2type = 'CE';
     // Deserialize vars
     $this->groups = deserialize($this->groups);
     $this->pa2ImagesMetaFields = deserialize($this->pa2ImagesMetaFields);
     $this->pa2TimeFilterStart = deserialize($this->pa2TimeFilterStart);
     $this->pa2TimeFilterEnd = deserialize($this->pa2TimeFilterEnd);
     // Set true and false on checkboxes
     $this->pa2ImagesShowHeadline = $this->pa2ImagesShowHeadline == 1 ? true : false;
     $this->pa2ImagesShowTitle = $this->pa2ImagesShowTitle == 1 ? true : false;
     $this->pa2ImagesShowTeaser = $this->pa2ImagesShowTeaser == 1 ? true : false;
     if (TL_MODE == 'BE') {
         $this->pa2ImagesShowHeadline = false;
         $this->pa2ImagesShowTitle = false;
         $this->pa2ImagesShowTeaser = false;
         $this->pa2ImagesPerRow = 1;
         $this->pa2ImagesPerPage = 0;
         $this->pa2NumberOfImages = 0;
         $this->pa2ImagesImageSize = serialize(array(50, 31, 'center_center'));
         $this->pa2ImagesImageMargin = serialize(array('bottom' => 6, 'left' => '', 'right' => 6, 'top' => '', 'unit' => 'px'));
     }
     return parent::generate();
 }
Esempio n. 3
0
 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     $this->strSet = $GLOBALS['TL_CONFIG']['subcolumns'] ? $GLOBALS['TL_CONFIG']['subcolumns'] : 'yaml3';
     if (TL_MODE == 'BE') {
         $arrColor = unserialize($this->sc_color);
         if (!$GLOBALS['TL_SUBCL'][$this->strSet]['files']['css']) {
             $this->Template = new \BackendTemplate('be_subcolumns');
             $this->Template->setColor = $this->compileColor($arrColor);
             $this->Template->colsetTitle = '### COLUMNSET START ' . $this->sc_type . ' <strong>' . $this->sc_name . '</strong> ###';
             return $this->Template->parse();
         }
         $GLOBALS['TL_CSS']['subcolumns'] = 'system/modules/Subcolumns/assets/be_style.css';
         $GLOBALS['TL_CSS']['subcolumns_set'] = $GLOBALS['TL_SUBCL'][$this->strSet]['files']['css'];
         $arrColset = $GLOBALS['TL_SUBCL'][$this->strSet]['sets'][$this->sc_type];
         $strSCClass = $GLOBALS['TL_SUBCL'][$this->strSet]['scclass'];
         $blnInside = $GLOBALS['TL_SUBCL'][$this->strSet]['inside'];
         $intCountContainers = count($GLOBALS['TL_SUBCL'][$this->strSet]['sets'][$this->sc_type]);
         $strMiniset = '<div class="colsetexample final ' . $strSCClass . '">';
         for ($i = 0; $i < $intCountContainers; $i++) {
             $arrPresentColset = $arrColset[$i];
             $strMiniset .= '<div class="' . $arrPresentColset[0] . '">' . ($blnInside ? '<div class="' . $arrPresentColset[1] . '">' : '') . ($i + 1) . ($blnInside ? '</div>' : '') . '</div>';
         }
         $strMiniset .= '</div>';
         $this->Template = new \BackendTemplate('be_subcolumns');
         $this->Template->setColor = $this->compileColor($arrColor);
         $this->Template->colsetTitle = '### COLUMNSET START ' . $this->sc_type . ' <strong>' . $this->sc_name . '</strong> ###';
         $this->Template->visualSet = $strMiniset;
         return $this->Template->parse();
     }
     return parent::generate();
 }
 /**
  * @param        $objElement
  * @param string $strColumn
  */
 public function __construct($objElement, $strColumn = 'main')
 {
     parent::__construct($objElement, $strColumn);
     $this->arrData = new Attributes($this->arrData);
     $this->arrData->registerNamespaceAttributes($this->arrBootstrapAttributes);
     $this->cssDefinitioin = $this->cssID;
 }
Esempio n. 5
0
 /**
  * Extend the parent method
  * @return string
  */
 public function generate()
 {
     if ($this->playerSRC == '') {
         return '';
     }
     $source = deserialize($this->playerSRC);
     if (!is_array($source) || empty($source)) {
         return '';
     }
     $objFiles = \FilesModel::findMultipleByIdsAndExtensions($source, array('mp4', 'm4v', 'mov', 'wmv', 'webm', 'ogv', 'm4a', 'mp3', 'wma', 'mpeg', 'wav'));
     if ($objFiles === null) {
         return '';
     }
     // Display a list of files in the back end
     if (TL_MODE == 'BE') {
         $return = '<ul>';
         while ($objFiles->next()) {
             $objFile = new \File($objFiles->path);
             $return .= '<li><img src="system/themes/' . $this->getTheme() . '/images/' . $objFile->icon . '" width="18" height="18" alt="" class="mime_icon"> <span>' . $objFile->name . '</span> <span class="size">(' . $this->getReadableSize($objFile->size) . ')</span></li>';
         }
         return $return . '</ul>';
     }
     $this->objFiles = $objFiles;
     return parent::generate();
 }
Esempio n. 6
0
 /**
  * Return if there are no files
  *
  * @return string
  */
 public function generate()
 {
     if ($this->playerSRC == '') {
         return '';
     }
     $source = \StringUtil::deserialize($this->playerSRC);
     if (!is_array($source) || empty($source)) {
         return '';
     }
     $objFiles = \FilesModel::findMultipleByUuidsAndExtensions($source, array('mp4', 'm4v', 'mov', 'wmv', 'webm', 'ogv', 'm4a', 'mp3', 'wma', 'mpeg', 'wav', 'ogg'));
     if ($objFiles === null) {
         return '';
     }
     // Display a list of files in the back end
     if (TL_MODE == 'BE') {
         $return = '<ul>';
         while ($objFiles->next()) {
             $objFile = new \File($objFiles->path);
             $return .= '<li>' . \Image::getHtml($objFile->icon, '', 'class="mime_icon"') . ' <span>' . $objFile->name . '</span> <span class="size">(' . $this->getReadableSize($objFile->size) . ')</span></li>';
         }
         return $return . '</ul>';
     }
     $this->objFiles = $objFiles;
     return parent::generate();
 }
Esempio n. 7
0
 public function generate()
 {
     if (!empty($GLOBALS['SLICKMAP']['CSS'])) {
         $GLOBALS['TL_CSS'][] = $GLOBALS['SLICKMAP']['CSS'];
     }
     return parent::generate();
 }
 /**
  * Parse the template
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE' && !defined('NEWSLETTER_CONTENT_PREVIEW')) {
         return 'NEWSLETTER ROW BREAK';
     }
     return parent::generate();
 }
 public function generate()
 {
     if (TL_MODE == 'BE') {
         return '';
     }
     return parent::generate();
 }
Esempio n. 10
0
 public function __construct($rowDefintion)
 {
     parent::__construct($rowDefintion);
     foreach ($rowDefintion['data'] as $cellDefintion) {
         $this->data[] = new Cell($cellDefintion);
     }
 }
Esempio n. 11
0
 /**
  * Return if the file does not exist
  *
  * @return string
  */
 public function generate()
 {
     // Return if there is no file
     if ($this->singleSRC == '') {
         return '';
     }
     $objFile = \FilesModel::findByUuid($this->singleSRC);
     if ($objFile === null) {
         if (!\Validator::isUuid($this->singleSRC)) {
             return '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>';
         }
         return '';
     }
     $allowedDownload = trimsplit(',', strtolower(\Config::get('allowedDownload')));
     // Return if the file type is not allowed
     if (!in_array($objFile->extension, $allowedDownload)) {
         return '';
     }
     $file = \Input::get('file', true);
     // Send the file to the browser and do not send a 404 header (see #4632)
     if ($file != '' && $file == $objFile->path) {
         \Controller::sendFileToBrowser($file);
     }
     $this->singleSRC = $objFile->path;
     return parent::generate();
 }
Esempio n. 12
0
 /**
  * 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 && is_dir(TL_ROOT . '/' . $this->User->homeDir)) {
             $this->multiSRC = array($this->User->homeDir);
         }
     } else {
         $this->multiSRC = deserialize($this->multiSRC);
     }
     // Return if there are no files
     if (!is_array($this->multiSRC) || empty($this->multiSRC)) {
         return '';
     }
     // Check for version 3 format
     if (!is_numeric($this->multiSRC[0])) {
         return '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>';
     }
     // Get the file entries from the database
     $this->objFiles = \FilesModel::findMultipleByIds($this->multiSRC);
     if ($this->objFiles === null) {
         return '';
     }
     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 = 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) {
         if (!\Validator::isUuid($this->multiSRC[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))) {
         while ($this->objFiles->next()) {
             if ($file == $this->objFiles->path || dirname($file) == $this->objFiles->path) {
                 \Controller::sendFileToBrowser($file);
             }
         }
         $this->objFiles->reset();
     }
     return parent::generate();
 }
Esempio n. 14
0
 /**
  * Return if the image does not exist
  * @return string
  */
 public function generate()
 {
     if (!strlen($this->singleSRC) || !is_file(TL_ROOT . '/' . $this->singleSRC)) {
         return '';
     }
     return parent::generate();
 }
 /**
  * Initialize the object
  * @param object
  * @param string
  */
 public function __construct($objElement, $strColumn = 'main')
 {
     parent::__construct($objElement, $strColumn);
     if ($this->customTpl != '') {
         $this->strTemplate = $this->customTpl;
     }
 }
Esempio n. 16
0
 /**
  * Parse the template
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE' && !defined('EX_TL_MODE_FE')) {
         $strContent = parent::generate();
         if ($this->pageCode < 0) {
             $strContent = '<div style="color:#a22;font-weight:bold;">→ ' . $this->pageLink . '</div>' . $strContent;
         } elseif ($this->pageCode > 0) {
             $strContent = '<div style="color:#22a">→ ' . $this->pageLink . '</div>' . $strContent;
         } else {
             $strContent = '<div>→ ' . $this->pageLink . '</div>' . $strContent;
         }
         return $strContent;
     } else {
         if (!empty($GLOBALS['TL_CONFIG']['pageTeaserJsLink']) && !defined('PAGE_TEASER_JS_LINK')) {
             $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/ce_page_teaser/assets/scripts/page_teaser.js|static';
             define('PAGE_TEASER_JS_LINK', 1);
         }
         $strContent = parent::generate();
         if ($this->pageCode > -1) {
             return $strContent;
         } else {
             return '';
         }
     }
 }
Esempio n. 17
0
 /**
  * Return if the file does not exist
  * @return string
  */
 public function generate()
 {
     // Return if there is no file
     if ($this->singleSRC == '') {
         return '';
     }
     // Check for version 3 format
     if (!is_numeric($this->singleSRC)) {
         return '<p class="error">' . $GLOBALS['TL_LANG']['ERR']['version2format'] . '</p>';
     }
     $objFile = \FilesModel::findByPk($this->singleSRC);
     if ($objFile === null) {
         return '';
     }
     $allowedDownload = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));
     // Return if the file type is not allowed
     if (!in_array($objFile->extension, $allowedDownload)) {
         return '';
     }
     $file = \Input::get('file', true);
     // Send the file to the browser and do not send a 404 header (see #4632)
     if ($file != '' && $file == $objFile->path) {
         $this->sendFileToBrowser($file);
     }
     $this->singleSRC = $objFile->path;
     return parent::generate();
 }
 /**
  * Parse the template
  *
  * @return string Parsed element
  */
 public function generate()
 {
     if (TL_MODE === 'BE') {
         return parent::generate();
     }
     $parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
     $htmlPrefix = '';
     if (!empty($GLOBALS['TL_RS_COLUMNS'][$parentKey])) {
         if ($GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
             $GLOBALS['TL_RS_COLUMNS'][$parentKey]['count']++;
             $count = $GLOBALS['TL_RS_COLUMNS'][$parentKey]['count'];
             if ($count) {
                 $classes = array('rs-column');
                 foreach ($GLOBALS['TL_RS_COLUMNS'][$parentKey]['config'] as $name => $media) {
                     $classes = array_merge($classes, $media[($count - 1) % count($media)]);
                     if ($count - 1 < count($media)) {
                         $classes[] = '-' . $name . '-first-row';
                     }
                 }
                 $htmlPrefix .= '<div class="' . implode(' ', $classes) . '">';
             }
         }
         $GLOBALS['TL_RS_COLUMNS_STACK'][$parentKey][] = $GLOBALS['TL_RS_COLUMNS'][$parentKey];
     }
     $GLOBALS['TL_RS_COLUMNS'][$parentKey] = array('active' => true, 'count' => 0, 'config' => static::getColumnsConfiguration($this->arrData));
     return $htmlPrefix . parent::generate();
 }
 public function generate()
 {
     Dump($_POST);
     $pathFile = \Input::get($this->strQsParam, true);
     $isPath = substr($pathFile, 0, 1) === '/';
     if ($pathFile != '') {
         $accessToken = \Config::get('dropboxAccessToken');
         $dbxClient = new \DropboxClient($accessToken, "PHP-Example/1.0");
         try {
             if (!$isPath) {
                 $files = json_decode(urldecode($this->dropboxChooserFiles), true);
                 foreach ($files as $f) {
                     $basename = urldecode(explode('?', basename($f['link']))[0]);
                     if ($basename == $pathFile) {
                         $metadata = $dbxClient->getMetadataSharedLink($f['link']);
                         $pathFile = $metadata['path'];
                     }
                 }
             }
             $sharedLink = $dbxClient->createTemporaryDirectLink($pathFile);
             //$sharedLink = $dbxClient->createShareableLink($pathFile);
         } catch (dbx\Exception_BadRequest $ex) {
             print "Error loading <app-info-file>: " . $ex->getMessage() . "\n";
             // fwrite(STDERR, "Error loading <app-info-file>: ".$ex->getMessage()."\n");
             die;
         }
         //Dump($sharedLink);
         $this->redirect($sharedLink[0]);
     }
     return parent::generate();
 }
 /**
  * Parse the template
  *
  * @return string Parsed element
  */
 public function generate()
 {
     if (TL_MODE === 'BE') {
         return parent::generate();
     }
     $classes = array('rs-column');
     $parentKey = ($this->arrData['ptable'] ?: 'tl_article') . '__' . $this->arrData['pid'];
     if (isset($GLOBALS['TL_RS_COLUMNS'][$parentKey]) && $GLOBALS['TL_RS_COLUMNS'][$parentKey]['active']) {
         $GLOBALS['TL_RS_COLUMNS'][$parentKey]['active'] = false;
         $GLOBALS['TL_RS_COLUMNS'][$parentKey]['count']++;
         $count = $GLOBALS['TL_RS_COLUMNS'][$parentKey]['count'];
         foreach ($GLOBALS['TL_RS_COLUMNS'][$parentKey]['config'] as $name => $media) {
             $classes = array_merge($classes, $media[($count - 1) % count($media)]);
             if ($count - 1 < count($media)) {
                 $classes[] = '-' . $name . '-first-row';
             }
         }
     } else {
         trigger_error('Missing column wrapper start element before column start element ID ' . $this->id . '.', E_USER_WARNING);
     }
     if (!is_array($this->cssID)) {
         $this->cssID = array('', '');
     }
     $this->arrData['cssID'][1] .= ' ' . implode(' ', $classes);
     return parent::generate();
 }
Esempio n. 21
0
 /**
  * Generate content element
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         // get map data
         $objMap = \delahaye\googlemaps\MapModel::findByPk($this->dlh_googlemap);
         return '<h1>' . $objMap->title . '</h1>';
     }
     return parent::generate();
 }
Esempio n. 22
0
 /**
  * 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']['CTE']['book_gallery'][1]) . ' ###';
         return $objTemplate->parse();
     }
     return parent::generate();
 }
Esempio n. 23
0
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $this->Template = new BackendTemplate('be_wildcard');
         $this->Template->wildcard = '### E&F GRID: Spalte Ende ###';
         return $this->Template->parse();
     }
     return parent::generate();
 }
Esempio n. 24
0
 /**
  * Return if there are no files
  * @return string
  */
 public function generate()
 {
     if (!isset($_GET['items']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('items', \Input::get('auto_item'));
     }
     if (!isset($_GET['alpha']) && $GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item'])) {
         \Input::setGet('alpha', \Input::get('auto_item'));
     }
     return parent::generate();
 }
Esempio n. 25
0
 /**
  * Extend the parent method
  * @return string
  */
 public function generate()
 {
     if ($this->aparat == '') {
         return '';
     }
     if (TL_MODE == 'BE') {
         return '<p><a href="http://www.aparat.com/v/' . $this->aparat . '" target="_blank">http://www.aparat.com/v/' . $this->aparat . '</a></p>';
     }
     return parent::generate();
 }
Esempio n. 26
0
 /**
  * Display a wildcard in the back end
  * @return string
  */
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $objTemplate = new BackendTemplate('be_wildcard');
         $objTemplate->wildcard = '### COMMENTS ###';
         $objTemplate->title = $this->headline;
         return $objTemplate->parse();
     }
     return parent::generate();
 }
Esempio n. 27
0
 /**
  * Show the YouTube link in the back end
  *
  * @return string
  */
 public function generate()
 {
     if ($this->youtube == '') {
         return '';
     }
     if (TL_MODE == 'BE') {
         return '<p><a href="https://youtu.be/' . $this->youtube . '" target="_blank">youtu.be/' . $this->youtube . '</a></p>';
     }
     return parent::generate();
 }
Esempio n. 28
0
 /**
  * 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']['comments'][0]) . ' ###';
         $objTemplate->title = $this->headline;
         return $objTemplate->parse();
     }
     return parent::generate();
 }
 public function generate()
 {
     if (TL_MODE == 'BE') {
         $this->strTemplate = 'be_wildcard';
         $objTemplate = new \BackendTemplate($this->strTemplate);
         $this->Template = $objTemplate;
         $this->Template->title = $this->headline;
     }
     return parent::generate();
 }
Esempio n. 30
0
 /**
  * Check whether the target page and article are published
  * @return string
  */
 public function generate()
 {
     $time = time();
     $objArticle = $this->Database->prepare("SELECT p.id AS id, p.alias AS alias, a.id AS aid, a.title AS title, a.alias AS aalias, a.teaser AS teaser, a.inColumn AS inColumn FROM tl_article a, tl_page p WHERE a.id=? AND a.pid=p.id" . (!BE_USER_LOGGED_IN ? " AND (p.start='' OR p.start<{$time}) AND (p.stop='' OR p.stop>{$time}) AND p.published=1 AND (a.start='' OR a.start<{$time}) AND (a.stop='' OR a.stop>{$time}) AND a.published=1" : ""))->limit(1)->execute($this->article);
     if ($objArticle->numRows < 1) {
         return '';
     }
     $this->objArticle = $objArticle;
     return parent::generate();
 }