Changeset 3936


Ignore:
Timestamp:
03/31/11 16:51:47 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1659 - Correcao para exportar arquivos sem conteudo

Location:
branches/2.2/filemanager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/class.uifilemanager.inc.php

    r3913 r3936  
    10381038        } 
    10391039 
    1040         function export() { 
    1041                 if ($this->file) { 
     1040        function export() 
     1041        { 
     1042                if ($this->file) 
     1043                { 
    10421044                        $ls_array = $this->bo->vfs->ls(array( 
    10431045                                                        'string' => $this->path . '/' . $this->file, 
     
    10461048                                                        'nofiles' => True 
    10471049                                          )); 
    1048                         /* $timestamp = $this->vfs_functions->dateString2timeStamp($ls_array[0]['modified']); 
    1049                           if (time() - $timestamp < 60 && $ls_array[0]['modifiedby_id'] != $GLOBALS['phpgw_info']['user']['account_id']); 
    1050                           { 
    1051                           // recently than last minute: someone is editing 
    1052                           } */ 
     1050 
    10531051                        $mime_type = $ls_array[0]['mime_type']; 
     1052                         
    10541053                        $formats = array('text/html'); 
    1055                         if (!in_array($mime_type, $formats)) { 
     1054                         
     1055                        if (!in_array($mime_type, $formats)) 
     1056                        { 
    10561057                                echo lang('Impossible to export this file'); 
    10571058                                return False; 
    10581059                        } 
     1060                         
    10591061                        $content = $this->bo->vfs->read(array('string' => $this->path . '/' . $this->file, 
    10601062                                                        'relatives' => array(RELATIVE_NONE) 
     
    10621064 
    10631065                        include_once('filemanager/tp/dompdf/dompdf_config.inc.php'); 
     1066                         
    10641067                        $dompdf = new DOMPDF(); 
    10651068                        $dompdf->load_html($content); 
  • branches/2.2/filemanager/js/draw_api.js

    r3924 r3936  
    334334        { 
    335335                case 'text/html': 
    336                         retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>'; 
     336                        if( file.size > 0 ) 
     337                                retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>'; 
     338                        else 
     339                                retBuff += '<td><a href="javascript:void();"></a></td>'; 
    337340                        break; 
    338341                case 'application/zip': 
Note: See TracChangeset for help on using the changeset viewer.