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

Revision 2549, 1.8 KB checked in by rodsouza, 14 years ago (diff)

Ticket #1009 - Corrigindo problemas com a inclusão de javascript.

  • Property svn:executable set to *
Line 
1<?php
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\**************************************************************************/
12
13// Load the lang of the module.
14if(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
18if(!$_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);
29        }
30}
31
32foreach($_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>';
36?>
Note: See TracBrowser for help on using the repository browser.