Ejemplo n.º 1
0
    /**
     * Statically creates a new MediaObject instance
     *
     * @param  string $content Its content
     * @param  string $media Its media
     * @param  array $attributes The media object's attributes
     * @return MediaObject
     */
    public static function create($content, $media = null, $attributes = array())
    {
        static::$object = new static($content);
        if ($media) {
            static::$object->with_image($media);
        }
        if ($attributes) static::$object->attributes = $attributes;

        return static::$object;
    }
 public function testAssignToAlbum()
 {
     $album = Album::create('My temporary album name');
     $media = MediaObject::create('path/to');
     $album->addObject($media);
     foreach ($album->getObjects() as $object) {
         $this->assertEquals($media->getId(), $object->getId());
         $this->assertEquals($media->uri(), $object->uri());
     }
 }
Ejemplo n.º 3
0
 /**
  * Checks if guest is loggedin for the album
  * @param unknown_type $hint
  * @param unknown_type $show
  */
 function checkforGuest(&$hint = NULL, &$show = NULL)
 {
     if (!parent::checkForGuest()) {
         return false;
     }
     return checkAlbumPassword($this, $hint);
 }
	function AppletObject ($pagename, $fname, $attr) {
		MediaObject::MediaObject($pagename, $fname, $attr);
		$this->linkUploadedFile($fname);
	}
	function VideoObject ($pagename, $fname) {
		MediaObject::MediaObject($pagename, $fname);
	}
Ejemplo n.º 6
0
 /**
  * Checks if guest is loggedin for the album
  * @param unknown_type $hint
  * @param unknown_type $show
  */
 function checkforGuest(&$hint = NULL, &$show = NULL)
 {
     if (!parent::checkForGuest()) {
         return false;
     }
     $album = $this->getAlbum();
     return $album->checkforGuest($hint, $show);
 }
	function getDocBook ($role, $attr) {
		if ($role == 'fo' && !isset($attr['width']) && !isset($attr['height'])) {
			if ($info = $this->fileInfo()) {
				$attr['width'] = $info['AbsWidth'];
				$attr['height'] = $info['AbsHeight'];
			}				
		}
		return MediaObject::getDocBook($role, $attr);
	}
	function IFrameObject ($pagename, $fname, $attr) {
		MediaObject::MediaObject($pagename, $fname, $attr);
	}