Changeset 936 for pro-violet-viettel
- Timestamp:
- Jul 8, 2015 5:22:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php
r934 r936 151 151 $res = TblspaceresourcePeer::doSelectOne($c); 152 152 153 $thumbnailUrl = file_exists("previews/$userId/" . $tblfile->getFileId() . "/0.png") ? "http://".$_SERVER['HTTP_HOST']."/previews/$userId/" . $tblfile->getFileId() . "/0.png" : ''; 153 $thumbnail = file_exists("previews/$userId/" . $tblfile->getFileId() . "/0.png") ? "http://".$_SERVER['HTTP_HOST']."/previews/$userId/" . $tblfile->getFileId() . "/0.png" : ''; 154 155 $ext = strtolower($tblfile->getFileType()); 156 $filePath=""; 157 $thumbnail=""; 158 if (in_array($ext, array("jpg","png","jpeg","gif",""))) 159 { 160 $names = explode(".", $name); 161 $filePath = $tblres->getFullFilename(); 162 $filePath = str_replace($_SERVER['DOCUMENT_ROOT'], '', $filePath); 163 $thumbnail = str_replace($name, "", $fileName). $names[0].'_thumb.'.$ext; 164 $thumbnail= ltrim ($thumbnail, '/'); 165 } 154 166 155 167 $newFile = new stdClass(); … … 159 171 $newFile->minetype = $currentFile->getFileType(); 160 172 $newFile->fileurl = str_replace($_SERVER['DOCUMENT_ROOT'], "http://".$_SERVER['HTTP_HOST'], $res->getFullFilename()); 161 $newFile->thumbnail = $thumbnail Url;173 $newFile->thumbnail = $thumbnail; 162 174 $newFile->size = $res->getResFilesize(); 163 175 … … 455 467 $fileErrorNum = $this->getRequest()->getFileError($file); 456 468 if ($fileErrorNum || $fileError) 457 return false; 469 return false; 458 470 459 471 $tempFile = violetUtil::getTempPath() . $userId . '_' . $fileName; … … 474 486 475 487 $ext = pathinfo($fileUrl, PATHINFO_EXTENSION); 476 $ext = strtolower($ext); 488 $ext = strtolower($ext); 477 489 $thumbnail=""; 478 490 if (in_array($ext, array("ppt", "xls", "doc", "pdf", "docx", "pptx", "xlsx"))) {
Note: See TracChangeset
for help on using the changeset viewer.