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

Revision 2360, 1.8 KB checked in by amuller, 14 years ago (diff)

Ticket #1008 - Adicionando informações sobre licenças

  • 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// 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       
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'>$script</script>";
34?>
Note: See TracBrowser for help on using the repository browser.