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/inc
Files:
2 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() 
Note: See TracChangeset for help on using the changeset viewer.