Revert "Prepare the future..."
[platal.git] / modules / platal.php
index 0489b10..0824f2b 100644 (file)
@@ -64,6 +64,8 @@ class PlatalModule extends PLModule
     {
         if (S::logged()) {
             pl_redirect('events');
+        } else if (!@$GLOBALS['IS_XNET_SITE']) {
+            pl_redirect('review');
         }
     }
 
@@ -85,6 +87,7 @@ class PlatalModule extends PLModule
         $page->changeTpl('platal/changeLog.tpl');
 
         $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog'));
+        $clog = preg_replace('/=+\s*/', '</pre><hr /><pre>', $clog);
         // url catch only (not all wiki syntax)
         $clog = preg_replace(array(
             '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
@@ -97,6 +100,7 @@ class PlatalModule extends PLModule
           $clog);
         $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
         $clog = preg_replace('!vim:.*$!', '', $clog);
+        $clog = preg_replace("!(<hr />(\\s|\n)*)?<pre>(\s|\n)*</pre>((\\s|\n)*<hr />)?!m", "", "<pre>$clog</pre>");
         $page->assign('ChangeLog', $clog);
     }
 
@@ -419,9 +423,10 @@ Adresse de secours : " . Post::v('email') : ""));
         }
     }
 
-    function handler_review(&$page, $action = null) 
+    function handler_review(&$page, $action = null, $mode = null
     {
         require_once 'wiki.inc.php';
+        require_once dirname(__FILE__) . '/platal/review.inc.php';
         $dir = wiki_work_dir();
         $dom = 'Review';
         if (@$GLOBALS['IS_XNET_SITE']) {
@@ -440,18 +445,9 @@ Adresse de secours : " . Post::v('email') : ""));
             $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
             $wiz->addPage('ReviewPage', $list[0], $list[1]);
         }
-        $wiz->apply($page, 'review', $action);
+        $wiz->apply($page, 'review', $action, $mode);
     }
 }
 
-__autoload('PlWizard');
-class ReviewPage implements PlWizardPage
-{
-    public function __construct(PlWizard &$wiz) { }
-    public function template() { return 'platal/index.tpl'; }
-    public function prepare(PlatalPage &$page) { }
-    public function process() { }
-}
-
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
 ?>