begin to work on xnet a bit.
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 22:00:39 +0000 (22:00 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 13 Jul 2006 22:00:39 +0000 (22:00 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@470 839d8a87-29fc-0310-9880-83ba4fa771e5

htdocs.net/.htaccess [new file with mode: 0644]
htdocs.net/index.php
include/xnet.inc.php
modules/xnet.php [new file with mode: 0644]

diff --git a/htdocs.net/.htaccess b/htdocs.net/.htaccess
new file mode 100644 (file)
index 0000000..73d78b6
--- /dev/null
@@ -0,0 +1,13 @@
+Options +FollowSymLinks
+RewriteEngine on
+
+RewriteBase /~x2000habouzit
+
+# wiki
+
+RewriteRule ^([A-Z].*) wiki.php?n=$1 [L,QSA]
+
+# Rewrite URLs of the form 'index.php?q=x':
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]
index c8eb659..83f93a2 100644 (file)
@@ -1,6 +1,30 @@
 <?php
-    require 'xnet.inc.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 'xnet.inc.php';
+
+require_once dirname(__FILE__).'/../classes/Platal.php';
+require_once dirname(__FILE__).'/../classes/PLModule.php';
+
+$platal = new Platal('xnet');
+$platal->run();
 
-    new_page('xnet/index.tpl', AUTH_PUBLIC);
-    $page->run();
 ?>
index b31c15e..93724d8 100644 (file)
@@ -43,6 +43,11 @@ function new_page($tpl_name, $min_auth)
     $page->assign('xorg_tpl', $tpl_name);
 }
 
+function new_skinned_page($tpl_name, $min_auth)
+{
+    return new_page($tpl_name, $min_auth);
+}
+
 // }}}
 function new_identification_page()
 {
diff --git a/modules/xnet.php b/modules/xnet.php
new file mode 100644 (file)
index 0000000..5314c59
--- /dev/null
@@ -0,0 +1,38 @@
+<?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                *
+ ***************************************************************************/
+
+class XnetModule extends PLModule
+{
+    function handlers()
+    {
+        return array(
+            'index' => $this->make_hook('index', AUTH_PUBLIC),
+        );
+    }
+
+    function handler_index(&$page)
+    {
+        $page->changeTpl('xnet/index.tpl');
+        return PL_OK;
+    }
+}
+
+?>