X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fbanana%2Fhooks.inc.php;h=cd963045535512e7fb30250111dd01a93b211e4b;hb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;hp=aa449177ba96a9157e40cda85d5d08938a7ba66a;hpb=edfdbe40a2eb4cd9b576214613431b32975baf84;p=platal.git diff --git a/include/banana/hooks.inc.php b/include/banana/hooks.inc.php index aa44917..cd96304 100644 --- a/include/banana/hooks.inc.php +++ b/include/banana/hooks.inc.php @@ -1,6 +1,6 @@ id()); if ($res->numRows()) { + // User wants his xface to be showed, fallback to default handler return false; } } @@ -209,7 +214,7 @@ function make_Organization() global $globals; $perms = S::v('perms'); $group = $globals->asso('nom'); - if (S::has_perms()) { + if (S::admin()) { return "Administrateur de Polytechnique.org"; } else if ($group && $perms->hasFlag('groupadmin')) { return "Animateur de $group"; @@ -290,7 +295,7 @@ class PlatalBananaPage extends BananaPage { $tpl = parent::prepare(); global $wiz; - $wiz = new PlWizard('Banana', 'core/plwizard.tpl', true, false); + $wiz = new PlWizard('Banana', PlPage::getCoreTpl('plwizard.tpl'), true, false); foreach ($this->pages as $name=>&$mpage) { $wiz->addPage($this->handler, $mpage['text'], $name); } @@ -314,7 +319,9 @@ class BananaHandler { } - public function process() + public function success() { } + + public function process(&$success) { return PlWizard::CURRENT_PAGE; } @@ -322,7 +329,8 @@ class BananaHandler function run_banana(&$page, $class, array $args) { - $banana = new $class(S::v('forlife'), $args); + $user = S::user(); + $banana = new $class($user, $args); $page->assign('banana', $banana->run()); $page->addCssInline($banana->css()); $page->addCssLink('banana.css');