Changeset 121


Ignore:
Timestamp:
Sep 12, 2014 7:24:12 PM (11 years ago)
Author:
dungnv
Message:
 
Location:
pro-bachkim-filespace/sourcecode
Files:
5 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 */
  • pro-bachkim-filespace/sourcecode/assets/css/space/vsgrid.css

    r16 r121  
    183183DIV.vsgrid DIV.vscell DIV.selector DIV.icon-excel,
    184184DIV.vsgrid DIV.vscell DIV.selector DIV.icon-presentation,
    185 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-audio,
     185DIV.vsgrid DIV.vscell DIV.selector DIV.icon-mp3,
    186186DIV.vsgrid DIV.vscell DIV.selector DIV.icon-video,
    187 DIV.vsgrid DIV.vscell DIV.selector DIV.icon-compressed,
     187DIV.vsgrid DIV.vscell DIV.selector DIV.icon-zip,
    188188DIV.vsgrid DIV.vscell DIV.selector DIV.icon-pdf{
    189189        display: block;
  • pro-bachkim-filespace/sourcecode/assets/js/grid.js

    r70 r121  
    142142                                var nodeID = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="id"]').val();
    143143                                var nodeType = $(node).find('> DIV[class^="file-name"] > INPUT[type="hidden"][class^="type"]').val();
    144                                 $(node).remove();                               
     144                                $(node).remove();
    145145                        }
    146146
  • pro-bachkim-filespace/sourcecode/assets/js/manager.js

    r70 r121  
    5151                                if( p.callbackFail == undefined ) p.callbackFail = null;
    5252                                if( p.callbackAlways == undefined ) p.callbackAlways = null;
     53                                if( p.parseData == undefined ) p.parseData = null;
     54                                if( p.self == undefined ) p.self = this;
    5355
    5456                                if (p.script != null && (o.datasource == 'ajax' || isDev)) {
     
    5658                                                if (data) {
    5759                                                        parseData = $.parseJSON(data);
     60                                                        p.parseData = parseData;
    5861                                                }
    5962
     
    6669                                                }
    6770
    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);});
    6972                                }
    7073                                else if (o.datasource == 'json'){
     
    120123                                aryChildFiles = searchItemsByParent(dirID, 'file');
    121124
     125                                node.id = dir.id;
     126                                node.name = dir.name;
     127                                node.type = 'directory';
     128
    122129                                $(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;
    124135                                });
    125 
    126                                 if (node.id == undefined) node.id = dirID;                             
    127136
    128137                                if ($(aryChildFiles).length > 0 ) {
    129138                                        if (node.files == undefined) node.files = [];
    130139                                        $(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;
    132145                                        });
    133146                                }                               
     
    137150                                        $(aryChildIDs).each(function (index) {
    138151                                                node.childs[index] = new Object;
    139                                                 buildTreeFromParent(aryChildIDs[index], node.childs[index]);
     152                                                buildTreeFromParent(aryChildIDs[index].id, node.childs[index]);
    140153                                        });
    141154                                }
     
    388401                                $(oClipBoard.items).each(function (index) {
    389402                                        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
    391410                                        items[index] = node;
    392411                                });
     
    483502                                                                                callbackSuccess:function(parseData){
    484503                                                                                        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                                                                                                });
    489508                                                                                        }
    490509
    491510                                                                                        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                                                                                                });     
    497515                                                                                        }
    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);
    499544                                                                                },
    500545                                                                                callbackFail: function(){}
Note: See TracChangeset for help on using the changeset viewer.