Ignore:
Timestamp:
11/23/09 10:58:52 (15 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias no módulo gerenciados de arquivos

Location:
sandbox/filemanager/inc
Files:
2 edited

Legend:

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

    r1693 r1694  
    5454                var $current_config; 
    5555                var $goto_x; 
    56                 var $todir; 
     56                var $to; 
    5757                var $changedir; // for switching dir. 
    5858                var $cdtodir; // for switching dir. 
     
    7979                var $file; // FIXME WHERE IS THIS FILLED? 
    8080                var $sortby; 
    81                 var $messages = array(); 
     81                var $messages; 
    8282                var $show_upload_boxes; 
    8383 
     
    8686                function uifilemanager() 
    8787                { 
    88                         //                      error_reporting(8); 
     88                        $this->messages = &$_SESSION['phpgw_info']['filemanager']['user']['messages']; 
     89 
    8990                        $GLOBALS['phpgw']->browser = CreateObject('phpgwapi.browser'); 
    9091 
     
    124125                                'sortby'        => array('sortby' => ''), 
    125126                                'messages'      => array('messages'     => ''), 
    126                                 'show_upload_boxes'     => array('show_upload_boxes' => '') 
     127                                'show_upload_boxes'     => array('show_upload_boxes' => ''), 
     128                                'to' => array('to' => '') 
     129 
    127130                        ); 
    128131 
     
    591594                                        foreach($this->messages as $msg) 
    592595                                        { 
    593                                                 $messages.='<p>'.$msg.'</p>'; 
    594                                         } 
    595                                 } 
    596  
     596                                                $messages.='<span>'.$msg.'</span>'; 
     597                                        } 
     598                                } 
     599                                $this->messages = NULL; 
     600                                 
    597601                                $vars[messages]=$messages; 
    598602 
     
    696700                                                } 
    697701                                                $link=$this->encode_href('/index.php','menuaction=filemanager.vfs_functions.setRestricted','file='.$files['name'].'&path='.$this->path); 
    698                                                 $minibar_data = '<img id="restrict_'.$files['name'].'" onClick="cExecute(\''.$link.'\',setRestricted)" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">'; 
     702                                                $minibar_data = '<img id="restrict_'.$files['name'].'" onClick="setRestricted(\''.$link.'\')" alt="'.lang("mark as restricted").'" title="'.lang("mark as restricted").'" src="'.$image.'">'; 
    699703                                        } 
    700704 
     
    11021106                function moveTo() 
    11031107                { 
    1104                         if(!$this->todir) 
     1108                        if(!$this->to) 
    11051109                        { 
    11061110                                $this->messages[] = lang('Error:').lang('Could not move file because no destination directory is given ', $this->disppath.'/'.$file); 
     
    11141118                                        if($this->bo->vfs->mv(array( 
    11151119                                                'from'  => $file, 
    1116                                                 'to'    => $this->todir . '/' . $file, 
     1120                                                'to'    => $this->to . '/' . $file, 
    11171121                                                'relatives'     => array(RELATIVE_ALL, RELATIVE_NONE) 
    11181122                                        ))) 
    11191123                                        { 
    11201124                                                $moved++; 
    1121                                                 $this->messages[]=lang('Moved %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
     1125                                                $this->messages[]=lang('Moved %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 
    11221126                                        } 
    11231127                                        else 
    11241128                                        { 
    1125                                                 $this->messages[] = lang('Error:').lang('Could not move %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
     1129                                                $this->messages[] = lang('Error:').lang('Could not move %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 
    11261130                                        } 
    11271131                                } 
     
    11401144                function copyTo() 
    11411145                { 
    1142                         if(!$this->todir) 
     1146                        if(!$this->to) 
    11431147                        { 
    11441148                                $this->messages[] = lang('Error:').lang('Could not copy file because no destination directory is given ', $this->disppath.'/'.$file); 
     
    11511155                                        if($this->bo->vfs->cp(array( 
    11521156                                                'from'  => $file, 
    1153                                                 'to'    => $this->todir . '/' . $file, 
     1157                                                'to'    => $this->to . '/' . $file, 
    11541158                                                'relatives'     => array(RELATIVE_ALL, RELATIVE_NONE) 
    11551159                                        ))) 
    11561160                                        { 
    11571161                                                $copied++; 
    1158                                                 $this->messages[] = lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
     1162                                                $this->messages[] = lang('Copied %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 
    11591163                                        } 
    11601164                                        else 
    11611165                                        { 
    1162                                                 $this->messages[] = lang('Error:').lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->todir.'/'.$file); 
     1166                                                $this->messages[] = lang('Error:').lang('Could not copy %1 to %2', $this->disppath.'/'.$file, $this->to.'/'.$file); 
    11631167                                        } 
    11641168                                } 
     
    15311535                                        return; 
    15321536                                } 
    1533                                 $_SESSION['debug'][] = $ls_array; 
    15341537                                if($ls_array[0]['mime_type']) 
    15351538                                { 
  • sandbox/filemanager/inc/upload.php

    r1693 r1694  
    2626                if($badchar = $bo->bad_chars($_FILES['upload_file']['name'][$i], True, True)) 
    2727                { 
    28                         $_SESSION['response'] = lang('Error:').lang('File names cannot contain "%1"', $badchar); 
    29                         return; 
     28                        $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('File names cannot contain "%1"', $badchar); 
     29                        continue; 
    3030                } 
    3131 
     
    4444                        if($fileinfo['mime_type'] == 'Directory') 
    4545                        { 
    46                                 $_SESSION['response'] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']); 
    47                                 return; 
     46                                $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']); 
     47                                continue; 
    4848                        } 
    4949                } 
     
    5151                if ($_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024)) 
    5252                { 
    53                         $_SESSION['response'] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size); 
    54                         return; 
     53                        $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size); 
     54                        continue; 
    5555                } 
    5656                else if(strlen($current_config['filemanager_antivirus_command']) > 0) 
     
    6060                        if ($return == 1) 
    6161                        { 
    62                                  $_SESSION['response'] = lang('Error:').lang('The file %1 sent was considered infected',$_FILES['upload_file']['name'][$i]); 
    63                                 return; 
     62                                $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('The file %1 sent was considered infected',$_FILES['upload_file']['name'][$i]); 
     63                                continue; 
    6464                        } 
    6565                } 
     
    9090                                $bo->vfs->cp($tmp_arr); 
    9191 
    92                                  $_SESSION['response'] .= lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n"; 
     92                                $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n"; 
    9393                        } 
    9494                        else 
     
    110110                                )); 
    111111 
    112                                  $_SESSION['response'] .= lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i])."\n"; 
     112                                 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $_FILES['upload_file']['size'][$i])."\n"; 
    113113                        } 
    114114                } 
     
    129129                        )); 
    130130 
    131                          $_SESSION['response'] .= lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $file_size[$i])."\n"; 
     131                         $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $file_size[$i])."\n"; 
     132 
    132133                } 
    133134        } 
Note: See TracChangeset for help on using the changeset viewer.