Ignore:
Timestamp:
12/10/09 15:26:19 (14 years ago)
Author:
amuller
Message:

Ticket #597 - Melhorias no modulo gerenciador de arquivos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/inc/upload.php

    r1745 r1804  
    3131        if ($return == 1) 
    3232        { 
    33                 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('One of the files sent was considered infected'); 
     33                $_SESSION['response'] = serialize(array(0 => lang('Error:').lang('One of the files sent was considered infected'))); 
    3434                return; 
    3535        } 
     
    4141                if($badchar = $bo->bad_chars($_FILES['upload_file']['name'][$i], True, True)) 
    4242                { 
    43                         $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('File names cannot contain "%1"', $badchar); 
     43                        $return[] = lang('Error:').lang('File names cannot contain "%1"', $badchar); 
    4444                        continue; 
    4545                } 
     
    5959                        if($fileinfo['mime_type'] == 'Directory') 
    6060                        { 
    61                                 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']); 
     61                                $return[] = lang('Error:').lang('Cannot replace %1 because it is a directory', $fileinfo['name']); 
    6262                                continue; 
    6363                        } 
     
    6666                if ($_FILES['upload_file']['size'][$i] > ($upload_max_size*1024*1024)) 
    6767                { 
    68                         $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size); 
     68                        $return[] = lang('The size of %1 has exceded the limit: %2', $_FILES['upload_file']['name'][$i], $upload_max_size); 
    6969                        continue; 
    7070                } 
     
    9494                                ); 
    9595                                $bo->vfs->cp($tmp_arr); 
    96  
    97                                 $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created new %1', $_FILES['upload_file']['name'][$i])."\n"; 
    9896                        } 
    9997                        else 
     
    114112                                )); 
    115113                                else{ 
    116                                         $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Error:').lang('Your quota has exceeded the limit'); 
     114                                        $return[] = lang('Error:').lang('Your quota has exceeded the limit'); 
    117115                                        return false; 
    118116                                } 
    119117 
    120                                  $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($_FILES['upload_file']['size'][$i]))."\n"; 
    121118                        } 
    122119                } 
     
    137134                        )); 
    138135 
    139                          $_SESSION['phpgw_info']['filemanager']['user']['messages'][] = lang('Created %1,%2', $_FILES['upload_file']['name'][$i], $bo->borkb($file_size[$i]))."\n"; 
    140  
    141136                } 
    142137        } 
     138        if (count($return) > 0) 
     139                $_SESSION['response'] = serialize($return); 
     140        else 
     141                 $_SESSION['response'] = serialize( array( 0 => 'Ok' ) ); 
    143142?> 
Note: See TracChangeset for help on using the changeset viewer.