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

Revision 2608, 1.4 KB checked in by rodsouza, 14 years ago (diff)

Ticket #1009 - Garantindo que a variável URL_SERVER esteja populada.

  • 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}
20
[2561]21$array_keys = array();
22$fn = dirname( __FILE__ ) . "/../setup/phpgw_{$lang}.lang";
23$lang = array( );
24
25if ( file_exists( $fn ) )
[2549]26{
[2561]27        $fp = fopen( $fn, 'r' );
28        while ( $data = fgets( $fp, 16000 ) )
29        {
30                list( $message_id, $app_name, $null, $content ) = explode( "\t", substr( $data, 0, -1 ) );
31                $lang[ ] = '"' . str_replace( '"', '\"', strtolower( $message_id ) ) . '" : "' . str_replace( '"', '\"', $content ) . '"';
[1572]32        }
[2561]33        fclose($fp);
[2549]34}
35
[2561]36echo '{' . implode( ",\n", $lang ) . '}'
[2549]37
[1526]38?>
Note: See TracBrowser for help on using the repository browser.