X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fbanana%2Fhooks.inc.php;h=d8cd9f1ea30fd5e0fee9f4cea20492daa5499a80;hb=e0ee31204dbb8e43870716190e4549257416fcb8;hp=48107036778acb00d473ac7b5c1570080ddec4b0;hpb=d300e6f3c06716732f92799d0bf288b0ec1d1491;p=platal.git diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index 4810703..d8cd9f1 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -1,6 +1,6 @@ addJsLink("$src.js"); + Platal::page()->addJsLink("$src.js"); return ' '; } @@ -230,6 +229,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; @@ -287,12 +289,12 @@ class PlatalBananaPage extends BananaPage protected function prepare() { $tpl = parent::prepare(); - global $wiz, $page; - $wiz = new PlWizard('Banana', 'core/plwizard.tpl', true, false); + global $wiz; + $wiz = new PlWizard('Banana', PlPage::getCoreTpl('plwizard.tpl'), true, false); foreach ($this->pages as $name=>&$mpage) { $wiz->addPage($this->handler, $mpage['text'], $name); } - $wiz->apply($page, $this->base, $this->page); + $wiz->apply(Platal::page(), $this->base, $this->page); return $tpl; } } @@ -308,7 +310,7 @@ class BananaHandler return 'banana/index.tpl'; } - public function prepare(PlatalPage &$page, $id) + public function prepare(PlPage &$page, $id) { } @@ -320,7 +322,7 @@ class BananaHandler function run_banana(&$page, $class, array $args) { - $banana = new $class(S::v('forlife'), $args); + $banana = new $class(S::user(), $args); $page->assign('banana', $banana->run()); $page->addCssInline($banana->css()); $page->addCssLink('banana.css');