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

Revision 2573, 1.5 KB checked in by amuller, 14 years ago (diff)

Ticket #1026 - liberando a sessão ao ler do lang

  • 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
13if ( array_key_exists( 'lang', $_GET ) )
14        $lang = $_GET[ 'lang' ];
15else
16{
17        if ( isset( $_SESSION[ 'phpgw_info' ][ 'expressomail' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ] ) )
18                $lang = $_SESSION[ 'phpgw_info' ][ 'expressomail' ][ 'user' ][ 'preferences' ][ 'common' ][ 'lang' ];
19}
20session_write_close();
21
22$array_keys = array();
23$fn = dirname( __FILE__ ) . "/../setup/phpgw_{$lang}.lang";
24$lang = array( );
25
26if ( file_exists( $fn ) )
27{
28        $fp = fopen( $fn, 'r' );
29        while ( $data = fgets( $fp, 16000 ) )
30        {
31                list( $message_id, $app_name, $null, $content ) = explode( "\t", substr( $data, 0, -1 ) );
32                $lang[ ] = '"' . str_replace( '"', '\"', strtolower( $message_id ) ) . '" : "' . str_replace( '"', '\"', $content ) . '"';
33        }
34        fclose($fp);
35}
36
37echo '{' . implode( ",\n", $lang ) . '}'
38
39?>
Note: See TracBrowser for help on using the repository browser.