platal rework to include xnet
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Sun, 17 Apr 2005 15:09:47 +0000 (15:09 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:28:31 +0000 (23:28 +0200)
* creation of include/platal/ that holds all the ste idepenant code.
  lots of it comes from include/xorg/

* some buggy skins are now better

* begin to work on xnet, but the current state is broken, this is only a "save me before the HDD crash" commit

git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-546

32 files changed:
htdocs.net/css/asso.css [deleted file]
htdocs.net/css/xnet.css [new file with mode: 0644]
htdocs/TESTS/xorg_env.php
htdocs/TESTS/xorg_errors.php
include/platal.inc.php [new file with mode: 0644]
include/platal/database.inc.php [moved from include/xorg/database.inc.php with 100% similarity]
include/platal/env.inc.php [moved from include/xorg/env.inc.php with 92% similarity]
include/platal/errors.inc.php [moved from include/xorg/errors.inc.php with 100% similarity]
include/platal/iterator.inc.php [moved from include/xorg/iterator.inc.php with 100% similarity]
include/platal/page.inc.php [new file with mode: 0644]
include/platal/smarty.plugins.inc.php [moved from include/xorg/smarty.plugins.inc.php with 100% similarity]
include/platal/xml-rpc.inc.php [moved from include/xorg/xml-rpc.inc.php with 100% similarity]
include/xml-rpc-client.inc.php
include/xnet/page.inc.php [new file with mode: 0644]
include/xorg.globals.inc.php.in
include/xorg.inc.php
include/xorg/page.inc.php
templates/skin/common.content.tpl
templates/skin/common.header.tpl
templates/skin/default.tpl
templates/skin/espace.tpl
templates/skin/humlinux.tpl
templates/skin/linux.tpl
templates/skin/liteskin.tpl
templates/skin/nbviolet.tpl
templates/skin/newxorg.tpl
templates/skin/oldtimes.tpl
templates/skin/openweb.tpl
templates/skin/sharky.tpl
templates/skin/spectral.tpl
templates/skin/trapped.tpl
templates/xnet/skin.tpl [new file with mode: 0644]

diff --git a/htdocs.net/css/asso.css b/htdocs.net/css/asso.css
deleted file mode 100644 (file)
index 8c1384f..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-BODY {
-       background-color: #F2E9D0;
-       margin-left: 0;
-       margin-top: 0;
-       color: #505050;
-       font-family: "Bitstream vera sans","Verdana",sans-serif;
-       font-size: 10pt;
-       border-top: 1px;
-}
-
-table { font-size: 10pt; font-family: "Bitstream vera sans","Verdana",sans-serif; }
-input,textarea,tt,pre { font-size: 10pt; }
-
-img { vertical-align: middle; }
-
-A:link {
-       color: #5C81AA;
-}
-A:visited {
-       color:  #5C81AA;
-}
-
-A.s:link {
-       text-decoration: none ;
-       color: #9F81AD;
-}
-A.s:visited {
-       text-decoration: none ;
-       color: #9F81AD;
-}
-
-TABLE.tableprincipale {
-       width: 765px;
-       border: 0px;
-       margin: 0px;
-       padding: 0px;
-}
-
-table.menu { width: 150px; }
-
-th.menu {
-       padding: 0.5em 0em 0.6em 0em;
-       font-size: 95%;
-       text-align: left;
-       font-family: "Arial",sans-serif;
-       vertical-align: middle;
-       text-align: center;
-       font-weight: bold;
-       background: url('images/barre.png') bottom left no-repeat;
-}
-
-TD.menu {
-       padding: 0.2em 0em 0.2em 0em;
-       font-size: 95%;
-       text-align: left;
-       font-family: "Arial",sans-serif;
-       vertical-align: middle;
-}
-
-TD.infos {
-       height: 30px;
-       text-align: center;
-       font-family: "Bitstream Vera Sans","Arial",sans-serif;
-       color: #505050;
-}
-
-TD.pres {
-       background-repeat: no-repeat;
-       background-image: url("images/oval.png");
-       background-position: center center;
-       height: 50px;
-       text-align: center;
-       width: 210px;
-}
-TD.presautres {
-       background-repeat: no-repeat;
-       background-image: url("images/oval.png");
-       background-position: top center;
-       font-size: 90%;
-       height: 50px;
-       text-align: center;
-       width: 200px;
-}
-
-TD.pres2 {
-       background-repeat: no-repeat;
-       background-image: url("images/oval2.png");
-       height: 50px;
-       text-align: center;
-       width: 202px;
-}
-
-TD.choix1 {
-       height: 30px;
-       background-color: #D0C198;
-       font-size: 100%;
-       color: #5C81AA;
-}
-DIV.choix1 {
-       text-align: center;
-}
-TD.choix1actif {
-       height: 30px;
-       vertical-align: middle;
-       text-decoration: none;
-}
-
-TD.choix2 {
-       height: 20px;
-       background-color: #D0C198;
-       font-size: 80%;
-}
-TD.choix2actif {
-       height: 20px;
-       background-color: #5C81AA;
-       color:#D0C198;
-}
-DIV.choix2 {
-       text-align: center;
-}
-
-TD.liens-puce {
-       width: 15px;
-       vertical-align: center;
-       padding-left: 0.25em;
-}
-
-TD.liens {
-       vertical-align: center;
-       padding-left: 0.5em;
-       text-align: left;
-}
-
-td.tdliens {
-       padding: 0.4em 0em 0.4em 0em;
-}
-
-P.descr {
-       text-align: justify;
-       font-size: 90%;
-       font-weight: bold;
-       padding-left: 7px;
-       padding-right: 7px;
-}
-UL.descr {
-       text-align: justify;
-       font-size: 80%;
-       font-weight: bold;
-}
diff --git a/htdocs.net/css/xnet.css b/htdocs.net/css/xnet.css
new file mode 100644 (file)
index 0000000..76c6c60
--- /dev/null
@@ -0,0 +1,216 @@
+/***************************************************************************
+ *  Copyright (C) 2003-2004 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                *
+ ***************************************************************************/
+
+body {
+    background-color: #F2E9D0;
+    margin-left: 0;
+    margin-top: 0;
+    color: #505050;
+    font-family: "Bitstream vera sans","Verdana",sans-serif;
+    font-size: 10pt;
+    border-top: 1px;
+}
+
+table {
+    font-size: 10pt;
+    font-family: "Bitstream vera sans","Verdana",sans-serif;
+}
+
+input,textarea,select,option,tt,pre {
+    font-size: 10pt;
+}
+
+a img {
+    border: none;
+}
+
+/***************************************************************************
+ * DEBUG
+ ***************************************************************************/
+
+#dev {
+    width: 100%;
+    text-align: center;
+    padding: 1px;
+
+    font-size: 10pt;
+    font-weight: bold;
+}
+
+#db-trace div.hide       { display: none; }
+#db-trace:hover div.hide { display: block }
+#db-trace h1 { margin: 0px; }
+
+/***************************************************************************
+ * LAYOUT
+ ***************************************************************************/
+
+table#layout {
+    width: 765px;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+td#credits {
+    text-align: center;
+    font-size: 90%;
+    font-weight: bold;
+}
+
+td#search {
+    text-align: right;
+}
+
+img { vertical-align: middle; }
+
+a:link {
+    color: #5C81AA;
+}
+a:visited {
+    color:  #5C81AA;
+}
+
+a.s:link {
+    text-decoration: none ;
+    color: #9F81AD;
+}
+a.s:visited {
+    text-decoration: none ;
+    color: #9F81AD;
+}
+
+table.tableprincipale {
+    width: 765px;
+    border: 0px;
+    margin: 0px;
+    padding: 0px;
+}
+
+table.menu { width: 150px; }
+
+th.menu {
+    padding: 0.5em 0em 0.6em 0em;
+    font-size: 95%;
+    text-align: left;
+    font-family: "Arial",sans-serif;
+    vertical-align: middle;
+    text-align: center;
+    font-weight: bold;
+    background: url('images/barre.png') bottom left no-repeat;
+}
+
+td.menu {
+    padding: 0.2em 0em 0.2em 0em;
+    font-size: 95%;
+    text-align: left;
+    font-family: "Arial",sans-serif;
+    vertical-align: middle;
+}
+
+td.infos {
+    height: 30px;
+    text-align: center;
+    font-family: "Bitstream Vera Sans","Arial",sans-serif;
+    color: #505050;
+}
+
+td.pres {
+    background-repeat: no-repeat;
+    background-image: url("images/oval.png");
+    background-position: center center;
+    height: 50px;
+    text-align: center;
+    width: 210px;
+}
+td.presautres {
+    background-repeat: no-repeat;
+    background-image: url("images/oval.png");
+    background-position: top center;
+    font-size: 90%;
+    height: 50px;
+    text-align: center;
+    width: 200px;
+}
+
+td.pres2 {
+    background-repeat: no-repeat;
+    background-image: url("images/oval2.png");
+    height: 50px;
+    text-align: center;
+    width: 202px;
+}
+
+td.choix1 {
+    height: 30px;
+    background-color: #D0C198;
+    font-size: 100%;
+    color: #5C81AA;
+}
+DIV.choix1 {
+    text-align: center;
+}
+td.choix1actif {
+    height: 30px;
+    vertical-align: middle;
+    text-decoration: none;
+}
+
+td.choix2 {
+    height: 20px;
+    background-color: #D0C198;
+    font-size: 80%;
+}
+td.choix2actif {
+    height: 20px;
+    background-color: #5C81AA;
+    color:#D0C198;
+}
+DIV.choix2 {
+    text-align: center;
+}
+
+td.liens-puce {
+    width: 15px;
+    vertical-align: center;
+    padding-left: 0.25em;
+}
+
+td.liens {
+    vertical-align: center;
+    padding-left: 0.5em;
+    text-align: left;
+}
+
+td.tdliens {
+    padding: 0.4em 0em 0.4em 0em;
+}
+
+P.descr {
+    text-align: justify;
+    font-size: 90%;
+    font-weight: bold;
+    padding-left: 7px;
+    padding-right: 7px;
+}
+ul.descr {
+    text-align: justify;
+    font-size: 80%;
+    font-weight: bold;
+}
index 0060161..5387cc7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 require_once("__init__.php");
-require_once('include/xorg/env.inc.php');
+require_once('include/platal/env.inc.php');
 
 class TestOfEnv extends UnitTestCase {
     function TestOfEnv() {
index e9cde8d..fbcdfe4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 require_once("__init__.php");
-require_once('include/xorg/errors.inc.php');
+require_once('include/platal/errors.inc.php');
 
 class TestOfXOrgErrors extends UnitTestCase {
     function TestOfXOrgErrors() {
diff --git a/include/platal.inc.php b/include/platal.inc.php
new file mode 100644 (file)
index 0000000..59f50a5
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2004 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                *
+ ***************************************************************************/
+
+function microtime_float() 
+{ 
+    list($usec, $sec) = explode(" ", microtime()); 
+    return ((float)$usec + (float)$sec); 
+} 
+$TIME_BEGIN = microtime_float();
+
+// {{{ defines
+
+$i=0;
+define("AUTH_PUBLIC", $i++);
+define("AUTH_COOKIE", $i++);
+define("AUTH_MDP", $i++);
+
+define("PERMS_EXT", "ext");
+define("PERMS_USER", "user");
+define("PERMS_ADMIN", "admin");
+
+define('SKINNED', 0);
+define('NO_SKIN', 1);
+
+// }}}
+// {{{ globals
+
+require_once('platal/env.inc.php');
+setlocale(LC_MESSAGES, $globals->core->locale);
+setlocale(LC_TIME,     $globals->core->locale);
+setlocale(LC_CTYPE,    $globals->core->locale);
+
+// }}}
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
similarity index 92%
rename from include/xorg/env.inc.php
rename to include/platal/env.inc.php
index 26ae14e..3d7b664 100644 (file)
@@ -340,5 +340,28 @@ class Cookie
 
 // }}}
 
+function fix_gpc_magic(&$item, $key) {
+    if (is_array($item)) {
+        array_walk($item, 'fix_gpc_magic');
+    } else {
+        $item = stripslashes($item);
+    }
+}
+
+function unfix_gpc_magic(&$item, $key) {
+    if (is_array($item)) {
+        array_walk($item, 'fix_gpc_magic');
+    } else {
+        $item = addslashes($item);
+    }
+}
+
+if (ini_get("magic_quotes_gpc")) {
+    array_walk($_GET, 'fix_gpc_magic');
+    array_walk($_POST, 'fix_gpc_magic');
+    array_walk($_COOKIE, 'fix_gpc_magic');
+    array_walk($_REQUEST, 'fix_gpc_magic');
+}
+
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
diff --git a/include/platal/page.inc.php b/include/platal/page.inc.php
new file mode 100644 (file)
index 0000000..16732ba
--- /dev/null
@@ -0,0 +1,235 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2004 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('diogenes/diogenes.core.page.inc.php');
+require_once('platal/errors.inc.php');
+require_once('platal/smarty.plugins.inc.php');
+
+// {{{ class XorgPage
+
+class PlatalPage extends DiogenesCorePage
+{
+    // {{{ properties
+    
+    var $_page_type;
+    var $_tpl;
+    var $_errors;
+
+    // defaults
+    var $caching          = false;
+    var $config_overwrite = false;
+    var $use_sub_dirs     = false;
+
+    // }}}
+    // {{{ function XorgPage()
+
+    function PlatalPage($tpl, $type=SKINNED)
+    {
+        global $globals;
+
+        $this->template_dir  = $globals->spoolroot."/templates/";
+        $this->compile_dir   = $globals->spoolroot."/templates_c/";
+        array_unshift($this->plugins_dir, $globals->spoolroot."/plugins/");
+        $this->config_dir    = $globals->spoolroot."/configs/";
+
+        $this->compile_check = !empty($globals->debug);
+
+        if ($type == SKINNED) {
+            $this->register_modifier('escape_html', 'escape_html');
+            $this->default_modifiers[] = '@escape_html';
+        }
+
+        $this->_page_type = $type;
+        $this->_tpl       = $tpl;
+        $this->_errors    = new XOrgErrors;
+
+        $this->DiogenesCorePage();
+        $this->register_prefilter('at_to_globals');
+        $this->register_prefilter('trimwhitespace');
+        $this->addJsLink('javascript/xorg.js');
+
+        $this->doAuth();
+    }
+
+    // }}}
+    // {{{ function changeTpl()
+
+    function changeTpl($tpl, $type=SKINNED)
+    {
+       $this->_tpl       = $tpl;
+       $this->_page_type = $type;
+       if ($type == SKINNED) {
+           $this->register_modifier('escape_html', 'escape_html');
+           $this->default_modifiers = Array('@escape_html');
+       }
+
+        $this->_page_type = $type;
+       $this->assign('xorg_tpl', $tpl);
+    }
+
+    // }}}
+    // {{{ function _run()
+
+    function _run($skin)
+    {
+        global $globals, $TIME_BEGIN;
+        $this->assign("xorg_error", $this->_errors);
+        
+        if ($this->_page_type == NO_SKIN) {
+            $this->display($this->_tpl);
+            exit;
+        }
+        
+        $this->assign('menu', $globals->menu->menu());
+
+        if ($globals->debug) {
+
+            if ($globals->debug & 1) {
+                $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
+            }
+
+            $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
+            $result = $this->fetch($skin);
+            $ttime  = sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
+            $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
+
+            if ($globals->debug & 2) {
+
+                $fd = fopen($this->compile_dir."/valid.html","w");
+                fwrite($fd, $result);
+                fclose($fd);
+       
+                exec($globals->spoolroot."/bin/devel/xhtml.validate.pl ".$this->compile_dir."/valid.html", $val);
+                foreach ($val as $h) {
+                    if (preg_match("/^X-W3C-Validator-Errors: (\d+)$/", $h, $m)) {
+                        $replc = '<span style="color: #080;">HTML OK</span><br />';
+                        if ($m[1]) {
+                            $replc = "<span class='erreur'><a href='http://validator.w3.org/check?uri={$globals->baseurl}"
+                                ."/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />";
+                        }
+                        break;
+                    }
+                }
+            }
+
+            echo str_replace("@HOOK@", $ttime.$replc, $result);
+            exit;
+        }
+
+        $this->display($skin);
+        exit;
+    }
+
+    // }}}
+    // {{{ function run()
+
+    function run()
+    {
+        die ("implement me");
+    }
+
+    // }}}
+    // {{{ function nb_errs()
+
+    function nb_errs()
+    {
+        return count($this->_errors->errs);
+    }
+
+    // }}}
+    // {{{ function trig()
+
+    function trig($msg)
+    {
+        $this->_errors->trig($msg);
+    }
+
+    // }}}
+    // {{{ function trig()
+
+    function trig_run($msg)
+    {
+        $this->_errors->trig($msg);
+        $this->run();
+    }
+
+    // }}}
+    // {{{ function fail()
+
+    function fail($msg)
+    {
+        $this->_errors->fail($msg);
+    }
+
+    // }}}
+    // {{{ function kill()
+
+    function kill($msg)
+    {
+        $this->fail($msg);
+        $this->run();
+    }
+
+    // }}}
+    // {{{ function doAuth()
+
+    function doAuth() { }
+    
+    // }}}
+    // {{{ function loadModule()
+    
+    function loadModule($modname)
+    {
+        require_once("$modname.inc.php");
+    }
+
+    // }}}
+    // {{{ function addJsLink
+
+    function addJsLink($path)
+    {
+        $this->append('xorg_js', $path);
+    }
+
+    // }}}
+    // {{{ function addCssLink
+
+    function addCssLink($path)
+    {
+        $this->append('xorg_css', $path);
+    }
+
+    // }}}
+    // {{{ function gassign
+    
+    function gassign($varname)
+    {
+        global $$varname;
+        $this->assign($varname, $$varname);
+    }
+
+    // }}}
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
index 0b13485..891646d 100644 (file)
@@ -19,7 +19,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once('xorg/xml-rpc.inc.php');
+require_once('platal/xml-rpc.inc.php');
 
 /* taken from : http://fr2.php.net/xml-rpc
  * Author mboeren@php.net
diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php
new file mode 100644 (file)
index 0000000..5e37f76
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/***************************************************************************
+ *  Copyright (C) 2003-2004 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/page.inc.php');
+
+// {{{ class XnetPage
+
+class XnetPage extends PlatalPage
+{
+    // {{{ function XnetPage()
+
+    function XnetPage($tpl, $type=SKINNED)
+    {
+        $this->PlatalPage($tpl, $type);
+    }
+
+    // }}}
+    // {{{ function run()
+
+    function run()
+    {
+        $this->_run('xnet/skin.tpl');
+    }
+
+    // }}}
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
+?>
index 8a71162..cde232b 100644 (file)
@@ -21,8 +21,8 @@
 
 require_once('diogenes/diogenes.core.globals.inc.php');
 require_once('diogenes/diogenes.database.inc.php');
-require_once('xorg/iterator.inc.php');
-require_once('xorg/database.inc.php');
+require_once('platal/iterator.inc.php');
+require_once('platal/database.inc.php');
 
 // {{{ class CoreConfig
 
index a154039..6375c82 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-function microtime_float() 
-{ 
-    list($usec, $sec) = explode(" ", microtime()); 
-    return ((float)$usec + (float)$sec); 
-} 
-$TIME_BEGIN = microtime_float();
-
-// {{{ defines
-
-$i=0;
-define("AUTH_PUBLIC", $i++);
-define("AUTH_COOKIE", $i++);
-define("AUTH_MDP", $i++);
-
-define("PERMS_EXT", "ext");
-define("PERMS_USER", "user");
-define("PERMS_ADMIN", "admin");
-
-define('SKINNED', 0);
-define('NO_SKIN', 1);
-
-// }}}
-// {{{ globals + session init
-
-require_once('xorg/env.inc.php');
+require_once('platal.inc.php');
 require_once('xorg.globals.inc.php');
 require_once('xorg/session.inc.php');
 XorgGlobals::init();
 XorgSession::init();
 
-setlocale(LC_MESSAGES, $globals->core->locale);
-setlocale(LC_TIME,     $globals->core->locale);
-setlocale(LC_CTYPE,    $globals->core->locale);
-
-// }}}
-// {{{ fix magic quotes
-
-function fix_gpc_magic(&$item, $key) {
-    if (is_array($item)) {
-        array_walk($item, 'fix_gpc_magic');
-    } else {
-        $item = stripslashes($item);
-    }
-}
-
-function unfix_gpc_magic(&$item, $key) {
-    if (is_array($item)) {
-        array_walk($item, 'fix_gpc_magic');
-    } else {
-        $item = addslashes($item);
-    }
-}
-
-if (ini_get("magic_quotes_gpc")) {
-    array_walk($_GET, 'fix_gpc_magic');
-    array_walk($_POST, 'fix_gpc_magic');
-    array_walk($_COOKIE, 'fix_gpc_magic');
-    array_walk($_REQUEST, 'fix_gpc_magic');
-}
-
-// }}}
 // {{{ function _new_page()
 
 function _new_page($type, $tpl_name, $min_auth, $admin=false)
index cd4909a..014ec4b 100644 (file)
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
-require_once('diogenes/diogenes.core.page.inc.php');
-require_once('xorg/errors.inc.php');
-require_once('xorg/smarty.plugins.inc.php');
+require_once('platal/page.inc.php');
 
 // {{{ class XorgPage
 
-/**
- * This class is the Core template compiler
- *
- * @category XOrgCore
- * @package  XOrgCore
- * @author   Jeremy Lainé <jeremy.laine@polytechnique.org>
- * @access   public
- * @see      DiogenesCorePage
- */
-class XorgPage extends DiogenesCorePage
+class XorgPage extends PlatalPage
 {
-    // {{{ properties
-    
-    var $_page_type;
-    var $_tpl;
-    var $_errors;
-
-    // defaults
-    var $caching          = false;
-    var $config_overwrite = false;
-    var $use_sub_dirs     = false;
-
-    // }}}
     // {{{ function XorgPage()
 
     function XorgPage($tpl, $type=SKINNED)
     {
-        global $globals;
-
-        $this->template_dir  = $globals->spoolroot."/templates/";
-        $this->compile_dir   = $globals->spoolroot."/templates_c/";
-        array_unshift($this->plugins_dir, $globals->spoolroot."/plugins/");
-        $this->config_dir    = $globals->spoolroot."/configs/";
-
-        $this->compile_check = !empty($globals->debug);
-
-        if ($type == SKINNED) {
-            $this->register_modifier('escape_html', 'escape_html');
-            $this->default_modifiers[] = '@escape_html';
-        }
-
-        $this->_page_type = $type;
-        $this->_tpl       = $tpl;
-        $this->_errors    = new XOrgErrors;
-
-        $this->DiogenesCorePage();
-        $this->register_prefilter('at_to_globals');
-        $this->register_prefilter('trimwhitespace');
-        $this->addJsLink('javascript/xorg.js');
-
-        $this->doAuth();
-    }
-
-    // }}}
-    // {{{ function changeTpl()
-
-    function changeTpl($tpl, $type=SKINNED)
-    {
-       $this->_tpl       = $tpl;
-       $this->_page_type = $type;
-       if ($type == SKINNED) {
-           $this->register_modifier('escape_html', 'escape_html');
-           $this->default_modifiers = Array('@escape_html');
-       }
-
-        $this->_page_type = $type;
-       $this->assign('xorg_tpl', $tpl);
+        $this->PlatalPage($tpl, $type);
     }
 
     // }}}
@@ -99,132 +37,7 @@ class XorgPage extends DiogenesCorePage
 
     function run()
     {
-        global $globals, $TIME_BEGIN;
-        $this->assign("xorg_error", $this->_errors);
-        
-        if ($this->_page_type == NO_SKIN) {
-            $this->display($this->_tpl);
-            exit;
-        }
-        
-        $this->assign('menu', $globals->menu->menu());
-
-        if ($globals->debug) {
-
-            if ($globals->debug & 1) {
-                $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
-            }
-
-            $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
-            $result = $this->fetch('skin/'.Session::get('skin'));
-            $ttime  = sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
-            $replc  = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
-
-            if ($globals->debug & 2) {
-
-                $fd = fopen($this->compile_dir."/valid.html","w");
-                fwrite($fd, $result);
-                fclose($fd);
-       
-                exec($globals->spoolroot."/bin/devel/xhtml.validate.pl ".$this->compile_dir."/valid.html", $val);
-                foreach ($val as $h) {
-                    if (preg_match("/^X-W3C-Validator-Errors: (\d+)$/", $h, $m)) {
-                        $replc = '<span style="color: #080;">HTML OK</span><br />';
-                        if ($m[1]) {
-                            $replc = "<span class='erreur'><a href='http://validator.w3.org/check?uri={$globals->baseurl}"
-                                ."/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />";
-                        }
-                        break;
-                    }
-                }
-            }
-
-            echo str_replace("@HOOK@", $ttime.$replc, $result);
-            exit;
-        }
-
-        $this->display('skin/'.Session::get('skin'));
-        exit;
-    }
-
-    // }}}
-    // {{{ function nb_errs()
-
-    function nb_errs()
-    {
-        return count($this->_errors->errs);
-    }
-
-    // }}}
-    // {{{ function trig()
-
-    function trig($msg)
-    {
-        $this->_errors->trig($msg);
-    }
-
-    // }}}
-    // {{{ function trig()
-
-    function trig_run($msg)
-    {
-        $this->_errors->trig($msg);
-        $this->run();
-    }
-
-    // }}}
-    // {{{ function fail()
-
-    function fail($msg)
-    {
-        $this->_errors->fail($msg);
-    }
-
-    // }}}
-    // {{{ function kill()
-
-    function kill($msg)
-    {
-        $this->fail($msg);
-        $this->run();
-    }
-
-    // }}}
-    // {{{ function doAuth()
-
-    function doAuth() { }
-    
-    // }}}
-    // {{{ function loadModule()
-    
-    function loadModule($modname)
-    {
-        require_once("$modname.inc.php");
-    }
-
-    // }}}
-    // {{{ function addJsLink
-
-    function addJsLink($path)
-    {
-        $this->append('xorg_js', $path);
-    }
-
-    // }}}
-    // {{{ function addCssLink
-
-    function addCssLink($path)
-    {
-        $this->append('xorg_css', $path);
-    }
-
-    // }}}
-    // {{{ function gassign
-    
-    function gassign($varname)
-    {
-        global $$varname;
-        $this->assign($varname, $$varname);
+        $this->_run('skin/'.Session::get('skin'));
     }
 
     // }}}
index acc2292..848a8fc 100644 (file)
@@ -39,6 +39,6 @@ Nous conseillons tr
 <div class="erreur">{$err|smarty:nodefaults}</div>
 {/foreach}
 
-{if !$xorg_error->failure}{include file=$xorg_tpl}{/if}
+{if !$xorg_error->failure && $xorg_tpl}{include file=$xorg_tpl}{/if}
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index 79d4e95..0bbe150 100644 (file)
     <meta name="keywords" content="Ecole polytechnique, anciens eleves, portail, alumni, AX, X, routage, reroutage, e-mail, email, mail" />
     <link rel="icon" type="image/png" href="images/favicon.png" />
     
-    <link rel="index" href="{"index.php"|url}" />
-    <link rel="author" href="{"docs/faq.php"|url}" />
-    <link rel="search" href="{"search.php"|url}" />
-    <link rel="help" href="{"docs/faq.php"|url}" />
+    <link rel="index" href="{rel}/index.php" />
+    <link rel="author" href="{rel}/docs/faq.php" />
+    <link rel="search" href="{rel}/search.php" />
+    <link rel="help" href="{rel}/docs/faq.php" />
     <link rel="bookmark" href="http://www.polytechnique.fr/"        title="| École polytechnique" />
     <link rel="bookmark" href="http://www.polytechnique.edu/"       title="| Institutionnal site" />
     <link rel="bookmark" href="http://www.fondationx.org/"          title="| FX" />
index feb71c2..b38b80a 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index c35f845..50713c5 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index b4f40c1..d4a6def 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index 8b02aa9..5eb72a8 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index cecf488..03b4769 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index 02bebf0..42384c7 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index fba2b8c..b781cda 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index c12002f..d4ab2bc 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index 68f2b1c..6978cf4 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index a546ba4..b0057b2 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index 191ae87..7972f57 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
index 704e416..6b6a26c 100644 (file)
@@ -17,7 +17,6 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************}
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
diff --git a/templates/xnet/skin.tpl b/templates/xnet/skin.tpl
new file mode 100644 (file)
index 0000000..952734e
--- /dev/null
@@ -0,0 +1,117 @@
+{***************************************************************************
+ *  Copyright (C) 2003-2004 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                *
+ ***************************************************************************}
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+
+    <title>Les associations polytechniciennes</title>
+    <meta name="description" content="Les associations polytechniciennes" />
+    <meta name="keywords" content="Ecole polytechnique, associations polytechniciennes, groupes X, binets" />
+    <link rel="stylesheet" type="text/css" href="{rel}/css/xnet.css" media="screen" />
+    <link rel="icon" type="image/png" href="{rel}/images/favicon.png" />
+
+    <link rel="bookmark" href="http://www.polytechnique.fr/"        title="| École polytechnique" />
+    <link rel="bookmark" href="http://www.polytechnique.edu/"       title="| Institutionnal site" />
+    <link rel="bookmark" href="http://www.fondationx.org/"          title="| FX" />
+    <link rel="bookmark" href="http://www.polytechniciens.com/"     title="| AX" />
+    <link rel="bookmark" href="http://www.polytechnique.org/"       title="| Polytechnique.org" />
+    <link rel="bookmark" href="http://www.polytechnique.fr/eleves/" title="| Site d'élèves" />
+
+    {foreach from=$xorg_css item=css}
+    <link rel="stylesheet" type="text/css" href="{rel}/{$css}" />
+    {/foreach}
+    {foreach from=$xorg_js item=js}
+    <script type="text/javascript" src="{rel}/{$js}"></script>
+    {/foreach}
+    <script type="text/javascript" src="{rel}/javascript/overlib.js"></script>
+    
+    {include file=skin/common.bandeau.head.tpl}
+  </head>
+  <body onload='pa_onload()'>
+    {include file=skin/common.devel.tpl}
+    {include file=skin/common.bandeau.tpl}
+
+{assign var=type value=plan}
+    <table id="layout" cellspacing="0" cellpadding="0">
+      <tr>
+        <td>
+          <a href="{rel}/index.php"><img src="{rel}/images/asso-montants.png" alt="Logo Assos" /></a>
+        </td>
+        <td>
+          <img src="{rel}/images/logo_{$type}.png" alt="Logo {$type}" width="106" height="96" />
+        </td>
+        <td>
+          <img src="{rel}/images/texte_{$type}.jpg" alt="{$type}" width="490" height="96" />
+        </td>
+      </tr>
+
+      <tr>
+        <td colspan="3">
+          {include file="skin/common.content.tpl"}
+        </td>
+      </tr>
+
+      <tr><td colspan="3"><img src="{rel}/images/barre.png" alt="----------" width="765" /></td></tr>
+
+      <tr>
+        <td colspan="3">
+<strong>IF LOGGED PRINT LIST OF ASSOCES</strong> OR <strong>TODO : IF NOT LOGGED PRINT LOGIN</strong>
+        </td>
+      </tr>
+
+      <tr>
+        <td colspan="3" id="search">
+          <form method="get" action="{rel}/recherche.php">
+            <div>
+              <a href="{rel}/agenda.php" title="Informations"><img src="{rel}/images/infos.png" alt="infos" /></a>
+              <a href="{rel}/manuel.php" title="Manuel d'aide en ligne"><img src="{rel}/images/manuel.png" alt="manuel" /></a>
+              <input type="text" name="query" value="echo ((isset($exalead_data))?($exalead_data->query->query)" size="25" maxlength="60" />
+              <input type="image" src="{rel}/images/recherche.png" title="Chercher" value="submit" />
+
+              <br />
+              <strong><a href="http://www.exalead.com/">Powered by</a></strong>
+              <a href="http://www.exalead.com/"><img src="{rel}/images/Exalead-logo-Carved-100.gif" alt="exalead" /></a>
+            </div>
+          </form>
+        </td>
+      </tr>
+
+      <tr><td colspan="3"><img src="{rel}/images/barre.png" alt="----------" width="765" /></td></tr>
+
+      <tr>
+        <td colspan="3" id="credits">
+          <a href="{rel}/index.php">page d'accueil</a> -
+          <a href="{rel}/plan.php">liste des associations</a> -
+          <a href="{rel}/services.php">services proposés</a> -
+          <a href="{rel}/apropos.php">à propos de ce site</a> -
+          <a href="https://www.polytechnique.org/">polytechnique.org</a> -
+          {mailto address="contact@polytechnique.org" text="nous contacter" encode="javascript"}
+          <br />
+          © Copyright 2000-2004 <a href="http://x-org.polytechnique.org/">Association Polytechnique.org</a>
+        </td>
+      </tr>
+
+    </table>
+  </body>
+</html>
+{* vim:set et sw=2 sts=2 sws=2: *}