Changeset 432 for trunk/phpgwapi
- Timestamp:
- 09/16/08 15:21:54 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/inc/functions.inc.php
r411 r432 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 }69 55 $value = $GLOBALS['phpgw']->translation->translate("$key",$vars); 70 56 return $value; … … 94 80 * Multi-Domain support * 95 81 \****************************************************************************/ 96 82 97 83 /* make them fix their header */ 98 84 if (!isset($GLOBALS['phpgw_domain'])) … … 162 148 } 163 149 $GLOBALS['phpgw']->db->Halt_On_Error = 'no'; 164 /* jakjr: ExpressoLivre: We do not count the config table. */165 if (!166 150 $GLOBALS['phpgw']->db->connect( 167 151 $GLOBALS['phpgw_info']['server']['db_name'], … … 171 155 $GLOBALS['phpgw_info']['server']['db_pass'], 172 156 $GLOBALS['phpgw_info']['server']['db_type'] 173 ) )174 //@$GLOBALS['phpgw']->db->query("SELECT COUNT(config_name) FROM phpgw_config");175 //if(!@$GLOBALS['phpgw']->db->next_record())176 { 177 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/'); 178 162 /* BEGIN - CELEPAR - jakjr - 05/06/2006 */ 179 /* $setup_dir = str_replace($_SERVER['PHP_SELF'],'index.php','setup/'); */180 163 /*echo '<center><b>Fatal Error:</b> It appears that you have not created the database tables for ' 181 164 .'eGroupWare. Click <a href="' . $setup_dir . '">here</a> to run setup.</center>';*/ 182 echo '<center><b>'.lang("ExpressoLivre is unavailable at this moment. Code %1<br>Please, try later.","001").'</b></center>'; 165 echo '<center><b>ExpressoLivre indisponível no momento. Códgio 001<br>' . 166 'Tente mais tarde.</b></center>'; 183 167 /* END - CELEPAR - jakjr - 05/06/2006 */ 184 168 exit; … … 188 172 /* Fill phpgw_info["server"] array */ 189 173 // An Attempt to speed things up using cache premise 190 /* jakjr: ExpressoLivre does not use cache. */191 /*192 174 $GLOBALS['phpgw']->db->query("select config_value from phpgw_config WHERE config_app='phpgwapi' and config_name='cache_phpgw_info'",__LINE__,__FILE__); 193 175 if ($GLOBALS['phpgw']->db->num_rows()) … … 195 177 $GLOBALS['phpgw']->db->next_record(); 196 178 $GLOBALS['phpgw_info']['server']['cache_phpgw_info'] = stripslashes($GLOBALS['phpgw']->db->f('config_value')); 197 }*/ 198 199 /* jakjr: ExpressoLivre does not use cache. */ 200 /* 179 } 180 201 181 $cache_query = "select content from phpgw_app_sessions where" 202 182 ." sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'"; … … 204 184 $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 205 185 $server_info_cache = $GLOBALS['phpgw']->db->num_rows(); 206 */ 207 /* 186 208 187 if(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $server_info_cache) 209 188 { … … 212 191 } 213 192 else 214 { */215 $GLOBALS['phpgw']->db->query(" SELECT* from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__);193 { 194 $GLOBALS['phpgw']->db->query("select * from phpgw_config WHERE config_app='phpgwapi'",__LINE__,__FILE__); 216 195 while ($GLOBALS['phpgw']->db->next_record()) 217 196 { … … 219 198 } 220 199 221 /*222 200 if(@isset($GLOBALS['phpgw_info']['server']['cache_phpgw_info'])) 223 201 { … … 230 208 . "'0','0','phpgwapi','config','".addslashes(serialize($GLOBALS['phpgw_info']['server']))."')"; 231 209 $GLOBALS['phpgw']->db->query($cache_query,__LINE__,__FILE__); 232 } */233 //}210 } 211 } 234 212 unset($cache_query); 235 213 unset($server_info_cache); … … 476 454 } 477 455 $GLOBALS['phpgw']->applications->read_installed_apps(); // to get translated app-titles 478 456 479 457 /*************************************************************************\ 480 458 * Load the header unless the developer turns it off *
Note: See TracChangeset
for help on using the changeset viewer.