[1526] | 1 | <?php |
---|
[2360] | 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 | \**************************************************************************/ |
---|
[1526] | 12 | // 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; |
---|
| 15 | } |
---|
| 16 | |
---|
[1572] | 17 | if(!$_SESSION['phpgw_info']['expressomail']['lang']) |
---|
| 18 | { |
---|
[1526] | 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)); |
---|
[1572] | 25 | $_SESSION['phpgw_info']['expressomail']['lang'][$message_id] = $content; |
---|
[1526] | 26 | } |
---|
| 27 | fclose($fp); |
---|
| 28 | } |
---|
[1572] | 29 | } |
---|
| 30 | |
---|
| 31 | foreach($_SESSION['phpgw_info']['expressomail']['lang'] as $key => $value) |
---|
| 32 | $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n"; |
---|
[1526] | 33 | echo "<script type='text/javascript'>$script</script>"; |
---|
| 34 | ?> |
---|