Moving to GitHub.
[platal.git] / modules / platal.php
index 3c4776a..1772921 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2011 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -59,6 +59,8 @@ class PlatalModule extends PLModule
             'exit'              => $this->make_hook('exit',         AUTH_PUBLIC),
             'review'            => $this->make_hook('review',       AUTH_PUBLIC),
             'deconnexion.php'   => $this->make_hook('exit',         AUTH_PUBLIC),
+
+            'error'             => $this->make_hook('test_error',   AUTH_COOKIE),
         );
     }
 
@@ -610,7 +612,16 @@ Adresse de secours : ' . $to));
         }
         $wiz->apply($page, 'review', $action, $mode);
     }
+
+    function handler_test_error($page, $mode = null)
+    {
+        if ($mode == 'js') {
+            $page->changeTpl('platal/error.tpl');
+        } else {
+            throw new Exception("Blih");
+        }
+    }
 }
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>