Rename PlatalPage to PlPage
[platal.git] / include / banana / hooks.inc.php
index ef22186..987de13 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -230,6 +230,9 @@ function get_banana_params(array &$get, $group = null, $action = null, $artid =
         $action = 'read';
         $group  = S::v('banana_group');
         $artid  = S::i('banana_artid');
+    } else if ($action == 'message') {
+        $action = 'read';
+        $artid  = S::i('banana_artid');
     } else if ($group == 'subscribe' || $group == 'subscription') {
         $group  = null;
         $action = null;
@@ -272,9 +275,15 @@ function get_banana_params(array &$get, $group = null, $action = null, $artid =
 
 class PlatalBananaPage extends BananaPage
 {
+    protected $handler;
+    protected $base;
+
     public function __construct()
     {
+        global $platal;
         Banana::$withtabs = false;
+        $this->handler = 'BananaHandler';
+        $this->base    = $platal->pl_self(0);
         parent::__construct();
     }
 
@@ -284,13 +293,9 @@ class PlatalBananaPage extends BananaPage
         global $wiz, $page;
         $wiz = new PlWizard('Banana', 'core/plwizard.tpl', true, false);
         foreach ($this->pages as $name=>&$mpage) {
-            if ($text == 'profile') {
-                $wiz->addPage('BananaProfile', $mpage['text'], $name);
-            } else {
-                $wiz->addPage('BananaHandler', $mpage['text'], $name);
-            }
+            $wiz->addPage($this->handler, $mpage['text'], $name);
         }
-        $wiz->apply($page, 'banana', $this->page);
+        $wiz->apply($page, $this->base, $this->page);
         return $tpl;
     }
 }
@@ -306,7 +311,7 @@ class BananaHandler
         return 'banana/index.tpl';
     }
 
-    public function prepare(PlatalPage &$page, $id)
+    public function prepare(PlPage &$page, $id)
     {
     }