source: sandbox/calendar/ajax_calendar/expressoCalendar/inc/load_lang.php @ 1204

Revision 1204, 1.0 KB checked in by amuller, 12 years ago (diff)

Ticket #88 - Adaptação pro expresso2.0

  • Property svn:executable set to *
Line 
1<?
2        if(!isset($GLOBALS['phpgw_info'])){
3                $GLOBALS['phpgw_info']['flags'] = array(
4                 'currentapp' => 'expressoCalendar',
5                 'nonavbar'   => true,
6                 'noheader'   => true
7                );
8        }
9        require_once '../../header.session.inc.php';
10
11// Load the lang of the module.
12        if(!$_SESSION['phpgw_info']['expressoCalendar']['lang'])
13        {
14                $array_keys = array();
15                $fn = '../setup/phpgw_'.$_SESSION['calendar']['user']['preferences']['common']['lang'].'.lang';                 
16                if (file_exists($fn)){
17                        $fp = fopen($fn,'r');
18                        while ($data = fgets($fp,16000))        {
19                                list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));                 
20                                $_SESSION['phpgw_info']['expressoCalendar']['lang'][$message_id] =  $content;
21                        }
22                        fclose($fp);
23                }
24        }
25        $script  = "array_lang = new Array();";
26        foreach($_SESSION['phpgw_info']['expressoCalendar']['lang'] as $key => $value)
27                $script .= "array_lang['".str_replace("'","\'",strtolower($key))."'] = '".str_replace("'","\'",$value)."';\n";
28        echo $script;
29
30?>
Note: See TracBrowser for help on using the repository browser.