source: trunk/instant_messenger/inc/load_lang.php @ 20

Revision 20, 855 bytes checked in by niltonneto, 17 years ago (diff)

Inclusão do módulo Mensageiro Instantâneo no CVS.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?
2// Load the lang of the module.
3        if(!$_SESSION['phpgw_info']['instant_messenger']['lang'])
4        {
5                $array_keys = array();
6                $fn = '../setup/phpgw_pt-br.lang';                     
7                if (file_exists($fn)){
8                        $fp = fopen($fn,'r');
9                        while ($data = fgets($fp,16000))        {
10                                list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));                 
11                                $_SESSION['phpgw_info']['instant_messenger']['lang'][$message_id] =  $content;
12                        }
13                        fclose($fp);
14                }
15        }
16        $script  = "IM.array_lang_im[0] = new Array();";
17        $script .= "IM.array_lang_im[1] = new Array();";               
18        $i = 0;
19        foreach($_SESSION['phpgw_info']['instant_messenger']['lang'] as $key => $value) {               
20                $script .= "IM.array_lang_im[0][".$i."] = '".str_replace("'","\'",strtolower($key))."';";               
21                $script .= "IM.array_lang_im[1][".$i."] = '".str_replace("'","\'",$value)."';";
22                $i++;                                   
23        }
24       
25        echo $script;
26?>
Note: See TracBrowser for help on using the repository browser.