/** * @param $resolutionName * @param Tx_YAG_Domain_Model_Item $image * @return int */ protected function getResolutionHeight($resolutionName, Tx_YAG_Domain_Model_Item $image) { $resolutionConfig = $this->configurationBuilder->buildThemeConfiguration()->getResolutionConfigCollection()->getResolutionConfig($resolutionName); $resolutionImage = $image->getResolutionByConfig($resolutionConfig); $resolutionHeight = $resolutionImage->getHeight(); return $resolutionHeight; }
/** * (non-PHPdoc) * @see Classes/Core/ViewHelper/Tx_Fluid_Core_ViewHelper_AbstractTagBasedViewHelper::initialize() */ public function initialize() { parent::initialize(); $this->configurationBuilder = Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance(); $this->resolutionConfigCollection = $this->configurationBuilder->buildThemeConfiguration()->getResolutionConfigCollection(); $this->crossSlideSettings = $this->configurationBuilder->getSettings('crossSlide'); }
/** * @param Tx_PtExtlist_Domain_Model_List_ListData $listData * @return string */ protected function buildGalleriaJSONData(Tx_PtExtlist_Domain_Model_List_ListData $listData) { $resolutionConfigCollection = $this->configurationBuilder->buildThemeConfiguration()->getResolutionConfigCollection(); $data = array(); foreach ($listData as $row) { /** @var Tx_PtExtlist_Domain_Model_List_Row $row */ $image = $row->getCell('image')->getValue(); /** @var Tx_Yag_Domain_Model_Item $image */ $pathPrefix = TYPO3_MODE === 'BE' ? '../' : $GLOBALS['TSFE']->absRefPrefix; $data[] = array('thumb' => $pathPrefix . $image->getResolutionByConfig($resolutionConfigCollection->getResolutionConfig('thumb'))->getPath(), 'image' => $pathPrefix . $image->getResolutionByConfig($resolutionConfigCollection->getResolutionConfig('medium'))->getPath(), 'big' => $pathPrefix . $image->getResolutionByConfig($resolutionConfigCollection->getResolutionConfig('big'))->getPath(), 'title' => $image->getTitle(), 'description' => $image->getDescription(), 'link' => $this->renderTypoLink($image->getLink())); } return json_encode($data); }
/** * Set the TS defined custom paths in view * * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view * @throws Exception */ protected function setCustomPathsInView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) { $templatePathAndFilename = null; // We can overwrite a template via TS using plugin.yag.settings.controller.<ControllerName>.<actionName>.template if ($this->configurationBuilder) { $templatePathAndFilename = $this->configurationBuilder->buildThemeConfiguration()->getTemplate($this->request->getControllerName(), $this->request->getControllerActionName()); $this->objectManager->get('Tx_Yag_Utility_HeaderInclusion')->includeThemeDefinedHeader($this->configurationBuilder->buildThemeConfiguration()); } if (!$templatePathAndFilename) { $templatePathAndFilename = $this->settings['controller'][$this->request->getControllerName()][$this->request->getControllerActionName()]['template']; } if (isset($templatePathAndFilename) && strlen($templatePathAndFilename) > 0) { /** * Format Overlay */ if ($this->request->getFormat() && strtolower($this->request->getFormat()) !== 'html') { $templatePathAndFilename = Tx_Yag_Domain_FileSystem_Div::concatenatePaths(array(dirname($templatePathAndFilename), basename($templatePathAndFilename, '.html') . '.' . $this->request->getFormat())); } if (file_exists(GeneralUtility::getFileAbsFileName($templatePathAndFilename))) { $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templatePathAndFilename)); } else { throw new Exception('Given template path and filename could not be found or resolved: ' . $templatePathAndFilename . ' 1284655109'); } } }
/** * @return Tx_Yag_Domain_Configuration_Image_ResolutionConfig */ protected function getRequestedResolutionConfig() { return $this->configurationBuilder->buildThemeConfiguration()->getResolutionConfigCollection()->getResolutionConfig($this->resolutionIdentifier); }
/** * @param $listData */ protected function preloadResolutionCache($listData) { Tx_Yag_Domain_FileSystem_ResolutionFileCacheFactory::getInstance()->preloadCacheForItemsAndTheme($listData, $this->configurationBuilder->buildThemeConfiguration()); }