2999659820063dc9b88dbd70bda3bab91e84143a
2 /***************************************************************************
3 * Copyright (C) 2003-2008 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 class ForumsModule
extends PLModule
27 'banana' => $this->make_hook('banana', AUTH_COOKIE
),
28 'banana/rss' => $this->make_hook('rss', AUTH_PUBLIC
, 'user', NO_HTTPS
),
29 'admin/forums' => $this->make_hook('forums_bans', AUTH_MDP
, 'admin'),
33 function handler_banana(&$page, $group = null
, $action = null
, $artid = null
)
35 $page->changeTpl('banana/index.tpl');
36 $page->setTitle('Forums & PA');
39 if (Post
::has('updateall')) {
40 $get['updateall'] = Post
::v('updateall');
42 require_once 'banana/forum.inc.php';
43 get_banana_params($get, $group, $action, $artid);
44 run_banana($page, 'ForumsBanana', $get);
47 function handler_rss(&$page, $group, $alias, $hash, $file = null
)
53 $this->handler_rss($page, null
, $group, $alias, $hash);
55 $user = Platal
::session()->tokenAuth($alias, $hash);
60 require_once 'banana/forum.inc.php';
61 $banana = new ForumsBanana($user, array('group' => $group, 'action' => 'rss2'));
66 function handler_forums_bans(&$page, $action = 'list', $id = null
)
68 $page->setTitle('Administration - Bannissements des forums');
69 $page->assign('title', 'Gestion des mises au ban');
70 $table_editor = new PLTableEditor('admin/forums','forums.innd','id_innd');
71 $table_editor->add_sort_field('priority', true
, true
);
72 $table_editor->describe('read_perm','lecture',true
);
73 $table_editor->describe('write_perm','écriture',true
);
74 $table_editor->describe('priority','priorité',true
);
75 $table_editor->describe('comment','commentaire',true
);
76 $table_editor->apply($page, $action, $id);
77 $page->changeTpl('forums/admin.tpl');
78 $page->addJsLink('jquery.js');
81 static function run_banana(&$page, $params = null
)
83 $page->changeTpl('banana/index.tpl');
84 $page->setTitle('Forums & PA');
86 require_once 'banana/forum.inc.php';
87 run_banana($page, 'ForumsBanana', $params);
91 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: