diogenes.core.globals.inc.php

00001 <?php
00002 /*
00003  * Copyright (C) 2003-2004 Polytechnique.org
00004  * http://opensource.polytechnique.org/
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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 ?>

Generated on Fri Jan 11 01:20:08 2008 for Diogenes by  doxygen 1.5.1