Changeset 2549 for trunk/expressoMail1_2/inc
- Timestamp:
- 04/15/10 15:26:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/load_lang.php
r2517 r2549 1 1 <?php 2 2 3 /*************************************************************************** 4 * Expresso Livre * 5 * http://www.expressolivre.org * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 3 /**************************************************************************\ 4 * Expresso Livre * 5 * http://www.expressolivre.org * 6 * -------------------------------------------- * 7 * This program is free software; you can redistribute it and/or modify it * 8 * under the terms of the GNU General Public License as published by the * 9 * Free Software Foundation; either version 2 of the License, or (at your * 10 * option) any later version. * 11 \**************************************************************************/ 12 12 13 // Load the lang of the module. 13 if(isset($offline_language)) { //Expresso offline, quando o gears sincroniza com uma nova versão, não é dado acesso as sessões do usuário, e é preciso o nome do arquivo de linguagens na session abaixo. 14 $_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'] = $offline_language; 14 if(isset($offline_language)) { //Expresso offline, quando o gears sincroniza com uma nova versão, não é dado acesso as sessões do usuário, e é preciso o nome do arquivo de linguagens na session abaixo. 15 $_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'] = $offline_language; 16 } 17 18 if(!$_SESSION['phpgw_info']['expressomail']['lang']) 19 { 20 $array_keys = array(); 21 $fn = 'setup/phpgw_'.$_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'].'.lang'; 22 if (file_exists($fn)){ 23 $fp = fopen($fn,'r'); 24 while ($data = fgets($fp,16000)){ 25 list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 26 $_SESSION['phpgw_info']['expressomail']['lang'][$message_id] = $content; 27 } 28 fclose($fp); 15 29 } 16 17 if(!$_SESSION['phpgw_info']['expressomail']['lang']) 18 { 19 $array_keys = array(); 20 $fn = 'setup/phpgw_'.$_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'].'.lang'; 21 if (file_exists($fn)){ 22 $fp = fopen($fn,'r'); 23 while ($data = fgets($fp,16000)){ 24 list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 25 $_SESSION['phpgw_info']['expressomail']['lang'][$message_id] = $content; 26 } 27 fclose($fp); 28 } 29 } 30 31 foreach($_SESSION['phpgw_info']['expressomail']['lang'] as $key => $value) 32 $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n"; 33 echo "<script type='text/javascript'>var array_lang = new Array();$script</script>"; 30 } 31 32 foreach($_SESSION['phpgw_info']['expressomail']['lang'] as $key => $value) 33 $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n"; 34 35 $GLOBALS['phpgw_info']['flags']['java_script_thirst'] = '<script type="text/javascript">var array_lang = new Array();'.$script.'</script>'; 34 36 ?>
Note: See TracChangeset
for help on using the changeset viewer.