Changeset 925


Ignore:
Timestamp:
May 15, 2015 5:02:11 PM (10 years ago)
Author:
dungnv
Message:
 
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  
    220220                    $file_path= str_replace("http://" . $_SERVER['SERVER_NAME'], $_SERVER['DOCUMENT_ROOT'], $fileurl);
    221221                    $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);
    223223                    $thumbnail=violetUtil::createThumb($file_path);
    224224                    }
     
    228228            }
    229229        }
    230         return $thumbnail; 
     230        return $thumbnail;
    231231    }
    232232
     
    252252        $data['fileid'] = $fileId;
    253253        $data['folder'] = "previews/" . $userId . "/" . $fileId;
    254         $data['total'] = $count; 
     254        $data['total'] = $count;
    255255        echo json_encode($data);
    256256        return sfView::NONE;
     
    440440        $userId = $this->getRequestParameter('userid');
    441441        $catId = $this->getRequestParameter('dir');
    442         if ($catId==0) {$catId = -1;} 
     442        if ($catId==0) {$catId = -1;}
    443443        $response = $this->getRequestParameter('response');
    444444
     
    478478        if (in_array($ext, array("ppt", "xls", "doc", "pdf", "docx", "pptx", "xlsx"))) {
    479479            $thumbnail=$this->createPreview($fileUrl, $userId, $tblfile->getFileId());
    480         } 
     480        }
    481481
    482482        if ($response == 1) {
     
    489489            }
    490490            }
    491            
     491
    492492            $aryFiles = array(
    493493                0 => array('id' => $tblfile->getFileId(), 'thumbnail' => $thumbnail, 'fileurl' => $fileUrl, 'name' => $fileName, 'minetype' => $ext, 'size' => $fileSize, 'parentID' => $catId),
     
    498498            echo $jsonData;
    499499        }
    500            
     500
    501501        return sfView::NONE;
    502502    }
     
    578578
    579579        $c = new Criteria();
     580        $updateable = true;
     581        $affectedRows = 0;
    580582
    581583        if ($type == 'directory') {
     
    586588                if (!is_null($category)) {
    587589                        $category->setCatName($newName);
    588                         $category->save();
     590                        $affectedRows = $category->save();
     591                }
     592                else {
     593                        $updateable = false;
    589594                }
    590595        }
     
    597602                        $file->setFileId($id);
    598603                        $file->setFileName($newName);
    599                         $file->save();
     604                        $affectedRows = $file->save();
     605                }
     606                else {
     607                        $updateable = false;
    600608                }
    601609        }
    602610
     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        }
    603626    }
    604627}
Note: See TracChangeset for help on using the changeset viewer.