+[Core]
+locale = 'fr_FR'
+
[Banana]
server = "localhost"
port = 119
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class CoreConfig
-{
- var $locale = 'fr_FR';
-}
-
class PlatalGlobals
{
- var $page = 'XorgPage';
var $session;
- var $menu;
- var $hook;
/** The x.org version */
var $version = '@VERSION@';
var $dbuser = 'x4dat';
var $dbpwd = 'x4dat';
- /** The class to use for session handling. */
- var $session = 'DiogenesCoreSession';
-
/** paths */
var $baseurl;
var $spoolroot;
$base = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
$this->baseurl = trim($base.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']), '/');
$this->spoolroot = dirname(dirname(dirname(__FILE__)));
- }
- function dbconnect()
- {
- @mysql_connect($this->dbhost, $this->dbuser, $this->dbpwd);
- @mysql_select_db($this->dbdb);
+ $this->read_config();
+
+ $this->dbconnect();
+ $this->setlocale();
}
function read_config()
}
}
+ function dbconnect()
+ {
+ @mysql_connect($this->dbhost, $this->dbuser, $this->dbpwd);
+ @mysql_select_db($this->dbdb);
+ }
+
function setlocale()
{
global $globals;
setlocale(LC_TIME, $globals->core->locale);
setlocale(LC_CTYPE, $globals->core->locale);
}
+
+ function asso($key=null)
+ {
+ static $aid = null;
+
+ if (is_null($aid)) {
+ $gp = Get::v('n');
+ $gp = substr($gp, 0, strpos($gp, '/'));
+
+ if ($gp) {
+ $res = XDB::query('SELECT a.*, d.nom AS domnom
+ FROM groupex.asso AS a
+ LEFT JOIN groupex.dom AS d ON d.id = a.dom
+ WHERE diminutif = {?}', $gp);
+ if (!($aid = $res->fetchOneAssoc())) {
+ $aid = array();
+ }
+ } else {
+ $aid = array();
+ }
+ }
+ if (empty($key)) {
+ return $aid;
+ } elseif ( isset($aid[$key]) ) {
+ return $aid[$key];
+ } else {
+ return null;
+ }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
***************************************************************************/
require_once('platal.inc.php');
-require_once('xnet/globals.inc.php');
+require_once('platal/globals.inc.php');
require_once('xnet/session.inc.php');
-XnetGlobals::init();
-XnetGlobals::setlocale();
+$globals = new PlatalGlobals('XnetSession');
XnetSession::init();
// {{{ function new_skinned_page()
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * 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 *
- ***************************************************************************/
-
-require_once('platal/globals.inc.php');
-
-class XnetGlobals extends PlatalGlobals
-{
- function XnetGlobals()
- {
- $this->PlatalGlobals('XnetSession');
- }
-
- function init()
- {
- global $globals;
-
- $globals = new XnetGlobals;
- $globals->core = new CoreConfig;
-
- $globals->read_config();
-
- $globals->dbconnect();
- }
-
- function asso($key=null)
- {
- static $aid = null;
-
- if (is_null($aid)) {
- $gp = Get::v('n');
- $gp = substr($gp, 0, strpos($gp, '/'));
-
- if ($gp) {
- $res = XDB::query('SELECT a.*, d.nom AS domnom
- FROM groupex.asso AS a
- LEFT JOIN groupex.dom AS d ON d.id = a.dom
- WHERE diminutif = {?}', $gp);
- if (!($aid = $res->fetchOneAssoc())) {
- $aid = array();
- }
- } else {
- $aid = array();
- }
- }
- if (empty($key)) {
- return $aid;
- } elseif ( isset($aid[$key]) ) {
- return $aid[$key];
- } else {
- return null;
- }
- }
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>
***************************************************************************/
require_once('platal.inc.php');
-require_once('xorg/globals.inc.php');
+require_once('platal/globals.inc.php');
require_once('xorg/session.inc.php');
-XorgGlobals::init();
-XorgGlobals::setlocale();
+$globals = new PlatalGlobals('XorgSession');
XorgSession::init();
require_once dirname(__FILE__).'/../classes/Page.php';
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2006 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * 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 *
- ***************************************************************************/
-
-require_once('platal/globals.inc.php');
-
-class XorgGlobals extends PlatalGlobals
-{
- function XorgGlobals()
- {
- $this->PlatalGlobals('XorgSession');
- }
-
- function init()
- {
- global $globals;
-
- $globals = new XorgGlobals;
- $globals->core = new CoreConfig;
-
- $globals->read_config();
-
- $globals->dbconnect();
- }
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
-?>