Ignore:
Timestamp:
Sep 12, 2014 7:24:12 PM (11 years ago)
Author:
dungnv
Message:
 
Location:
pro-bachkim-filespace/sourcecode/application
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-bachkim-filespace/sourcecode/application/libraries/vservices.php

    r66 r121  
    5252                $this->_curlObj->post($aryParams);
    5353                return $this->_curlObj->execute();
    54         }
    55        
    56         public function createDir ($dirName, $parentId) {
    57                 $this->_curlObj->create($this->_apiUrl. 'space/mkdir');
    58                 $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
    59                 $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
    60                
    61                 $post = array('userid' => $this->_userId, 'parent_id' => $parentId, 'name' => $dirName);
    62                 $this->_curlObj->post($post);
    63                 return $this->_curlObj->execute();
    64         }
    65        
    66         public function deleteDir ($dirId) {
    67                 $this->_curlObj->create($this->_apiUrl. 'space/delete');
    68                 $this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
    69                 $this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
    70                
    71                 $post = array('userid' => $this->_userId, 'type' => 'folder', 'id' => $dirId);
    72                 $this->_curlObj->post($post);
    73                 return $this->_curlObj->execute();
    74         }
    75                
     54        }       
     55                       
    7656        public function __destruct() {
    7757               
  • pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php

    r70 r121  
    144144                $data =  $this->input->post('data',TRUE);
    145145               
     146                $xmlData = $this->vservices->actionExecute('copy',array('data' => $data, 'destination' => $destination == 0 ? -1:$destination));
     147                $this->xml->parse($xmlData);
     148               
     149                $aryNewDirs =   isset($this->xml->data->folderdata) ? json_decode($this->xml->data->folderdata->_value) : array();
     150                $aryNewFiles =  isset($this->xml->data->filedata) ? json_decode($this->xml->data->filedata->_value) : array();
     151               
    146152                $aryData = array();
    147                 $aryData['RESULT'] = json_decode($data);
    148                 $aryError = array('err' => '', 'errCode' => 0);
    149                 $aryData['ERROR'] = $aryError;
     153                $aryData['RESULT'] = array('DIRECTORIES' => $aryNewDirs, 'FILES' => $aryNewFiles);
     154                $aryData['ERROR'] = array('err' => $this->xml->data->_param['err'], 'errCode' => (int)$this->xml->data->_param['errCode']);;
    150155                echo json_encode($aryData);
    151 
    152156        }
    153157       
     
    157161}
    158162
    159 /* End of file directory.php */
    160 /* Location: ./application/modules/ajax/controllers/directory.php */
     163/* End of file privatecontent.php */
     164/* Location: ./application/modules/ajax/controllers/privatecontent.php */
Note: See TracChangeset for help on using the changeset viewer.