Changeset 3610


Ignore:
Timestamp:
12/20/10 17:42:25 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1395 - Padronizacao das janelas do filemanager com as do Expresso ( Envio de arquivo e mensagens ).

Location:
branches/2.2/filemanager
Files:
4 added
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/after_upload.php

    r3386 r3610  
    4141} 
    4242 
    43 echo "<script type='text/javascript'> 
    44         top.close_window(); 
    45         top.write_msg(top.get_lang('Uploaded files sucessfully')); 
    46         top.toolbar.control('reload'); 
    47         </script>"; 
     43echo "<script type='text/javascript' src='../js/after_upload.js'></script>"; 
    4844 
    4945?> 
  • branches/2.2/filemanager/inc/class.uifilemanager.inc.php

    r3591 r3610  
    831831                { 
    832832                        $response = $_SESSION['response']; 
    833                         $_SESSION['response'] = null; 
     833                         
     834                        unset($_SESSION['response']); 
     835                         
    834836                        echo $response; 
    835                         return; 
    836837                } 
    837838                 
    838839                function showUploadboxes() 
    839840                { 
    840                         $GLOBALS['phpgw_info']['flags'] = array 
    841                                 ( 
    842                                         'currentapp'    => 'filemanager', 
    843                                         'noheader'      => True, 
    844                                         'nonavbar' => True, 
    845                                         'nofooter'      => True, 
    846                                         'noappheader'   => True 
    847                                 ); 
    848                         $GLOBALS['phpgw']->common->phpgw_header(); 
    849  
    850                         $this->t->set_file(array('upload' => 'upload.tpl')); 
    851                         $this->t->set_block('upload','upload_header','upload_header'); 
    852                         $this->t->set_block('upload','row','row'); 
    853                         $this->t->set_block('upload','upload_footer','upload_footer'); 
    854  
    855                         if($this->path != '/' && $this->path != $this->bo->fakebase) 
    856                         { 
    857                                 $vars[max_size]=lang('Note: Uploaded is limited to %1MB',($this->current_config['filemanager_Max_file_size'])); 
    858                                 $vars[form_action]=$GLOBALS[phpgw]->link('/filemanager/inc/upload.php'); 
    859                                 //$vars[form_action]=$GLOBALS[phpgw]->link('/index.php','menuaction=filemanager.uifilemanager.index'); 
    860                                 $vars[path]=$this->path; 
    861                                 $vars[lang_file]=lang('File'); 
    862                                 $vars[lang_comment]=lang('Comment'); 
    863                                 $vars[lang_advanced_upload]=lang('Advanced Upload'); 
    864                                 $vars[num_upload_boxes]=1; 
    865                                 $this->t->set_var($vars); 
    866                                 $this->t->pparse('out','upload_header'); 
    867  
    868                                 $this->t->set_var('row_tr_color',$tr_color); 
    869                                 $this->t->parse('rows','row'); 
    870                                 $this->t->pparse('out','row'); 
    871  
    872                                 $vars[lang_upload]=lang('Upload files'); 
    873                                 $vars[change_upload_boxes].=lang('Show') . '&nbsp;'; 
    874                                 $this->t->set_var($vars); 
    875                                 $this->t->pparse('out','upload_footer'); 
    876                         } 
     841                        $var = array( 
     842                                                'change_upload_boxes'   => lang('Show'),                                 
     843                                                'form_action'                   => $GLOBALS[phpgw]->link('/filemanager/inc/upload.php'), 
     844                                                'lang_file'                             => lang('File'), 
     845                                                'lang_comment'                  => lang('Comment'), 
     846                                                'lang_advanced_upload'  => lang('Advanced Upload'), 
     847                                                'lang_upload'                   => lang('Upload files'), 
     848                                                'max_size'                              => lang('Note: Uploaded is limited to %1MB',( $this->current_config['filemanager_Max_file_size'])),                              
     849                                                'path'                                  => $this->path 
     850                                        ); 
     851                         
     852                        print( serialize($var) ); 
     853                         
    877854                } 
    878855 
  • branches/2.2/filemanager/inc/upload.php

    r3415 r3610  
    11<?php 
     2 
    23require_once '../../header.session.inc.php'; 
     4 
    35/* This single file is used to increase upload_max_filesize and post_max_size using .htaccess*/ 
    46if(!isset($GLOBALS['phpgw_info'])){ 
     
    1921$path = $_POST['path']; 
    2022$notifUser = $_POST['notifTo']; 
    21 $show_upload_boxes = count($_FILES['upload_file']['name'])-1; 
    22  
    23 function create_summaryImage($file){ 
     23$show_upload_boxes = count($_FILES['upload_file']['name']); 
     24$filesUpload = $_FILES['upload_file']; 
     25 
     26function create_summaryImage($file) 
     27{ 
    2428        list($width, $height,$image_type) = getimagesize($file); 
     29 
    2530        switch($image_type) 
    2631        { 
    27         case 1: 
    28                 $image_big = imagecreatefromgif($file); 
    29                 break; 
    30         case 2: 
    31                 $image_big = imagecreatefromjpeg($file); 
    32                 break; 
    33         case 3: 
    34                 $image_big = imagecreatefrompng($file); 
    35                 break; 
    36         default: 
    37                 return false; 
    38         } 
     32                case 1: 
     33                        $image_big = imagecreatefromgif($file); 
     34                        break; 
     35                case 2: 
     36                        $image_big = imagecreatefromjpeg($file); 
     37                        break; 
     38                case 3: 
     39                        $image_big = imagecreatefrompng($file); 
     40                        break; 
     41                default: 
     42                        return false; 
     43        } 
     44 
    3945        $max_resolution = 48; 
    40         if ($width > $height){ 
     46 
     47        if ($width > $height) 
     48        { 
    4149                $new_width = $max_resolution; 
    4250                $new_height = $height*($new_width/$width); 
    4351        } 
    44         else { 
     52        else  
     53        { 
    4554                $new_height = $max_resolution; 
    4655                $new_width = $width*($new_height/$height); 
    4756        } 
     57         
    4858        $image_new = imagecreatetruecolor($new_width, $new_height); 
    4959        imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height); 
     
    5969        $command = "nice -n19 ".$current_config['filemanager_antivirus_command']; 
    6070        for($i = 0; $i != $show_upload_boxes; $i++) 
     71        { 
    6172                $command .= " ".$_FILES['upload_file']['tmp_name'][$i]; 
    62         $return=0; 
     73        } 
     74         
     75        $return = 0; 
     76         
    6377        exec("bash -c ".escapeshellcmd(escapeshellarg($command)),$output,$return); 
     78         
    6479        if ($return == 1) 
    6580        { 
     
    7085 
    7186if($path != '/') 
     87{ 
    7288        for($i = 0; $i != $show_upload_boxes; $i++) 
    7389        { 
     
    184200                } 
    185201        } 
    186  
    187 if(count($notifUser) > 0) 
     202} 
     203 
     204if( count($notifUser) > 0 ) 
    188205{ 
    189206        define('PHPGW_INCLUDE_ROOT','../../'); 
     
    200217        $mail->FromName = $GLOBALS['phpgw_info']['user']['fullname']; 
    201218        $mail->IsHTML(true); 
    202         foreach ($notifUser as $userMail) 
     219         
     220        foreach( $notifUser as $userMail ) 
    203221        { 
    204222                $mail->AddAddress($userMail); 
    205223                $mail->Subject = lang("Filemanager notification"); 
    206                 $mail->Body = lang("The user %1, sent the file \"%2\" (type %3) and asked to notify you.",$GLOBALS['phpgw_info']['user']['fullname'],$_FILES['upload_file']['name'][0],$_FILES['upload_file']['type'][0])."<br>"; 
    207                 $mail->Body .= lang("Comments by user: %1",$_POST['upload_comment'][0])."<br>"; 
    208                 $mail->Body .= lang("The file can be accessed by: %1","<a href=\"".$GLOBALS['phpgw']->link("index.php").">link</a><br>"); 
    209 //              $mail->Body .= lang("The file can be accessed by: %1","<a href=\"".$GLOBALS['phpgw']->link("../index.php","menuaction=filemanager.uifilemanager.view&file=" . urlencode(base64_encode($_FILES['upload_file']['name'][0]))."&path=".urlencode(base64_encode($path)))."\">link</a><br>"); 
    210                 if(!$mail->Send()) { 
     224                 
     225                $body  = "<div style='font-size: 9pt !important;'>";  
     226                $body .= lang("The user %1 sent the following files", "<span style='font-weight: bold;'>" . $GLOBALS['phpgw_info']['user']['fullname'] . "</span>") . "<br/><br/>"; 
     227 
     228                foreach( $filesUpload['name'] as $key => $name )  
     229                        $body .= "<div style='font-weight: bold;'> - " . $name ." ( " . $filesUpload['type'][$key] . " )</div>"; 
     230 
     231                $body  .= "<div style='margin-top:25px;'>".lang("To view the files %1", "<a href='../filemanager/index.php'>".lang("Click here")."</a>")."</div>"; 
     232                $body  .= "</div>"; 
     233                 
     234                $mail->Body = $body; 
     235                 
     236                if( !$mail->Send() ) 
     237                { 
    211238                        $return[] = $mail->ErrorInfo; 
    212239                } 
    213240        } 
    214 } 
    215  
    216 if (count($return) > 0){ 
    217                 $_SESSION['response'] = serialize($return); 
    218 } 
    219         else 
    220                  $_SESSION['response'] = serialize( array( 0 => 'Ok' ) ); 
     241         
     242        unset( $filesUpload ); 
     243         
     244} 
     245 
     246$_SESSION['response'] = ( count($return) > 0 ) ? serialize($return) : serialize( array( 0 => 'Ok' ) );  
     247 
    221248?> 
  • branches/2.2/filemanager/inc/uploadApp.php

    r3386 r3610  
    1414} 
    1515$appletParameters = array( 
    16         'maxFileSize' => '5G', 
    17         'maxChunkSize' => '1600000', 
     16    'maxFileSize' => '5G', 
     17    'maxChunkSize' => '1600000', 
    1818        'archive' => '../tp/juploader/wjhk.jupload.jar', 
    1919        'afterUploadURL' => 'after_upload.php', 
  • branches/2.2/filemanager/js/common_functions.js

    r3569 r3610  
    2020} 
    2121 
     22function loadXtools() 
     23{ 
     24        if( Xtools == null ) 
     25                Xtools = new xtools( path_filemanager + "tp/expressowindow/" ); 
     26} 
     27 
    2228function check(element) 
    2329{ 
     
    8389} 
    8490 
    85 function newUpload(data) 
    86 { 
    87         if (data == null) 
    88         { 
    89                 address = document.location.toString(); 
    90                 address = address.split("?"); 
    91                 var url = address[0]+"?menuaction=filemanager.uifilemanager.showUploadboxes&path="+base64_encode(currentPath); 
    92                 cExecute_(url,newUpload); 
    93         } 
    94         else{ 
    95                 draw_window(data); 
    96         } 
     91function newUpload( ) 
     92{ 
     93        var _newUpload = function(data) 
     94        { 
     95                loadXtools(); 
     96                 
     97                var pArgs = unserialize(data); 
     98                        pArgs.lang_add_file             = get_lang("Add file"); 
     99                        pArgs.lang_click_here   = get_lang("Click here"); 
     100                        pArgs.lang_more_files   = get_lang("More files"); 
     101                        pArgs.height                    = 210; 
     102                        pArgs.path_filemanager  = path_filemanager; 
     103                        pArgs.width                     = 450; 
     104                 
     105                var _html = Xtools.parse( Xtools.xml("upload_files"), "upload.xsl", pArgs ); 
     106                 
     107                draw_window( _html, 490, 350, get_lang("upload files") ); 
     108        } 
     109         
     110        address = document.location.toString(); 
     111        address = address.split("?"); 
     112        var url = address[0]+"?menuaction=filemanager.uifilemanager.showUploadboxes&path="+base64_encode(currentPath); 
     113        cExecute_( url, _newUpload ); 
    97114} 
    98115 
    99116function newAdvancedUpload() 
    100117{ 
    101         for (i=0; i < navigator.plugins.length; i++) 
    102         { 
    103                 if (navigator.plugins[i].name.match('Java')) 
     118        for ( var i = 0 ; i < navigator.plugins.length; i++ ) 
     119        { 
     120                if ( navigator.plugins[i].name.match('Java') ) 
    104121                { 
    105122                        close_window(); 
    106                         draw_window("<iframe width=\"515\" height=\"320\" src='/filemanager/inc/uploadApp.php?id="+parseInt(Math.random()*Math.pow(10,15))+"'></iframe>",530,345); 
     123 
     124                        loadXtools(); 
     125                         
     126                        var pArgs =  
     127                        { 
     128                                'iframe_width'          : 515, 
     129                                'iframe_height'         : 320, 
     130                                'iframe_src'            : path_filemanager + "inc/uploadApp.php?id="+parseInt(Math.random()*Math.pow(10,15)) 
     131                        }; 
     132                         
     133                        var _html = Xtools.parse( Xtools.xml("upload_files_advanced"), "uploadAdvanced.xsl", pArgs); 
     134                         
     135                        draw_window( _html, 530, 345, get_lang("Advanced Upload") ); 
     136                         
    107137                        return; 
    108138                } 
     
    243273        else 
    244274        { 
    245                 if( Xtools == null ) 
    246                         Xtools = new xtools( path_filemanager + "tp/expressowindow/" ); 
    247          
     275                loadXtools(); 
     276                 
    248277                var pTools =  
    249278                { 
     
    316345 
    317346} 
    318 function borkb(size){ 
    319                 kbyte = 1024; 
    320                 mbyte = kbyte*1024; 
    321                 gbyte = mbyte*1024; 
    322                 if (!size) 
    323                         size = 0; 
    324                 if (size < kbyte) 
    325                         return size + 'B'; 
    326                 else if (size < mbyte) 
    327                         return parseInt(size/kbyte) + 'KB'; 
    328                 else if (size < gbyte) 
    329                         if (size/mbyte > 100) 
    330                                 return (size/mbyte).toFixed(0) + 'MB'; 
    331                         else 
    332                                 return (size/mbyte).toFixed(1) + 'MB'; 
    333                 else 
    334                         return (size/gbyte).toFixed(1) + 'GB'; 
    335 } 
    336 function addNewInput(){ 
    337         var line = document.getElementById('uploadOption'); 
    338         var newElement = document.createElement('TR'); 
    339         var newElement2 = document.createElement('TD'); 
    340         var newElement3 = document.createElement('TD'); 
    341         newElement2.innerHTML = '<input onchange="javascript:addNewInput();" maxlength="255" name="upload_file[]" type="file">'; 
    342         newElement3.innerHTML = '<input name="upload_comment[]" type="text">'; 
    343         newElement.appendChild(newElement2); 
    344         newElement.appendChild(newElement3); 
    345         line.parentNode.appendChild(newElement); 
    346         document.getElementById('show_upload_boxes').value +=1; 
    347 } 
    348  
    349 function sendNotification(){ 
    350         var winEl = document.getElementById('uploadOption').parentNode; 
    351         var emailTo = document.createElement("INPUT"); 
    352         emailTo.name="notifTo[]"; 
    353         emailTo.type="text"; 
    354         emailTo.size="38"; 
    355         var labelTo = document.createElement("SPAN"); 
    356         labelTo.innerHTML = get_lang("Send Notification email to:"); 
    357         winEl.insertBefore(labelTo,document.getElementById('uploadOption')); 
    358         winEl.insertBefore(emailTo,document.getElementById('uploadOption')); 
    359 } 
    360  
    361 function sendFiles(){ 
     347 
     348function borkb(size) 
     349{ 
     350        var kbyte = 1024; 
     351        var mbyte = kbyte*1024; 
     352        var gbyte = mbyte*1024; 
     353         
     354        if (!size) 
     355        { 
     356                size = 0; 
     357        } 
     358 
     359        if (size < kbyte) 
     360        { 
     361                return size + 'B'; 
     362        } 
     363        else if (size < mbyte) 
     364        { 
     365                return parseInt(size/kbyte) + 'KB'; 
     366        } 
     367        else if (size < gbyte) 
     368        { 
     369                if ( size/mbyte > 100) 
     370                        return (size/mbyte).toFixed(0) + 'MB'; 
     371                else 
     372                        return (size/mbyte).toFixed(1) + 'MB'; 
     373        } 
     374        else 
     375        { 
     376                return (size/gbyte).toFixed(1) + 'GB'; 
     377        } 
     378} 
     379 
     380function addNewInput() 
     381{ 
     382        var newElement = document.createElement('div'); 
     383                newElement.innerHTML  = '<input maxlength="255" name="upload_file[]" type="file" style="margin-right:5px;" />' + 
     384                                                                '<input name="upload_comment[]" type="text" style="margin-right:2px;" />' + 
     385                                                                '<span style="color:red; cursor:pointer;" onclick="removeInput(this);">'+get_lang('delete')+'</span>'; 
     386         
     387        document.getElementById('uploadOption').parentNode.appendChild(newElement); 
     388} 
     389 
     390function removeInput() 
     391{ 
     392        if( arguments.length > 0 ) 
     393        { 
     394                var _parent = arguments[0].parentNode; 
     395                 
     396                _parent.parentNode.removeChild(_parent); 
     397        } 
     398} 
     399 
     400function sendNotification() 
     401{ 
     402        var _div = document.getElementById('sendNotifcation'); 
     403 
     404        loadXtools(); 
     405                 
     406        var pArgs =  
     407        { 
     408                'lang_delete' : get_lang('delete'), 
     409                'lang_send_notification_email_to' :     get_lang("Send Notification email to:") 
     410        }; 
     411                 
     412        _div.innerHTML += Xtools.parse( Xtools.xml("teste"), "send_notification.xsl", pArgs); 
     413} 
     414 
     415function sendFiles() 
     416{ 
    362417                cExecuteForm_(document.getElementById('form_up'),handler.upload); 
    363418                document.getElementById('button_up').style.visibility = "hidden"; 
  • branches/2.2/filemanager/js/draw_api.js

    r3591 r3610  
    722722                        } 
    723723                        else 
    724                                 alert("É necessário escolher uma pasta !"); 
     724                                alert( get_lang("You must choose a folder !") ); 
    725725                } 
    726726                else 
  • branches/2.2/filemanager/setup/phpgw_pt-br.lang

    r3591 r3610  
    11%1 already exists as a file     filemanager     pt-br   %1 já existe como um arquivo 
    22application     filemanager     pt-br   Aplicação 
     3Add file        filemanager     pt-br   Adicionar arquivo 
    34back to file manager    filemanager     pt-br   Voltar ao Gerenciador de Arquivos 
    45cancel editing %1 without saving        filemanager     pt-br   Cancelar edição %1 sem salvar 
     
    3435This property will change the visibility of all users that have access to this file, continue?  filemanager     pt-br   Esta propriedade altera visibilidade dos usuários que estão compartilhados, deseja continuar? 
    3536Click to change comments        filemanager     pt-br   Clique para alterar comentários 
     37Click here      filemanager     pt-br   Clique aqui 
    3638All files created sucessfuly    filemanager     pt-br   Arquivos foram criados com sucesso 
    3739created by      filemanager     pt-br   Criado por 
     
    9496move to filemanager     pt-br   Mover Para 
    9597move to:        filemanager     pt-br   Mover para: 
     98More files      filemanager     pt-br   Mais arquivos 
    9699%1 files moved successfuly      filemanager     pt-br   %1 arquivos movidos com sucesso 
    97100File moved successfuly  filemanager     pt-br   Arquivo movido com sucesso 
     
    142145upload fields   filemanager     pt-br   campos de envio de arquivos 
    143146upload files    filemanager     pt-br   Enviar Arquivos 
    144 Advanced Upload filemanager     pt-br   Envio Avançado... 
     147Advanced Upload filemanager     pt-br   Envio Avançado 
    145148Uploaded files sucessfully      filemanager     pt-br   Arquivos enviados com sucesso 
    146149use new experimental filemanager?       filemanager     pt-br   Usar o novo Gerenciador de Arquivos experimental? 
     
    181184you do not have access to %1    filemanager     pt-br   Você não tem acesso a %1 
    182185Your Home Dir did not exist, eGroupWare created a new one.      filemanager     pt-br   Seu Diretório Home não existia, foi criado um novo. 
     186You must choose a folder !      filemanager     pt-br   Você deve escolher uma pasta ! 
    183187Filemanager notification        filemanager     pt-br   Gerenciador de arquivos notifica 
    184188The user %1, sent the file "%2" (type %3) and asked to notify you.      filemanager     pt-br   O usu&aacute;rio %1, enviou o arquivo "%2" (tipo %3) e solicitou o notificar. 
     189The user %1 sent the following files"   filemanager     pt-br   O usuário %1 enviou os seguintes arquivos 
     190To view the files %1"   filemanager     pt-br   Para ver os arquivos %1 
    185191Comments by user: %1    filemanager     pt-br   Coment&aacute;rios do usu&aacute;rio: %1 
    186192The file can be accessed by: %1 filemanager     pt-br   O arquivo pode ser acessado pelo endere&ccedil;o: %1 
    187 Send Notification email to:     filemanager     pt-br   Enviar email de notifica&ccedil;&atilde;o a: 
     193Send Notification email to:     filemanager     pt-br   Enviar email de notificação para: 
Note: See TracChangeset for help on using the changeset viewer.