Changeset 121
- Timestamp:
- Sep 12, 2014 7:24:12 PM (11 years ago)
- Location:
- pro-bachkim-filespace/sourcecode
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-bachkim-filespace/sourcecode/application/libraries/vservices.php
r66 r121 52 52 $this->_curlObj->post($aryParams); 53 53 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 76 56 public function __destruct() { 77 57 -
pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php
r70 r121 144 144 $data = $this->input->post('data',TRUE); 145 145 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 146 152 $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']);; 150 155 echo json_encode($aryData); 151 152 156 } 153 157 … … 157 161 } 158 162 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 */ -
pro-bachkim-filespace/sourcecode/assets/css/space/vsgrid.css
r16 r121 183 183 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-excel, 184 184 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-presentation, 185 DIV.vsgrid DIV.vscell DIV.selector DIV.icon- audio,185 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-mp3, 186 186 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-video, 187 DIV.vsgrid DIV.vscell DIV.selector DIV.icon- compressed,187 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-zip, 188 188 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-pdf{ 189 189 display: block; -
pro-bachkim-filespace/sourcecode/assets/js/grid.js
r70 r121 142 142 var nodeID = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="id"]').val(); 143 143 var nodeType = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val(); 144 $(node).remove(); 144 $(node).remove(); 145 145 } 146 146 -
pro-bachkim-filespace/sourcecode/assets/js/manager.js
r70 r121 51 51 if( p.callbackFail == undefined ) p.callbackFail = null; 52 52 if( p.callbackAlways == undefined ) p.callbackAlways = null; 53 if( p.parseData == undefined ) p.parseData = null; 54 if( p.self == undefined ) p.self = this; 53 55 54 56 if (p.script != null && (o.datasource == 'ajax' || isDev)) { … … 56 58 if (data) { 57 59 parseData = $.parseJSON(data); 60 p.parseData = parseData; 58 61 } 59 62 … … 66 69 } 67 70 68 }).done(function() {if (p.callbackDone != null)p.callbackDone( this);}).fail(function() {if (p.callbackFail != null)p.callbackFail(this);}).always(function() {if (p.callbackAlways != null)p.callbackAlways(this);});71 }).done(function() {if (p.callbackDone != null)p.callbackDone(p.parseData);}).fail(function() {if (p.callbackFail != null)p.callbackFail(this);}).always(function() {if (p.callbackAlways != null)p.callbackAlways(this);}); 69 72 } 70 73 else if (o.datasource == 'json'){ … … 120 123 aryChildFiles = searchItemsByParent(dirID, 'file'); 121 124 125 node.id = dir.id; 126 node.name = dir.name; 127 node.type = 'directory'; 128 122 129 $(aryChildDirs).each(function (index) { 123 aryChildIDs[index] = this.id; 130 var id = this.id; 131 var name = this.name; 132 var type = 'directory'; 133 var cDir = {id:id, name:name, type:type, childs:null}; 134 aryChildIDs[index] = cDir; 124 135 }); 125 126 if (node.id == undefined) node.id = dirID;127 136 128 137 if ($(aryChildFiles).length > 0 ) { 129 138 if (node.files == undefined) node.files = []; 130 139 $(aryChildFiles).each(function (index) { 131 node.files[index] = this.id; 140 var id = this.id; 141 var name = this.name; 142 var type = 'file'; 143 var cFile = {id:id, name:name, type:type}; 144 node.files[index] = cFile; 132 145 }); 133 146 } … … 137 150 $(aryChildIDs).each(function (index) { 138 151 node.childs[index] = new Object; 139 buildTreeFromParent(aryChildIDs[index] , node.childs[index]);152 buildTreeFromParent(aryChildIDs[index].id, node.childs[index]); 140 153 }); 141 154 } … … 388 401 $(oClipBoard.items).each(function (index) { 389 402 var node = new Object; 390 buildTreeFromParent(this.id, node); 403 if (this.type == 'directory') 404 buildTreeFromParent(this.id, node); 405 else { 406 node.id = this.id; 407 node.type = 'file'; 408 } 409 391 410 items[index] = node; 392 411 }); … … 483 502 callbackSuccess:function(parseData){ 484 503 if($(parseData.DIRECTORIES).length > 0) { 485 for(var i = 0; i < $(parseData.DIRECTORIES).length; i++) {486 o.oTree.deletion( $(parseData.DIRECTORIES).get(i));487 o.oGrid.deletion( $(parseData.DIRECTORIES).get(i), 'directory');488 } 504 $(parseData.DIRECTORIES).each (function (index) { 505 o.oTree.deletion(this); 506 o.oGrid.deletion(this, 'directory'); 507 }); 489 508 } 490 509 491 510 if($(parseData.FILES).length > 0) { 492 for(var i = 0; i < $(parseData.FILES).length; i++) { 493 var id = $(parseData.FILES).get(i); 494 var file = o.data.FILES[searchItemByID(id)]; 495 o.oGrid.deletion(file.id, file.minetype); 496 } 511 $(parseData.FILES).each (function (index) { 512 var file = o.data.FILES[searchItemByID(this, 'file')]; 513 o.oGrid.deletion(this, file.minetype); 514 }); 497 515 } 498 516 }, 517 callbackDone: function (obj) { 518 var dirs = []; 519 var files = []; 520 if($(parseData.DIRECTORIES).length > 0) { 521 $(o.data.DIRECTORIES).each(function (index){ 522 var found = $.inArray(this.id, parseData.DIRECTORIES); 523 if(found == -1) { 524 dirs[$(dirs).length] = this; 525 } 526 }); 527 528 o.data.DIRECTORIES = dirs; 529 } 530 531 if($(parseData.FILES).length > 0) { 532 $(o.data.FILES).each(function (index){ 533 var found = $.inArray(this.id, parseData.FILES); 534 if(found == -1) { 535 files[$(dirs).length] = this; 536 } 537 }) 538 539 o.data.FILES = files; 540 } 541 542 o.oTree.setData (o.data.DIRECTORIES); 543 o.oGrid.setData (o.data); 499 544 }, 500 545 callbackFail: function(){}
Note: See TracChangeset
for help on using the changeset viewer.