commit 75ddaa93ed53609e709b327fb83aa0b5d9293069
parent c9630f6b471d0c3775654ea75c73222fd6f47ddf
Author: dankert <devnull@localhost>
Date: Thu, 16 Dec 2004 00:20:04 +0100
aufgeraeumt
Diffstat:
2 files changed, 56 insertions(+), 68 deletions(-)
diff --git a/functions/config.inc.php b/functions/config.inc.php
@@ -1,46 +1,36 @@
-<?php
-// ---------------------------------------------------------------------------
-// DaCMS Content Management System
-// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// ---------------------------------------------------------------------------
-// $Id$
-// ---------------------------------------------------------------------------
+<?php
+// ---------------------------------------------------------------------------
+// DaCMS Content Management System
+// Copyright (C) 2002 Jan Dankert, jandankert@jandankert.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// ---------------------------------------------------------------------------
+// $Id$
+// ---------------------------------------------------------------------------
// $Log$
-// Revision 1.1 2004-05-02 19:27:22 dankert
-// Initiale Version
-//
-// ---------------------------------------------------------------------------
-
-//$conf = parse_ini_file( 'config.ini.php',true );
-
-$conf_php = $conf['global']['ext'];
-define('CONF_PHP',$conf['global']['ext']);
-//define('CONF_ADDSLASHES',$conf['global']['addslashes']);
-
-//$conf_db = $conf['database_1'];
-$conf_incldir = $conf['directories']['incldir'];
-$conf_datadir = $conf['directories']['datadir'];
-$conf_themedir = $conf['directories']['themedir'];
-$conf_languagedir = $conf['directories']['languagedir'];
-define('CONF_LANGUAGEDIR',$conf['directories']['languagedir']);
-$conf_plugindir = $conf['directories']['languagedir'];
-$conf_tmpdir = $conf['directories']['tmpdir'];
-
-$conf_logfile = $conf['log']['file'];
-$conf_loglevel = $conf['log']['level'];
-
+// Revision 1.2 2004-12-15 23:20:04 dankert
+// aufgeraeumt
+//
+// Revision 1.1 2004/05/02 19:27:22 dankert
+// Initiale Version
+//
+// ---------------------------------------------------------------------------
+
+
+$conf_logfile = $conf['log']['file'];
+$conf_loglevel = $conf['log']['level'];
+$conf_themedir = OR_THEMES_DIR.$conf['interface']['theme'];
+
?>
\ No newline at end of file
diff --git a/functions/language.inc.php b/functions/language.inc.php
@@ -22,7 +22,7 @@
/**
* Diese Funktion stellt ein Wort in der eingestellten
- * Sprache zur Verf?gung.
+ * Sprache zur Verfuegung.
* @package openrat.functions
*/
function lang( $text )
@@ -53,38 +53,36 @@ function hasLang( $text )
-# Spracheinstellungen laden
-function language_from_http()
+
+
+function language_read()
{
- global $SESS,
- $HTTP_SERVER_VARS,
- $conf_php,
- $conf;
+ global $conf;
+
+ if ( $conf['interface']['use_browser_language'] )
+ // Die vom Browser angeforderten Sprachen ermitteln
+ $languages = Http::getLanguages();
+ else
+ // Nur Default-Sprache erlauben
+ $languages = array();
+
+ // Default-Sprache hinzufuegen.
+ // Wird verwendet, wenn die vom Browser angeforderten Sprachen
+ // nicht vorhanden sind
+ $languages[] = $conf['interface']['language'];
- $languages = $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE'];
- $languages = explode(',',$languages);
foreach( $languages as $l )
{
$l = substr($l,0,2);
- if ( file_exists("./language/$l.ini.$conf_php") )
- return( $l );
- }
-
- // Keine passende Sprache im HTTP-Header gefunden
- return $conf['global']['default_language'];
-}
+ // Pruefen, ob Sprache vorhanden ist.
+ if ( file_exists( OR_LANGUAGE_DIR.$l.'.ini.'.PHP_EXT) )
+ break;
+ }
-function language_read( $l='' )
-{
- global $SESS,
- $HTTP_SERVER_VARS,
- $conf_php;
-
- $l = language_from_http();
Logger::debug( 'reading language file: '.$l );
- Session::setLanguage( parse_ini_file( "./language/$l.ini.$conf_php" ) );
+ Session::setLanguage( parse_ini_file( OR_LANGUAGE_DIR.$l.'.ini.'.PHP_EXT ) );
}
?>
\ No newline at end of file