Ignore:
Timestamp:
Sep 9, 2014 4:14:10 PM (11 years ago)
Author:
dungnv
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php

    r66 r70  
    8585                $parentDir =  $this->input->post('fparentid',TRUE);
    8686                $name =  $this->input->post('fname',TRUE);
     87               
    8788                $xmlData = $this->vservices->actionExecute('mkdir',array('name' => $name, 'parent_id' => $parentDir == 0 ? -1:$parentDir));
    8889               
     
    9091                $aryError = array('err' => $this->xml->status->_param['err'], 'errCode' => (int)$this->xml->status->_param['errCode']);
    9192                $aryData = array('id' => $this->xml->status->_param['id'], 'name' => $name, 'parentID' => $parentDir, 'ERROR' => $aryError);
     93               
     94                /* $aryError = array('err' => '', 'errCode' => 0);
     95                $aryData =  array('id' => rand(100, 1000), 'name' => $name, 'parentID' => $parentDir, 'ERROR' => $aryError); */
    9296                echo json_encode($aryData);
    9397        }
     
    97101                $xmlData = $this->vservices->actionExecute('deletemulti',array('delobj' => $delobj));
    98102                $this->xml->parse($xmlData);
     103                $aryFolders = array();
     104
     105                if (isset($this->xml->tree->folder)) {
     106                        if (is_array($this->xml->tree->folder)) {
     107                                foreach ($this->xml->tree->folder as $key => $folder) {                                 
     108                                        $aryFolders['DIRECTORIES'][] = $folder->_param['id'];
     109                                }
     110                        }
     111                        else {
     112                                $aryFolders['DIRECTORIES'][] = $this->xml->tree->folder->_param['id'];
     113                        }
     114                }
     115               
     116                if (isset($this->xml->tree->file)) {
     117                        if (is_array($this->xml->tree->file)) {
     118                                foreach ($this->xml->tree->file as $key => $file) {
     119                                        $aryFolders['FILES'][] = $file->_param['id'];
     120                                }
     121                        }
     122                        else {
     123                                $aryFolders['FILES'][] = $this->xml->tree->folder->_param['id'];
     124                        }
     125                }
     126               
    99127                $aryError = array('err' => $this->xml->tree->_param['err'], 'errCode' => (int)$this->xml->tree->_param['errCode']);
    100                 $aryData = array('ERROR' => $aryError);
     128                $aryData = array('DIRECTORIES' => isset($aryFolders['DIRECTORIES']) ? $aryFolders['DIRECTORIES'] : array(), 'FILES' => isset($aryFolders['FILES'])? $aryFolders['FILES'] : array() ,'ERROR' => $aryError);
    101129                echo json_encode($aryData);
    102130        }
     
    104132        public function rename() {
    105133                $id =  $this->input->post('id',TRUE);
    106                 $newName =  $this->input->post('newname',TRUE);
    107                 $objectType =  $this->input->post('objtype',TRUE);
    108 
     134                $data =  $this->input->post('data',TRUE);
     135               
    109136                $aryData = array();
    110137                $aryData['RESULT'] = $this->objDirectory->rename($id, $newName, $objectType);;
    111138                $aryData['UPDATED'] = array('id' => $id, 'name' => $newName, 'type' => $objectType);
    112139                echo json_encode($aryData);
     140        }
     141
     142        public function copy () {
     143                $destination =  $this->input->post('destination',TRUE);
     144                $data =  $this->input->post('data',TRUE);
     145               
     146                $aryData = array();
     147                $aryData['RESULT'] = json_decode($data);
     148                $aryError = array('err' => '', 'errCode' => 0);
     149                $aryData['ERROR'] = $aryError;
     150                echo json_encode($aryData);
     151
    113152        }
    114153       
Note: See TracChangeset for help on using the changeset viewer.