Changeset 1889


Ignore:
Timestamp:
12/23/09 09:51:15 (14 years ago)
Author:
amuller
Message:

Ticket #597 - Melhoria do FM. melhorias na interface, melhoria na cópia, ao mover e etc...

Location:
sandbox/filemanager
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/class.uifilemanager.inc.php

    r1880 r1889  
    477477                        } 
    478478 
    479                         # main action switch 
    480                         // FIXME this will become a switch 
    481479                        if($this->newfile_x && $this->newfile_or_dir) // create new textfile 
    482480                        { 
    483481                                $this->createfile(); 
    484                         } 
    485                         elseif($this->copy_to_x) 
    486                         { 
    487                                 $this->copyTo(); 
    488                         } 
    489                         elseif($this->move_to_x) 
    490                         { 
    491                                 $this->moveTo(); 
    492482                        } 
    493483                        elseif($this->edit_cancel_x) 
     
    752742                        // end file count 
    753743                } 
    754  
    755                 # Handle Moving Files and Directories 
    756                 function moveTo() 
    757                 { 
    758                         if(!$this->to) 
    759                         { 
    760                                 $this->messages[] = lang('Error:').lang('Could not move file because no destination directory is given ', $this->disppath.'/'.$file); 
    761  
    762                         } 
    763                         else 
    764                         { 
    765                                 $this->to = $this->bo->fakebase.'/'.$this->to; 
    766                                 while(list($num, $file) = each($this->fileman)) 
    767                                 { 
    768                                         if($this->bo->vfs->mv(array( 
    769                                                 'from'  => $this->from . '/' . $file, 
    770                                                 'to'    => $this->to . '/' . $file, 
    771                                                 'relatives'     => array(RELATIVE_NONE, RELATIVE_NONE) 
    772                                         ))) 
    773                                         { 
    774                                                 $moved++; 
    775                                                 $this->messages[0]=lang('Files moved to %1 successfuly',$this->to); 
    776                                         } 
    777                                         else 
    778                                         { 
    779                                                 $this->messages[] = lang('Error:').lang('Could not move %1 to %2', $file, $this->to); 
    780                                         } 
    781                                 } 
    782                         } 
    783  
    784                         if($moved) 
    785                         { 
    786                                 $x=0; 
    787                         } 
    788  
    789                         $this->readFilesInfo(); 
    790                         $this->filelisting(); 
    791                 } 
    792  
    793                 // Handle Copying of Files and Directories 
    794                 function copyTo() 
    795                 { 
    796                         if(!$this->to) 
    797                         { 
    798                                 $this->messages[] = lang('Error:').lang('Could not copy file because no destination directory is given '); 
    799  
    800                         } 
    801                         else 
    802                         { 
    803                                 $this->to = $this->bo->fakebase.'/'.$this->to; 
    804                                 while(list($num, $file) = each($this->fileman)) 
    805                                 { 
    806                                         if($this->bo->vfs->cp(array( 
    807                                                 'from'  => $this->from . '/' . $file, 
    808                                                 'to'    => $this->to . '/' . $file, 
    809                                                 'relatives'     => array(RELATIVE_NONE, RELATIVE_NONE) 
    810                                         ))) 
    811                                         { 
    812                                                 $copied++; 
    813                                                 $this->messages[0] = lang('Files Copied to %1 successfuly', $this->to); 
    814                                         } 
    815                                         else 
    816                                         { 
    817                                                 $this->messages[] = lang('Error:').lang('Could not copy %1',$file); 
    818                                         } 
    819                                 } 
    820                         } 
    821                         if($copied) 
    822                          
    823                         { 
    824                                 $x=0; 
    825                         } 
    826  
    827                         $this->readFilesInfo(); 
    828                         $this->filelisting(); 
    829                 } 
    830  
    831744                function removedir() 
    832745                { 
  • sandbox/filemanager/inc/class.vfs_functions.inc.php

    r1880 r1889  
    2828                        'archive'=>True, 
    2929                        'unarchive'=>True, 
     30                        'copyto'=>True, 
     31                        'moveto'=>True, 
    3032                        'summary' => True 
    3133                ); 
     
    345347                                } 
    346348                } 
     349                # Handle Moving Files and Directories 
     350                function moveto() 
     351                { 
     352                        if(!$this->to) 
     353                        { 
     354                                echo "NODIR|"; 
     355                                return; 
     356                        } 
     357                        else 
     358                        { 
     359                                $this->from = base64_decode($this->from); 
     360                                while(list($num, $file) = each($this->fileman)) 
     361                                { 
     362                                        if($this->bo->vfs->mv(array( 
     363                                                'from'  => $this->from . '/' . $file, 
     364                                                'to'    => $this->to . '/' . $file, 
     365                                                'relatives'     => array(RELATIVE_NONE, RELATIVE_NONE) 
     366                                        ))) 
     367                                                $moved++; 
     368                                        else 
     369                                                $error++; 
     370                                } 
     371                        } 
     372                        if($error > 0){ 
     373                                echo "SOMEERROR|".$error; 
     374                                return; 
     375                        } 
     376                        if($moved > 0) 
     377                                echo "MOVED|".$moved; 
     378                } 
     379 
     380                // Handle Copying of Files and Directories 
     381                function copyto() 
     382                { 
     383                        if(!$this->to) 
     384                        { 
     385                                echo "NODIR|"; 
     386                                return; 
     387                        } 
     388                        else 
     389                        { 
     390                                $this->from = base64_decode($this->from); 
     391                                while(list($num, $file) = each($this->fileman)) 
     392                                { 
     393                                        if($this->bo->vfs->cp(array( 
     394                                                'from'  => $this->from . '/' . $file, 
     395                                                'to'    => $this->to . '/' . $file, 
     396                                                'relatives'     => array(RELATIVE_NONE, RELATIVE_NONE) 
     397                                        ))) 
     398                                                $copied++; 
     399                                        else 
     400                                                $error++; 
     401                                } 
     402                        } 
     403                        if($error > 0){ 
     404                                echo "SOMEERROR|".$error; 
     405                                return; 
     406                        } 
     407                        if($copied > 0) 
     408                                echo "COPIED|".$copied; 
     409                } 
     410 
    347411                # Handle Renaming Files and Directories 
    348412                function rename() 
  • sandbox/filemanager/js/common_functions.js

    r1886 r1889  
    8585                        return null; 
    8686                ret = ""; 
    87                 for ( var i=0;i < data.length; i++ ) 
     87                for ( var i=0;(i < data.length && data.charCodeAt(i) > 31); i++ ) 
    8888                { 
    8989                        ret += String.fromCharCode(data.charCodeAt(i) ^ sec_key.charCodeAt(i)); 
  • sandbox/filemanager/js/draw_api.js

    r1888 r1889  
    523523                        } 
    524524                        var elements = new Array(); 
    525                         inputEl = document.getElementById('content_folders'); 
    526                         for(i=0; i< inputEl.childNodes.length; i++) 
     525                        for(i=0; i< folders.length; i++) 
    527526                        { 
    528                                 if (inputEl.childNodes[i].nodeName != 'SPAN') 
    529                                         continue; 
    530527                                elements[i] = new Array(); 
    531                                 elements[i]['text']=inputEl.childNodes[i].innerHTML; 
     528                                elements[i]['text']=folders[i]; 
    532529                                address = document.location.toString(); 
    533530                                address = address.split("&"); 
    534                                 elements[i]['url'] = address[0]+ 
    535                                         "&"+escape(arg)+".x=10"+ 
    536                                         "&from="+base64_encode(currentPath)+ 
    537                                         "&to="+base64_encode(inputEl.childNodes[i].innerHTML)+ 
    538                                         filesUrl; 
    539  
     531                                elements[i]['url'] = "javascript:"+escape(arg)+"('"+folders[i]+"','"+filesUrl+"')"; 
    540532                        } 
    541533                        draw_menu(arg,elements); 
     
    586578        cExecute('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 
    587579} 
     580function move_to(to,filesUrl){ 
     581        cExecute('./index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto); 
     582} 
     583function copy_to(to,filesUrl){ 
     584        cExecute('./index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto); 
     585} 
    588586 
    589587function draw_card(filename){ 
  • sandbox/filemanager/js/handler.js

    r1888 r1889  
    145145        folders_tree.getNodeById(currentPath)._select(); 
    146146} 
     147handler.prototype.copyto = function (data) { 
     148        returnVal = data.split('|'); 
     149        if (returnVal[0] == 'NODIR') 
     150                write_error(get_lang('Could not copy file because no destination directory is given')); 
     151        else if(returnVal[0] == 'SOMEERROR'){ 
     152                write_error(get_lang('Could not copy %1 file(s)',returnVal[1])); 
     153        } 
     154        else  if(returnVal[0] == 'COPIED'){ 
     155                if (returnVal[1] == 1) 
     156                        write_msg(get_lang('File copied successfuly')); 
     157                else 
     158                        write_msg(get_lang('%1 files copied successfuly', returnVal[1])); 
     159        } 
     160} 
     161handler.prototype.moveto = function (data) { 
     162        returnVal = data.split('|'); 
     163        if (returnVal[0] == 'NODIR') 
     164                write_error(get_lang('Could not copy file because no destination directory is given')); 
     165        else if(returnVal[0] == 'SOMEERROR'){ 
     166                write_error(get_lang('Could not move %1 file(s)',returnVal[1])); 
     167        } 
     168        else  if(returnVal[0] == 'MOVED'){ 
     169                if (returnVal[1] == 1) 
     170                        write_msg(get_lang('File moved successfuly')); 
     171                else 
     172                        write_msg(get_lang('%1 files moved successfuly', returnVal[1])); 
     173        } 
     174        handler.refreshDir(); 
     175} 
    147176handler.prototype.refreshDir = function (data) { 
    148177        cExecute('./index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list); 
  • sandbox/filemanager/setup/phpgw_pt-br.lang

    r1888 r1889  
    88comment filemanager     pt-br   Comentário 
    99comments cannot contain "%1"    filemanager     pt-br   Comentários não podem conter "%1" 
    10 Files Copied to %1 successfuly  filemanager     pt-br   Arquivos copiado para %1 com sucesso 
     10%1 files copied successfuly     filemanager     pt-br   %1 arquivos foram copiados com sucesso 
     11File copied successfuly filemanager     pt-br   O arquivo foi copiado com sucesso 
    1112copy to filemanager     pt-br   Copiar Para 
    1213copy to:        filemanager     pt-br   Copiar para: 
    13 could not copy %1       filemanager     pt-br   Não foi possível copiar %1 
     14could not copy %1 files filemanager     pt-br   Não foi possível copiar %1 arquivos 
    1415could not copy file because no destination directory is given   filemanager     pt-br   Não foi possível copiar o arquivo porque não se definiu um diretório de destino 
    1516could not create %1     filemanager     pt-br   Não foi possível criar %1 
    1617could not create directory %1   filemanager     pt-br   Não foi possível criar a pasta %1 
    1718could not delete %1     filemanager     pt-br   Não foi possível remover %1 
    18 could not move %1 to %2 filemanager     pt-br   Não foi possível mover %1 para %2 
     19could not move %1 file(s)       filemanager     pt-br   Não foi possível mover %1 arquivo(s) 
    1920Select a folder filemanager     pt-br   Selecione uma pasta 
    2021could not move file because no destination directory is given   filemanager     pt-br   Não foi possível mover o arquivo porque não se definiu um diretório de destino 
     
    9394move to filemanager     pt-br   Mover Para 
    9495move to:        filemanager     pt-br   Mover para: 
    95 Files moved to %1 successfuly   filemanager     pt-br   Arquivos movidos para %1 com sucesso 
     96%1 files moved successfuly      filemanager     pt-br   %1 arquivos movidos com sucesso 
     97File moved successfuly  filemanager     pt-br   Arquivo movido com sucesso 
    9698Archive filemanager     pt-br   Arquivar 
    9799Unarchive       filemanager     pt-br   Desarquivar 
Note: See TracChangeset for help on using the changeset viewer.