Ignore:
Timestamp:
04/20/10 16:39:19 (14 years ago)
Author:
rodsouza
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/filemanager/inc/load_lang.php

    r2362 r2608  
    11<?php 
    22 
    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         $array_keys = array(); 
    13         $fn = $GLOBALS['phpgw_info']['flags']['currentapp'].'/setup/phpgw_'.$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'].'.lang'; 
    14         if (file_exists($fn)){ 
    15                         $fp = fopen($fn,'r'); 
    16                 while ($data = fgets($fp,16000)){ 
    17                         list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1)); 
    18                         $script .= "array_lang['".str_replace("'","\'",strtolower($message_id))."'] = '".str_replace("'","\'",$content)."';\n"; 
    19                 } 
    20                 fclose($fp); 
     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} 
     20 
     21$array_keys = array(); 
     22$fn = dirname( __FILE__ ) . "/../setup/phpgw_{$lang}.lang"; 
     23$lang = array( ); 
     24 
     25if ( file_exists( $fn ) ) 
     26{ 
     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 ) . '"'; 
    2132        } 
    22         echo "<script type='text/javascript'>var array_lang = new Array(); $script</script>"; 
     33        fclose($fp); 
     34} 
     35 
     36echo '{' . implode( ",\n", $lang ) . '}' 
     37 
    2338?> 
Note: See TracChangeset for help on using the changeset viewer.