/**
  * @param Tx_Yag_Domain_Model_Item $item
  * @param null $resolutionName
  * @param null $width
  * @param null $height
  * @param null $quality
  * @param boolean $absolute
  * @return string
  */
 public function render(Tx_Yag_Domain_Model_Item $item, $resolutionName = null, $width = null, $height = null, $quality = null, $absolute = false)
 {
     if ($resolutionName) {
         $resolutionConfig = Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance()->buildThemeConfiguration()->getResolutionConfigCollection()->getResolutionConfig($resolutionName);
     } elseif ($width || $height) {
         $resolutionSettings = array('width' => $width, 'height' => $height, 'quality' => $quality);
         $resolutionConfig = new Tx_Yag_Domain_Configuration_Image_ResolutionConfig(Tx_Yag_Domain_Configuration_ConfigurationBuilderFactory::getInstance(), $resolutionSettings);
     } else {
         $resolutionConfig = null;
     }
     $imageResolution = $item->getResolutionByConfig($resolutionConfig);
     if ($absolute == true) {
         $imageSource = $this->controllerContext->getRequest()->getBaseUri() . $imageResolution->getPath();
     } else {
         $imageSource = TYPO3_MODE === 'BE' ? '../' . $imageResolution->getPath() : $GLOBALS['TSFE']->absRefPrefix . $imageResolution->getPath();
     }
     return $imageSource;
 }
Exemple #2
0
 /**
  * @param Tx_Yag_Domain_Model_Item $item
  * @return string
  */
 protected function getFilePathOfResolution(Tx_Yag_Domain_Model_Item $item)
 {
     if ($this->resolutionIdentifier === 'original') {
         return Tx_Yag_Domain_FileSystem_Div::makePathAbsolute($item->getSourceuri());
     } else {
         return Tx_Yag_Domain_FileSystem_Div::makePathAbsolute($item->getResolutionByConfig($this->getRequestedResolutionConfig())->getPath());
     }
 }