Wiki selection is done by the Platal class.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 20 Mar 2010 13:54:02 +0000 (14:54 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 20 Mar 2010 14:00:17 +0000 (15:00 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/xnet.php
classes/xorg.php
core
htdocs/xnet.php
htdocs/xorg.php
include/xnet.inc.php
include/xorg.inc.php
modules/xnet.php

index 9983aba..4d0437f 100644 (file)
@@ -23,8 +23,8 @@ class Xnet extends Platal
 {
     public function __construct()
     {
-        $modules = func_get_args();
-        parent::__construct($modules);
+        parent::__construct('xnet', 'xnetgrp', 'xnetlists', 'xnetevents',
+                            'payment', 'bandeau');
 
         global $globals;
         if ($globals->asso()) {
index 827aa0f..83bc952 100644 (file)
 
 class Xorg extends Platal
 {
+    public function __construct()
+    {
+        parent::__construct('auth', 'carnet', 'email', 'events', 'forums',
+                            'lists', 'marketing', 'payment', 'platal',
+                            'profile', 'register', 'search', 'stats', 'admin',
+                            'newsletter', 'axletter', 'bandeau', 'survey',
+                            'fusionax', 'gadgets', 'googleapps', 'poison',
+                            'openid', 'reminder');
+    }
+
+    public function find_hook()
+    {
+        if ($this->path{0} >= 'A' && $this->path{0} <= 'Z') {
+            return self::wiki_hook();
+        }
+        return parent::find_hook();
+    }
+
     public function force_login(PlPage &$page)
     {
         header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');
diff --git a/core b/core
index ff539a0..fd669a5 160000 (submodule)
--- a/core
+++ b/core
@@ -1 +1 @@
-Subproject commit ff539a07a4f86dbb19f43afb190102bdd8d8cf95
+Subproject commit fd669a5756eb8607006d19575956a2f6ea1508ce
index a530688..8b4e795 100644 (file)
  ***************************************************************************/
 
 $GLOBALS['IS_XNET_SITE'] = true;
-
 require_once dirname(__FILE__).'/../include/xnet.inc.php';
-
-$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'payment', 'bandeau');
-if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') {
-    $platal->run();
-    exit;
-}
-
-/*** WIKI CODE ***/
-
-include pl_core_include('wiki.engine.inc.php');
+require_once pl_core_include('run.inc.php');
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index 3c27ba2..c8e4fc6 100644 (file)
  ***************************************************************************/
 
 require_once dirname(__FILE__).'/../include/xorg.inc.php';
-
-$platal = new Xorg('auth', 'carnet', 'email', 'events', 'forums',
-                   'lists', 'marketing', 'payment', 'platal',
-                   'profile', 'register', 'search', 'stats', 'admin',
-                   'newsletter', 'axletter', 'bandeau', 'survey',
-                   'fusionax', 'gadgets', 'googleapps', 'poison',
-                   'openid', 'reminder');
-
-if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) {
-    $platal->run();
-    exit;
-}
-
-/*** WIKI CODE ***/
-
-include pl_core_include('wiki.engine.inc.php');
+require_once pl_core_include('run.inc.php');
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>
index cc6fc5b..391162b 100644 (file)
@@ -19,6 +19,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+define('PL_CLASS', 'Xnet');
 define('PL_GLOBALS_CLASS', 'PlatalGlobals');
 define('PL_LOGGER_CLASS', 'PlatalLogger');
 define('PL_SESSION_CLASS', 'XnetSession');
index 9d9b592..cd6f6ff 100644 (file)
@@ -19,6 +19,7 @@
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************/
 
+define('PL_CLASS', 'Xorg');
 define('PL_GLOBALS_CLASS', 'PlatalGlobals');
 define('PL_LOGGER_CLASS', 'PlatalLogger');
 define('PL_SESSION_CLASS', 'XorgSession');
index 7edb674..9ad297a 100644 (file)
@@ -33,6 +33,8 @@ class XnetModule extends PLModule
             'plan'        => $this->make_hook('plan',      AUTH_PUBLIC),
             'photo'       => $this->make_hook('photo',     AUTH_MDP),
             'autologin'   => $this->make_hook('autologin', AUTH_MDP),
+
+            'Xnet'        => $this->make_wiki_hook(),
         );
     }