00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00024 class DiogenesCoreGlobals {
00026 var $libroot;
00028 var $root;
00030 var $rooturl;
00031
00033 var $db;
00034
00036 var $dbdb = "diogenes";
00038 var $dbhost = "localhost";
00040 var $dbuser = "diogenes";
00042 var $dbpwd;
00043
00045 var $table_log_actions = "diogenes_logactions";
00047 var $table_log_events = "diogenes_logevents";
00049 var $table_log_sessions = "diogenes_logsessions";
00051 var $session = 'DiogenesCoreSession';
00053 var $gettext = 'gettext';
00054
00055
00058 function dbconnect()
00059 {
00060 $db = new DiogenesDatabase($this->dbdb, $this->dbhost, $this->dbuser, $this->dbpwd);
00061 if (!$db->connect_id)
00062 {
00063 if (!headers_sent())
00064 header("HTTP/1.0 500 Internal Server Error");
00065 die("Could not connect to database (".mysql_error().")");
00066 }
00067 $this->db = $db;
00068 }
00069
00074 function urlise($in)
00075 {
00076 $out = str_replace("Polytechnique.org","<a href=\"http://www.polytechnique.org/\">Polytechnique.org</a>",$in);
00077 $out = str_replace("Diogenes","<a href=\"http://opensource.polytechnique.org/diogenes/\">Diogenes</a>",$out);
00078 return $out;
00079 }
00080
00081 }
00082
00083
00088 function __($msg)
00089 {
00090 global $globals;
00091 $func = $globals->gettext;
00092
00093 if (function_exists($func))
00094 return $func($msg);
00095 else
00096 return $msg;
00097 }
00098
00099
00100 ?>