GlobalFunctions.class.php
gehe zur Dokumentation dieser Datei00001 <?php
00002
00009 class GlobalFunctions
00010 {
00011 function getIsoCodes()
00012 {
00013 global $conf_php;
00014
00015 $iso = parse_ini_file( './language/lang.ini.'.$conf_php );
00016 asort( $iso );
00017 return $iso;
00018 }
00019
00020
00021 function lang( $text )
00022 {
00023 global $SESS;
00024 $text = strtoupper($text);
00025
00026 if ( isset( $SESS['lang'][$text] ) )
00027 {
00028 return $SESS['lang'][$text];
00029 }
00030 else
00031 {
00032 return( '?'.$text.'?' );
00033 }
00034 }
00035
00036
00037 # Spracheinstellungen laden
00038
00039 function language_from_http()
00040 {
00041 global $SESS,
00042 $HTTP_SERVER_VARS,
00043 $conf_php,
00044 $conf;
00045
00046 $languages = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
00047 $languages = explode(',',$languages);
00048 foreach( $languages as $l )
00049 {
00050 $l = substr($l,0,2);
00051 if ( file_exists("./language/$l.ini.$conf_php") )
00052 return( $l );
00053 }
00054
00055
00056 return $conf['global']['default_language'];
00057 }
00058
00059
00060 function language_read( $l='' )
00061 {
00062 global $SESS,
00063 $HTTP_SERVER_VARS,
00064 $conf_php;
00065
00066 $l = language_from_http();
00067 $SESS['lang'] = parse_ini_file( "./language/$l.ini.$conf_php" );
00068 }
00069 }
00070
00071 ?>