openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit dc5878a88c971f8e06600dfa95cf0aebb3e04a55
parent dc6fcb2b4939edad6a786f6c3f4e5b7bc1e41a49
Author: dankert <devnull@localhost>
Date:   Sun,  2 May 2004 21:27:22 +0200

Initiale Version

Diffstat:
functions/.htaccess | 3+++
functions/config.inc.php | 47+++++++++++++++++++++++++++++++++++++++++++++++
functions/db.inc.php | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
functions/language.inc.php | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
functions/request.inc.php | 49+++++++++++++++++++++++++++++++++++++++++++++++++
functions/theme.inc.php | 29+++++++++++++++++++++++++++++
6 files changed, 286 insertions(+), 0 deletions(-)

diff --git a/functions/.htaccess b/functions/.htaccess @@ -0,0 +1,2 @@ +order deny,allow +deny from all+ \ No newline at end of file diff --git a/functions/config.inc.php b/functions/config.inc.php @@ -0,0 +1,46 @@ +<?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']; + +?>+ \ No newline at end of file diff --git a/functions/db.inc.php b/functions/db.inc.php @@ -0,0 +1,81 @@ +<?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. +# + + +// Namen der Datenbanktabellen in Variablen schreiben +// +require( 'serviceClasses/Sql.class.php'); + +function table_names() +{ + $t = array(); + global $conf; + global $SESS; + + if ( isset($SESS['dbid']) ) + $conf_db_prefix = $conf['database_'.$SESS['dbid']]['prefix']; + else $conf_db_prefix = ''; + + $t['t_include'] = $conf_db_prefix.'include'; + $t['t_element'] = $conf_db_prefix.'element'; + $t['t_template'] = $conf_db_prefix.'template'; + $t['t_templatemodel'] = $conf_db_prefix.'templatemodel'; + $t['t_projectmodel'] = $conf_db_prefix.'projectmodel'; + $t['t_model'] = $conf_db_prefix.'projectmodel'; + $t['t_page'] = $conf_db_prefix.'page'; + $t['t_language'] = $conf_db_prefix.'language'; + $t['t_value'] = $conf_db_prefix.'value'; + $t['t_user'] = $conf_db_prefix.'user'; + $t['t_usergroup'] = $conf_db_prefix.'usergroup'; + $t['t_project'] = $conf_db_prefix.'project'; + $t['t_group'] = $conf_db_prefix.'group'; + $t['t_folder'] = $conf_db_prefix.'folder'; + $t['t_file'] = $conf_db_prefix.'file'; + $t['t_acl'] = $conf_db_prefix.'acl'; + $t['t_object'] = $conf_db_prefix.'object'; + $t['t_name'] = $conf_db_prefix.'name'; + $t['t_link'] = $conf_db_prefix.'link'; + + return $t; +} + + + +function db_connection() +{ + global $SESS, + $conf, + $db; + + if ( !isset($db) ) + { + $db = new DB( $conf['database_'.$SESS['dbid']] ); + $db->setFetchMode( DB_FETCHMODE_ASSOC ); + } + + return( $db ); +} + +//extract( table_names() ); + + + + +?>+ \ No newline at end of file diff --git a/functions/language.inc.php b/functions/language.inc.php @@ -0,0 +1,76 @@ +<?php + +# +# DaCMS Content Management System +# Copyright (C) 2002,2003 Jan Dankert, cms@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. +# + + +/** + * Diese Funktion stellt ein Wort in der eingestellten + * Sprache zur Verfügung. + * @package openrat.functions + */ +function lang( $text ) +{ + global $SESS; + $text = strtoupper($text); + + if ( isset( $SESS['lang'][$text] ) ) + { + return $SESS['lang'][$text]; + } + else + { + return( '?'.$text.'?' ); + } +} + + + +# Spracheinstellungen laden + +function language_from_http() +{ + global $SESS, + $HTTP_SERVER_VARS, + $conf_php, + $conf; + + $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']; +} + + +function language_read( $l='' ) +{ + global $SESS, + $HTTP_SERVER_VARS, + $conf_php; + + $l = language_from_http(); + $SESS['lang'] = parse_ini_file( "./language/$l.ini.$conf_php" ); +} diff --git a/functions/request.inc.php b/functions/request.inc.php @@ -0,0 +1,48 @@ +<?php +// --------------------------------------------------------------------------- +// $Id$ +// --------------------------------------------------------------------------- +// 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. +// --------------------------------------------------------------------------- +// $Log$ +// Revision 1.1 2004-05-02 19:27:22 dankert +// Initiale Version +// +// --------------------------------------------------------------------------- + +if (isset($_SESSION)) + $SESS = &$_SESSION; +else $SESS = &$HTTP_SESSION_VARS; + +if (isset($_FILES)) + $FILES = &$_FILES; +else $FILES = &$HTTP_POST_FILES; + +$REQ = array_merge($HTTP_GET_VARS,$HTTP_POST_VARS,$_GET,$_POST); + +function request_into_session( $name ) +{ + global $REQ,$SESS; + + if (isset($REQ[$name])) + { + $SESS[$name] = $REQ[$name]; + } +} + +?>+ \ No newline at end of file diff --git a/functions/theme.inc.php b/functions/theme.inc.php @@ -0,0 +1,28 @@ +<?php + + +// Ausgabe CSS-Klasse pro Zeile +function fx( $fx ) +{ + if ( $fx == 'f1' ) + return 'f2'; + else return 'f1'; +} + + +// +//function html_form_select( $name,$onchange,$value,$default ) +//{ +// $var = array(); +// $var['form_select_name'] = $name; +// $var['form_select_onchange'] = $onchange; +// $var['form_select_value'] = $value; +// $var['form_select_default'] = $default; +// +// output( 'form_select',$var ); +//} + + + + +?>+ \ No newline at end of file