예제 #1
0
 /**
  * @param \Cms\Data\Media $media
  */
 protected function attachMediaUrls(&$media)
 {
     $config = Registry::getConfig();
     $maxWidth = $config->media->icon->maxWidth;
     $maxHeight = $config->media->icon->maxHeight;
     $mediaInfoStorage = $this->getMediaInfoStorage($media->getWebsiteid());
     $url = $mediaInfoStorage->getUrl($media->getId());
     $downloadUrl = $mediaInfoStorage->getDownloadUrl($media->getId());
     $iconUrl = $mediaInfoStorage->getPreviewUrl($media->getId(), array(array('maxsize', $maxWidth, $maxHeight)));
     $media->setUrl($url);
     $media->setDownloadUrl($downloadUrl);
     $media->setIconUrl($iconUrl);
 }