Changeset 1526 for trunk/expressoMail1_2/inc/class.functions.inc.php
- Timestamp:
- 10/27/09 09:13:59 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.functions.inc.php
r1503 r1526 99 99 return $response; 100 100 } 101 102 function getLang( $key ) 103 { 104 static $language = NULL; 105 106 if ( ! $language ) 107 { 108 $_SESSION[ 'debug' ][ 'init_t' ] = time( ); 109 $_SESSION[ 'debug' ][ 'init_m' ] = microtime( ); 110 111 $xml = new DOMDocument; 112 $xml -> preserveWhiteSpace = false; 113 $xml -> load( dirname( __FILE__ ) 114 . '/../setup/phpgw_' 115 . $_SESSION['phpgw_info']['expressomail']['user']['preferences']['common']['lang'] 116 . '.xml' 117 ); 118 119 $xpath = new DOMXPath( $xml ); 120 121 $_key = 'key'; 122 $_lang = 'translation'; 123 124 $language = array( ); 125 foreach( $xml -> documentElement -> childNodes as $entry ) 126 $language[ $xpath->query( $_key, $entry ) -> item( 0 ) -> nodeValue ] = $xpath->query( $_lang, $entry ) -> item( 0 ) -> nodeValue; 127 128 $_SESSION[ 'debug' ][ 'end_t' ] = time( ); 129 $_SESSION[ 'debug' ][ 'end_m' ] = microtime( ); 130 } 131 132 if ( array_key_exists( $key, $language ) ) 133 return $language[ $key ]; 134 else 135 return ( $key . '*' ); 101 function getLang($key){ 102 if ($_SESSION['phpgw_info']['expressomail']['lang'][$key]) 103 return $_SESSION['phpgw_info']['expressomail']['lang'][$key]; 136 104 } 137 105
Note: See TracChangeset
for help on using the changeset viewer.