Exemple #1
0
 public function getFileUrl()
 {
     $pos = stripos($this->url, 'http://');
     if ($pos === 0) {
         return $this->url;
     } elseif ($pos === false) {
         return fbu($this->url);
     } else {
         return '';
     }
 }
 private function uploadFile(CUploadedFile $upload, $fileType = UPLOAD_TYPE_UNKNOWN, $additional = 'files')
 {
     $filename = BetaBase::uploadFile($upload, $additional);
     if ($filename === false || !$this->afterUploaded($upload, $filename['url'], $fileType)) {
         $data = array('error' => 1, 'message' => t('upload_file_error'));
     } else {
         $data = array('error' => 0, 'url' => fbu($filename['url']));
     }
     echo CJSON::encode($data);
     exit(0);
 }
Exemple #3
0
 public function getThumbnailUrl()
 {
     $thumbnail = $this->thumbnail;
     if (empty($thumbnail)) {
         return '';
     }
     $pos = stripos($thumbnail, 'http://');
     if ($pos === 0) {
         $url = $thumbnail;
     } elseif ($pos === false) {
         $url = fbu($thumbnail);
     } else {
         $url = '';
     }
     return $url;
 }
Exemple #4
0
 public function getIconUrl()
 {
     if (empty($this->icon)) {
         return '';
     }
     $pos = stripos($this->icon, 'http://');
     if ($pos === false) {
         $url = fbu($this->icon);
     } elseif ($pos === 0) {
         $url = $this->icon;
     } else {
         $url = '';
     }
     return $url;
 }