Changeset 925
- Timestamp:
- May 15, 2015 5:02:11 PM (10 years ago)
- Location:
- pro-violet-viettel/www/deploy/api/platform/modules/space/actions
- Files:
-
- 1 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php
r924 r925 220 220 $file_path= str_replace("http://" . $_SERVER['SERVER_NAME'], $_SERVER['DOCUMENT_ROOT'], $fileurl); 221 221 $file_path= str_replace(pathinfo($file_path, PATHINFO_EXTENSION), "png", $file_path); 222 file_put_contents($file_path, $image); 222 file_put_contents($file_path, $image); 223 223 $thumbnail=violetUtil::createThumb($file_path); 224 224 } … … 228 228 } 229 229 } 230 return $thumbnail; 230 return $thumbnail; 231 231 } 232 232 … … 252 252 $data['fileid'] = $fileId; 253 253 $data['folder'] = "previews/" . $userId . "/" . $fileId; 254 $data['total'] = $count; 254 $data['total'] = $count; 255 255 echo json_encode($data); 256 256 return sfView::NONE; … … 440 440 $userId = $this->getRequestParameter('userid'); 441 441 $catId = $this->getRequestParameter('dir'); 442 if ($catId==0) {$catId = -1;} 442 if ($catId==0) {$catId = -1;} 443 443 $response = $this->getRequestParameter('response'); 444 444 … … 478 478 if (in_array($ext, array("ppt", "xls", "doc", "pdf", "docx", "pptx", "xlsx"))) { 479 479 $thumbnail=$this->createPreview($fileUrl, $userId, $tblfile->getFileId()); 480 } 480 } 481 481 482 482 if ($response == 1) { … … 489 489 } 490 490 } 491 491 492 492 $aryFiles = array( 493 493 0 => array('id' => $tblfile->getFileId(), 'thumbnail' => $thumbnail, 'fileurl' => $fileUrl, 'name' => $fileName, 'minetype' => $ext, 'size' => $fileSize, 'parentID' => $catId), … … 498 498 echo $jsonData; 499 499 } 500 500 501 501 return sfView::NONE; 502 502 } … … 578 578 579 579 $c = new Criteria(); 580 $updateable = true; 581 $affectedRows = 0; 580 582 581 583 if ($type == 'directory') { … … 586 588 if (!is_null($category)) { 587 589 $category->setCatName($newName); 588 $category->save(); 590 $affectedRows = $category->save(); 591 } 592 else { 593 $updateable = false; 589 594 } 590 595 } … … 597 602 $file->setFileId($id); 598 603 $file->setFileName($newName); 599 $file->save(); 604 $affectedRows = $file->save(); 605 } 606 else { 607 $updateable = false; 600 608 } 601 609 } 602 610 611 $this->item = new stdClass(); 612 $this->item->id = $id; 613 $this->item->name = $name; 614 $this->item->type = $type; 615 $this->item->parentId = $parentId; 616 617 if ($updateable == true && (int)$affectedRows > 0) { 618 $this->item->name = $newName; 619 $this->errCode = ''; 620 $this->errMsg = ''; 621 } 622 else { 623 $this->errCode = '-1'; 624 $this->errMsg = 'Update is not success!'; 625 } 603 626 } 604 627 }
Note: See TracChangeset
for help on using the changeset viewer.