Example #1
0
 /**
  * Decorates the image object
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function decorateImage(CTablePhoto $photo, CTableAlbum $album)
 {
     $obj = new stdClass();
     $obj->place = 'jomsocial';
     $obj->title = JText::_($photo->caption);
     $obj->url = $photo->getOriginalURI();
     $obj->key = EBMM::getKey('jomsocial:' . $photo->albumid . '/' . $photo->id);
     $obj->type = 'image';
     $obj->icon = EBMM::getIcon('image');
     $obj->modified = $photo->created;
     $obj->size = 0;
     // Thumbnails are larger than preview
     $obj->thumbnail = $photo->getThumbURI();
     // Preview is used in the listing
     $obj->preview = $photo->getThumbURI();
     $obj->variations = $this->getVariations($photo);
     return $obj;
 }
Example #2
0
 /**
  *
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function decorateImage(SocialTablePhoto $photo, SocialTableAlbum $album)
 {
     $obj = new stdClass();
     $obj->place = 'easysocial';
     $obj->title = $photo->get('title');
     $obj->url = rtrim(JURI::root(), '/') . str_ireplace(JPATH_ROOT, '', $photo->getStoragePath($album));
     $obj->key = EBMM::getKey('easysocial:' . $photo->album_id . '/' . $photo->id);
     $obj->type = 'image';
     $obj->icon = EBMM::getIcon('image');
     $obj->modified = $photo->created;
     $obj->size = 0;
     // Thumbnails are larger than preview
     $obj->thumbnail = $photo->getSource();
     // Preview is used in the listing
     $obj->preview = $photo->getSource();
     $obj->variations = $this->getVariations($photo);
     return $obj;
 }
Example #3
0
 /**
  * Given a raw format of a flickr object and convert it into a media manager object.
  *
  * @since	5.0
  * @access	public
  * @param	string
  * @return
  */
 public function decorate(&$item, $uri)
 {
     $obj = new stdClass();
     $obj->uri = $uri;
     $obj->place = 'flickr';
     $obj->title = $item->title;
     // Url should be the original source
     $obj->url = $item->sizes['Original']->source;
     $obj->key = EBMM::getKey('flickr/' . $item->id);
     $obj->type = 'image';
     $obj->icon = EBMM::getIcon('image');
     $obj->modified = $item->dateupload;
     $obj->size = 0;
     $obj->thumbnail = $item->sizes['Thumbnail']->source;
     $obj->preview = $item->sizes['Medium']->source;
     $obj->variations = array();
     foreach ($item->sizes as $size) {
         $key = 'system/' . strtolower($size->title);
         // Create variation
         $variation = new stdClass();
         $variation->key = $key;
         $variation->name = $size->title;
         $variation->type = 'system';
         $variation->url = $size->source;
         $variation->width = $size->width;
         $variation->height = $size->height;
         $variation->size = 0;
         $obj->variations[$key] = $variation;
     }
     return $obj;
 }