示例#1
0
 /**
  * Show a Twitpic-like response with the ID of the media file
  * and a (hopefully) shortened URL for it.
  *
  * @param MediaFile $upload  the uploaded file
  *
  * @return void
  */
 function showResponse(MediaFile $upload)
 {
     $this->initDocument();
     $this->elementStart('rsp', array('stat' => 'ok'));
     $this->element('mediaid', null, $upload->fileRecord->id);
     $this->element('mediaurl', null, $upload->shortUrl());
     $this->elementEnd('rsp');
     $this->endDocument();
 }
 /**
  * Show a Twitpic-like response with the ID of the media file
  * and a (hopefully) shortened URL for it.
  *
  * @param MediaFile $upload  the uploaded file
  *
  * @return void
  */
 function showResponse(MediaFile $upload)
 {
     $this->initDocument();
     $this->elementStart('rsp', array('stat' => 'ok', 'xmlns:atom' => Activity::ATOM));
     $this->element('mediaid', null, $upload->fileRecord->id);
     $this->element('mediaurl', null, $upload->shortUrl());
     $enclosure = $upload->fileRecord->getEnclosure();
     $this->element('atom:link', array('rel' => 'enclosure', 'href' => $enclosure->url, 'type' => $enclosure->mimetype));
     $this->elementEnd('rsp');
     $this->endDocument();
 }