From: Florent Bruneau Date: Fri, 2 Nov 2007 16:25:00 +0000 (+0100) Subject: Added support for ML archives for PlWizard powered banana X-Git-Tag: xorg/0.9.16~238 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=d300e6f3c06716732f92799d0bf288b0ec1d1491;p=platal.git Added support for ML archives for PlWizard powered banana Signed-off-by: Florent Bruneau --- diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index ef22186..4810703 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -272,9 +272,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 +290,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; } } diff --git a/include/banana/ml.inc.php b/include/banana/ml.inc.php index 1d72b5d..5370476 100644 --- a/include/banana/ml.inc.php +++ b/include/banana/ml.inc.php @@ -22,6 +22,25 @@ require_once 'banana/banana.inc.php'; require_once 'banana/hooks.inc.php'; +class PlatalBananaMLPage extends PlatalBananaPage +{ + public function __construct() + { + parent::__construct(); + global $platal; + $this->handler = 'BananaMLHandler'; + $this->base = $platal->pl_self(1); + } +} + +class BananaMLHandler extends BananaHandler +{ + public function template() + { + return 'lists/archives.tpl'; + } +} + class MLBanana extends Banana { static public $listname; @@ -47,7 +66,7 @@ class MLBanana extends Banana MLBanana::$listname = $params['listname']; MLBanana::$domain = $params['domain']; $params['group'] = $params['listname'] . '@' . $params['domain']; - parent::__construct($params, 'MLArchive'); + parent::__construct($params, 'MLArchive', 'PlatalBananaMLPage'); } public function run()