Changeset 2576


Ignore:
Timestamp:
04/16/10 18:07:10 (14 years ago)
Author:
amuller
Message:

Ticket #1036 - Compactando tudo num unico arquivo por pacote

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/class.javascript.inc.php

    r2561 r2576  
    134134                                                                        if ($GLOBALS['phpgw_info']['server']['jspacker'] == "True") 
    135135                                                                        { 
    136                                                                                 $filePath=PHPGW_INCLUDE_ROOT.SEP.$app.SEP.'js'.SEP.$pkg.SEP.$file.'.js'; 
    137                                                                                 if (!file_exists($filePath."pack.js")) 
     136 
     137                                                                                if (!file_exists(PHPGW_INCLUDE_ROOT.SEP.$app.SEP.'js'.SEP.$pkg.SEP.$pkg.'.jspack.js')) 
    138138                                                                                { 
    139                                                                                         $fp = fopen($filePath."pack.js", 'w'); 
    140                                                                                         $script = file_get_contents($filePath); 
    141                                                                                         require_once('class.JavaScriptPacker.php'); 
    142                                                                                         $packer = new JavaScriptPacker($script, 'Normal', true, false); 
    143                                                                                         $packed = $packer->pack(); 
    144                                                                                         fwrite($fp, $packed); 
    145                                                                                         fclose($fp); 
     139                                                                                        $filePath=PHPGW_INCLUDE_ROOT.SEP.$app.SEP.'js'.SEP.$pkg.SEP.$file.'.js'; 
     140                                                                                        $script .= file_get_contents($filePath).";\n"; 
    146141                                                                                } 
    147                                                                                 $links .= '<script type="text/javascript" src="' 
    148                                                                                         .$GLOBALS['phpgw_info']['server']['webserver_url'] 
    149                                                                                         ."/$app/js/$pkg/$file" . ".jspack.js\"></script>\n"; 
    150142                                                                        }        
    151143                                                                        else 
     
    160152                                                                } 
    161153                                                        } 
     154 
     155                                                        if ($GLOBALS['phpgw_info']['server']['jspacker'] == "True") 
     156                                                        { 
     157                                                                $filePath=PHPGW_INCLUDE_ROOT.SEP.$app.SEP.'js'.SEP.$pkg.SEP.$pkg.'.jspack.js'; 
     158                                                                if (!file_exists($filePath)) 
     159                                                                { 
     160                                                                        $fp = fopen($filePath, 'w'); 
     161                                                                        require_once('class.JavaScriptPacker.php'); 
     162                                                                        $packer = new JavaScriptPacker($script, 'Normal', true, false); 
     163                                                                        $packed = $packer->pack(); 
     164                                                                        fwrite($fp, $packed); 
     165                                                                        fclose($fp); 
     166                                                                } 
     167                                                                $links .= '<script type="text/javascript" src="' 
     168                                                                        .$GLOBALS['phpgw_info']['server']['webserver_url'] 
     169                                                                        ."/$app/js/$pkg/$pkg" . ".jspack.js\"></script>\n"; 
     170                                                        } 
    162171                                                } 
    163172                                        } 
Note: See TracChangeset for help on using the changeset viewer.