X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fbanana%2Fhooks.inc.php;h=f0a23620e65e071e3fa687cbcb421de440c1d82e;hb=7464a978a670655106ed51d811afa3c2c993f2ed;hp=ed55ec035ea19b2fdaa0a1b18bb400506b15f441;hpb=45319df1e1765047535c950a525c76fbeda48df0;p=platal.git diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index ed55ec0..f0a2362 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -1,6 +1,6 @@ handler = 'BananaHandler'; + $this->base = $platal->pl_self(0); + parent::__construct(); + } + + protected function prepare() + { + $tpl = parent::prepare(); + global $wiz, $page; + $wiz = new PlWizard('Banana', 'core/plwizard.tpl', true, false); + foreach ($this->pages as $name=>&$mpage) { + $wiz->addPage($this->handler, $mpage['text'], $name); + } + $wiz->apply($page, $this->base, $this->page); + return $tpl; + } +} + +class BananaHandler +{ + public function __construct(PlWizard &$wiz) + { + } + + public function template() + { + return 'banana/index.tpl'; + } + + public function prepare(PlatalPage &$page, $id) + { + } + + public function process() + { + return PlWizard::CURRENT_PAGE; + } +} + function run_banana(&$page, $class, array $args) { $banana = new $class(S::v('forlife'), $args);