Changeset 440


Ignore:
Timestamp:
09/18/08 15:29:11 (16 years ago)
Author:
niltonneto
Message:

Correção do commit efetuado por Rafael Raymundo (r. 432), que
sobrescreveu alterações anteriores (r.411).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/inc/functions.inc.php

    r432 r440  
    2222         * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA            * 
    2323         \**************************************************************************/ 
    24  
    25  
     24         
     25         
    2626        /***************************************************************************\ 
    2727        * If running in PHP3, then force admin to upgrade                           * 
     
    3838 
    3939        include(PHPGW_API_INC.'/common_functions.inc.php'); 
    40  
     40         
    4141        /*! 
    4242         @function lang 
     
    5353                        $vars = array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10); 
    5454                } 
     55                // Get the translation from Lang File, if the database is down. 
     56                if(!$GLOBALS['phpgw']->translation){ 
     57                        $fn = PHPGW_SERVER_ROOT.'/phpgwapi/setup/phpgw_'.$GLOBALS['_SERVER']['HTTP_ACCEPT_LANGUAGE'].'.lang'; 
     58                        if (file_exists($fn)){ 
     59                                $fp = fopen($fn,'r'); 
     60                                while ($data = fgets($fp,16000)){ 
     61                                        list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 
     62                                        $GLOBALS['phpgw_info']['phpgwapi']['lang'][$message_id] =  $content; 
     63                                } 
     64                                fclose($fp); 
     65                        } 
     66                        $return = str_replace('%1',$vars[0],$GLOBALS['phpgw_info']['phpgwapi']['lang'][$key]);                   
     67                        return $return;   
     68                } 
    5569                $value = $GLOBALS['phpgw']->translation->translate("$key",$vars); 
    5670                return $value; 
     
    8094        * Multi-Domain support                                                       * 
    8195        \****************************************************************************/ 
    82  
     96         
    8397        /* make them fix their header */ 
    8498        if (!isset($GLOBALS['phpgw_domain'])) 
     
    148162        } 
    149163        $GLOBALS['phpgw']->db->Halt_On_Error = 'no'; 
     164        /* jakjr: ExpressoLivre: We do not count the config table. */ 
     165        if (! 
    150166        $GLOBALS['phpgw']->db->connect( 
    151167                $GLOBALS['phpgw_info']['server']['db_name'], 
     
    155171                $GLOBALS['phpgw_info']['server']['db_pass'], 
    156172                $GLOBALS['phpgw_info']['server']['db_type'] 
    157         ); 
    158         @$GLOBALS['phpgw']->db->query("SELECT COUNT(config_name) FROM phpgw_config"); 
    159         if(!@$GLOBALS['phpgw']->db->next_record()) 
    160         { 
    161                 $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); 
     173        ) ) 
     174        //@$GLOBALS['phpgw']->db->query("SELECT COUNT(config_name) FROM phpgw_config"); 
     175        //if(!@$GLOBALS['phpgw']->db->next_record()) 
     176        { 
     177                 
    162178                /* BEGIN - CELEPAR - jakjr - 05/06/2006 */ 
     179                /* $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); */ 
    163180                /*echo '<center><b>Fatal Error:</b> It appears that you have not created the database tables for ' 
    164181                        .'eGroupWare.  Click <a href="' . $setup_dir . '">here</a> to run setup.</center>';*/ 
    165                 echo '<center><b>ExpressoLivre indisponível no momento. Códgio 001<br>' . 
    166                          'Tente mais tarde.</b></center>'; 
     182                echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","001").'</b></center>'; 
    167183                /* END - CELEPAR - jakjr - 05/06/2006 */ 
    168184                exit; 
     
    172188        /* Fill phpgw_info["server"] array */ 
    173189        // An Attempt to speed things up using cache premise 
     190        /* jakjr: ExpressoLivre does not use cache. */ 
     191        /* 
    174192        $GLOBALS['phpgw']->db->query("select config_value from phpgw_config WHERE config_app='phpgwapi' and config_name='cache_phpgw_info'",__LINE__,__FILE__); 
    175193        if ($GLOBALS['phpgw']->db->num_rows()) 
     
    177195                $GLOBALS['phpgw']->db->next_record(); 
    178196                $GLOBALS['phpgw_info']['server']['cache_phpgw_info'] = stripslashes($GLOBALS['phpgw']->db->f('config_value')); 
    179         } 
    180  
     197        }*/ 
     198 
     199        /* jakjr: ExpressoLivre does not use cache. */ 
     200        /*       
    181201        $cache_query = "select content from phpgw_app_sessions where" 
    182202                ." sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'"; 
     
    184204        $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 
    185205        $server_info_cache = $GLOBALS['phpgw']->db->num_rows(); 
    186  
     206        */ 
     207        /* 
    187208        if(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $server_info_cache) 
    188209        { 
     
    191212        } 
    192213        else 
    193         { 
    194                 $GLOBALS['phpgw']->db->query("select * from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__); 
     214        {*/ 
     215                $GLOBALS['phpgw']->db->query("SELECT * from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__); 
    195216                while ($GLOBALS['phpgw']->db->next_record()) 
    196217                { 
     
    198219                } 
    199220 
     221                /* 
    200222                if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info'])) 
    201223                { 
     
    208230                                . "'0','0','phpgwapi','config','".addslashes(serialize($GLOBALS['phpgw_info']['server']))."')"; 
    209231                        $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 
    210                 } 
    211         } 
     232                }*/ 
     233        //} 
    212234        unset($cache_query); 
    213235        unset($server_info_cache); 
     
    454476                } 
    455477                $GLOBALS['phpgw']->applications->read_installed_apps(); // to get translated app-titles 
    456  
     478                 
    457479                /*************************************************************************\ 
    458480                * Load the header unless the developer turns it off                       * 
Note: See TracChangeset for help on using the changeset viewer.