Changeset 138
- Timestamp:
- Sep 19, 2014 4:18:09 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/api.violet.vn/www/apps/platform/modules/space/actions/actions.class.php
r137 r138 133 133 $tblfile->setFileType($currentFile->getFileType()); 134 134 $tblfile->setFileDate(date('Y-m-d H:i:s')); 135 $tblfile->save(); 135 $tblfile->save(); 136 136 $newFile->id = $tblfile->getFileId(); 137 137 $newFile->name = $fileName; … … 139 139 $newFile->minetype = $currentFile->getFileType(); 140 140 return $newFile; 141 } 142 143 private function changeParentDir ($item, $destination) { 144 if ($item->type == 'directory') { 145 $tblfile = TblspacefilePeer::retrieveByPk($item->id); 146 $tblfile->setFileCategory($destination); 147 $tblfile->save(); 148 } 149 else if ($item->type == 'file') { 150 $tblCategory = TblspacecategoryPeer::retrieveByPk($item->id); 151 $tblCategory->setCatParent($destination); 152 $tblCategory->save(); 153 } 154 155 $item->parentID = $destination; 156 return $item; 141 157 } 142 158 … … 282 298 public function executeCopy () { 283 299 $userId = $this->getRequestParameter('userid'); 284 $destination = $this->getRequestParameter('destination'); 300 $destination = $this->getRequestParameter('destination'); 301 $act = $this->getRequestParameter('act'); 285 302 $data = $this->getRequestParameter('data'); 286 303 $aryNewTree = array('DIRECTORIES' => array(),'FILES' => array(), ); … … 289 306 if (is_array($aryTreeObj)) { 290 307 foreach ($aryTreeObj as $key => $treeObj){; 291 if ($treeObj->type == 'directory') { 292 $this->CopySpaceDir($treeObj, $destination, $userId, $aryNewTree); 308 if ($act == 'copy') { 309 if ($treeObj->type == 'directory') { 310 $this->CopySpaceDir($treeObj, $destination, $userId, $aryNewTree); 311 } 312 else { 313 $aryNewTree['FILES'] = $this->CopySpaceFile($treeObj->id, $destination, $userId); 314 } 293 315 } 294 else { 295 $aryNewTree['FILES'] = $this->CopySpaceFile($treeObj->id, $destination, $userId); 316 else if ($act == 'move') { 317 $this->changeParentDir($treeObj, $destination); 318 if ($treeObj->type == 'directory') $aryNewTree['DIRECTORIES'][]; 319 if ($treeObj->type == 'file') $aryNewTree['FILES'][]; 296 320 } 297 321 }
Note: See TracChangeset
for help on using the changeset viewer.