/** * generate function. * * @access protected * @return void */ protected function generate() { $this->Template->intMaxItems = $this->Template->pa2NumberOfAlbums; $this->Template->intItemsPerPage = $this->Template->pa2AlbumsPerPage; $this->Template->intItemsPerRow = $this->Template->pa2AlbumsPerRow; $this->Template->strTemplate = strlen($this->Template->pa2AlbumViewTemplate) > 0 ? $this->Template->pa2AlbumViewTemplate : 'pa2_wrap'; $this->Template->strSubtemplate = strlen($this->Template->pa2AlbumsTemplate) > 0 ? $this->Template->pa2AlbumsTemplate : 'pa2_album'; $this->Template->intDetailPage = $this->Template->pa2DetailPage; $this->Template->albumLightbox = $this->Template->pa2AlbumLightbox; $this->Template->showMetaDescriptions = $this->Template->pa2AlbumsShowMetaDescriptions; $this->Template->arrMetaFields = $this->Template->pa2AlbumsMetaFields; // Image params $this->Template->size = $this->Template->pa2AlbumsImageSize; $this->Template->imagemargin = $this->Template->pa2AlbumsImageMargin; $this->Template->showHeadline = $this->Template->pa2AlbumsShowHeadline; $this->Template->showTitle = $this->Template->pa2AlbumsShowTitle; $this->Template->showTeaser = $this->Template->pa2AlbumsShowTeaser; $this->Template->teaser = $this->cleanRteOutput(\TranslationFields::translateValue($this->Template->pa2Teaser)); $this->Template->showHeadline = $this->Template->headline != '' ? $this->Template->showHeadline : false; $this->Template->showTeaser = $this->Template->teaser != '' ? $this->Template->showTeaser : false; parent::generate(); }
/** * getAlbums function. * * @access public * @return object */ public function getAlbums() { if (count($this->items) > 0) { $objAlbum = \Photoalbums2AlbumModel::findMultipleByIds($this->items); if ($objAlbum !== null) { while ($objAlbum->next()) { // Translate fields if ($objAlbum->current() instanceof \Photoalbums2\Photoalbums2AlbumModel) { Controller::loadDataContainer($objAlbum->current()->getTable()); $arrRow = \TranslationFields::translateDCArray($objAlbum->row(), $objAlbum->current()->getTable()); $objAlbum->setRow($arrRow); } // Get preview image as Pa2Image object $objImage = new \Pa2Image($objAlbum->previewImage); $objAlbum->objPreviewImage = $objImage->getPa2Image(); // Deserialize arrays $objAlbum->images = deserialize($objAlbum->images); $objAlbum->imageSort = deserialize($objAlbum->imageSort); // Set sortedImageIds $objPa2ImageSorter = new \Pa2ImageSorter($objAlbum->imageSortType, $objAlbum->images, $objAlbum->imageSort); $objAlbum->arrSortedImageUuids = $objPa2ImageSorter->getSortedUuids(); } $objAlbum->reset(); } return $objAlbum; } return null; }
/** * @param string $strName * @return string */ protected function getContent($strName = 'content') { $strName = ucfirst(strtolower($strName)); if (isset($GLOBALS['TL_CONFIG'][$this->strType . $strName])) { $strContent = \TranslationFields::translateValue($GLOBALS['TL_CONFIG'][$this->strType . $strName], $this->strForceLanguage); $objSession = \Session::getInstance(); $objSession->set('ACCOUNTMAIL_PARAMETERS', $this->arrParameters); $strContent = $this->replaceInsertTags($strContent, false); $objSession->remove('ACCOUNTMAIL_PARAMETERS'); // Only for deprecated {{blabla}} tags, will be removed in v1.3 $strContent = $this->replaceParameters($strContent); return $strContent; } }