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 *
RevLine 
[1526]1<?php
[2360]2
[2549]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
[2561]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' ];
[2549]19}
[2573]20session_write_close();
[2549]21
[2561]22$array_keys = array();
23$fn = dirname( __FILE__ ) . "/../setup/phpgw_{$lang}.lang";
24$lang = array( );
25
26if ( file_exists( $fn ) )
[2549]27{
[2561]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 ) . '"';
[1572]33        }
[2561]34        fclose($fp);
[2549]35}
36
[2561]37echo '{' . implode( ",\n", $lang ) . '}'
[2549]38
[1526]39?>
Note: See TracBrowser for help on using the repository browser.