Esempio n. 1
0
 public function testGetImageSpecs()
 {
     $rendition = new Rendition(200, 200, 'crop', 'test');
     $this->package->setRendition($rendition);
     $item = new Item($this->package, new LocalImage('test'));
     $item->setCoords('0_0_200_200');
     $this->assertEquals('crop_0_0_200_200', $item->getImageSpecs());
 }
Esempio n. 2
0
 /**
  * Set default for given entity
  *
  * @param Newscoop\Package\Item $item
  * @return Admin_Form_SlideshowItem
  */
 public function setDefaultsFromEntity(\Newscoop\Package\Item $item)
 {
     $this->setDefaults(array('caption' => $item->getCaption(), 'url' => $item->getVideoUrl()));
     return $this;
 }
 public function getPackageId()
 {
     $this->__load();
     return parent::getPackageId();
 }
Esempio n. 4
0
 /**
  * @param Newscoop\Package\Item $item
  */
 public function __construct(\Newscoop\Package\Item $item)
 {
     $this->caption = $item->getCaption();
     $this->is_image = $item->isImage();
     $this->is_video = $item->isVideo();
     if ($item->isImage()) {
         $thumbnail = $item->getRendition()->getThumbnail($item->getImage(), Zend_Registry::get('container')->getService('image'));
         $this->image = (object) array('src' => Zend_Registry::get('view')->url(array('src' => $thumbnail->src), 'image', true, false), 'width' => $thumbnail->width, 'height' => $thumbnail->height, 'original' => $item->getImage()->getPath());
     } else {
         $this->video = (object) array('url' => $item->getVideoUrl(), 'width' => $item->getRendition()->getWidth(), 'height' => $item->getRendition()->getHeight());
     }
 }