Changeset 70 for pro-bachkim-filespace/sourcecode/application/modules/ajax
- Timestamp:
- Sep 9, 2014 4:14:10 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php
r66 r70 85 85 $parentDir = $this->input->post('fparentid',TRUE); 86 86 $name = $this->input->post('fname',TRUE); 87 87 88 $xmlData = $this->vservices->actionExecute('mkdir',array('name' => $name, 'parent_id' => $parentDir == 0 ? -1:$parentDir)); 88 89 … … 90 91 $aryError = array('err' => $this->xml->status->_param['err'], 'errCode' => (int)$this->xml->status->_param['errCode']); 91 92 $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); */ 92 96 echo json_encode($aryData); 93 97 } … … 97 101 $xmlData = $this->vservices->actionExecute('deletemulti',array('delobj' => $delobj)); 98 102 $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 99 127 $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); 101 129 echo json_encode($aryData); 102 130 } … … 104 132 public function rename() { 105 133 $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 109 136 $aryData = array(); 110 137 $aryData['RESULT'] = $this->objDirectory->rename($id, $newName, $objectType);; 111 138 $aryData['UPDATED'] = array('id' => $id, 'name' => $newName, 'type' => $objectType); 112 139 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 113 152 } 114 153
Note: See TracChangeset
for help on using the changeset viewer.