source: trunk/expressoMail1_2/inc/load_lang.php @ 1121

Revision 1121, 1.1 KB checked in by eduardoalex, 15 years ago (diff)

Ticket #548 - Implementação do Expresso (Mail) Offline

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2// Load the lang of the module.
3        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.
4                $_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'] = $offline_language;
5        }
6       
7        if(!$_SESSION['phpgw_info']['expressomail']['lang'])
8        {
9                $array_keys = array();
10                $fn = 'setup/phpgw_'.$_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'].'.lang';                 
11                if (file_exists($fn)){
12                        $fp = fopen($fn,'r');
13                        while ($data = fgets($fp,16000))        {
14                                list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));                 
15                                $_SESSION['phpgw_info']['expressomail']['lang'][$message_id] =  $content;
16                        }
17                        fclose($fp);
18                }
19        }
20       
21        foreach($_SESSION['phpgw_info']['expressomail']['lang'] as $key => $value)
22                $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n";
23        echo "<script type='text/javascript'>$script</script>";
24?>
Note: See TracBrowser for help on using the repository browser.