- Timestamp:
- 09/18/08 15:29:11 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/functions.inc.php
r432 r440 22 22 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 23 23 \**************************************************************************/ 24 25 24 25 26 26 /***************************************************************************\ 27 27 * If running in PHP3, then force admin to upgrade * … … 38 38 39 39 include(PHPGW_API_INC.'/common_functions.inc.php'); 40 40 41 41 /*! 42 42 @function lang … … 53 53 $vars = array($m1,$m2,$m3,$m4,$m5,$m6,$m7,$m8,$m9,$m10); 54 54 } 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 } 55 69 $value = $GLOBALS['phpgw']->translation->translate("$key",$vars); 56 70 return $value; … … 80 94 * Multi-Domain support * 81 95 \****************************************************************************/ 82 96 83 97 /* make them fix their header */ 84 98 if (!isset($GLOBALS['phpgw_domain'])) … … 148 162 } 149 163 $GLOBALS['phpgw']->db->Halt_On_Error = 'no'; 164 /* jakjr: ExpressoLivre: We do not count the config table. */ 165 if (! 150 166 $GLOBALS['phpgw']->db->connect( 151 167 $GLOBALS['phpgw_info']['server']['db_name'], … … 155 171 $GLOBALS['phpgw_info']['server']['db_pass'], 156 172 $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 162 178 /* BEGIN - CELEPAR - jakjr - 05/06/2006 */ 179 /* $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); */ 163 180 /*echo '<center><b>Fatal Error:</b> It appears that you have not created the database tables for ' 164 181 .'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>'; 167 183 /* END - CELEPAR - jakjr - 05/06/2006 */ 168 184 exit; … … 172 188 /* Fill phpgw_info["server"] array */ 173 189 // An Attempt to speed things up using cache premise 190 /* jakjr: ExpressoLivre does not use cache. */ 191 /* 174 192 $GLOBALS['phpgw']->db->query("select config_value from phpgw_config WHERE config_app='phpgwapi' and config_name='cache_phpgw_info'",__LINE__,__FILE__); 175 193 if ($GLOBALS['phpgw']->db->num_rows()) … … 177 195 $GLOBALS['phpgw']->db->next_record(); 178 196 $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 /* 181 201 $cache_query = "select content from phpgw_app_sessions where" 182 202 ." sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'"; … … 184 204 $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 185 205 $server_info_cache = $GLOBALS['phpgw']->db->num_rows(); 186 206 */ 207 /* 187 208 if(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $server_info_cache) 188 209 { … … 191 212 } 192 213 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__); 195 216 while ($GLOBALS['phpgw']->db->next_record()) 196 217 { … … 198 219 } 199 220 221 /* 200 222 if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info'])) 201 223 { … … 208 230 . "'0','0','phpgwapi','config','".addslashes(serialize($GLOBALS['phpgw_info']['server']))."')"; 209 231 $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 210 } 211 }232 }*/ 233 //} 212 234 unset($cache_query); 213 235 unset($server_info_cache); … … 454 476 } 455 477 $GLOBALS['phpgw']->applications->read_installed_apps(); // to get translated app-titles 456 478 457 479 /*************************************************************************\ 458 480 * Load the header unless the developer turns it off *
Note: See TracChangeset
for help on using the changeset viewer.