* Search:
- Search Engine IE7 compatible -FRU
+ * Xnetgrp:
+ - Direct access to the group forum (if exists) -FRU
+
Bug/Wish:
* Banana:
li { padding-left: 3px; padding-right: 3px;
text-align: justify; }
hr { text-align: center; }
+dt { font-weight: bold; }
fieldset {
border-top: 1px solid #fff;
#body-bottom {
- border-top: 1px solid #fff;
+ border-top: 1px solid #aaa;
text-align: center;
padding: 4px;
font-size: 75%;
$time, S::i('uid'));
}
- // Register custom Banana links and tabs
- if (!Banana::$profile['autoup']) {
- Banana::$page->registerAction('<a href=\'javascript:dynpostkv("'
- . $platal->path . '", "updateall", ' . time() . ')\'>'
- . 'Marquer tous les messages comme lus'
- . '</a>', array('forums', 'thread', 'message'));
- }
- Banana::$page->registerPage('profile', 'Préférences', null);
-
+ if (!empty($GLOBALS['IS_XNET_SITE'])) {
+ Banana::$page->killPage('forums');
+ Banana::$page->killPage('subscribe');
+ Banana::$spool_boxlist = false;
+ } else {
+ // Register custom Banana links and tabs
+ if (!Banana::$profile['autoup']) {
+ Banana::$page->registerAction('<a href=\'javascript:dynpostkv("'
+ . $platal->path . '", "updateall", ' . time() . ')\'>'
+ . 'Marquer tous les messages comme lus'
+ . '</a>', array('forums', 'thread', 'message'));
+ }
+ Banana::$page->registerPage('profile', 'Préférences', null);
+ }
// Run Banana
return parent::run();
return '<img src="' . $url . '"' . $height . $width . ' alt="' . $alt . '" />';
}
+if (!function_exists('hook_makeLink')) {
function hook_makeLink($params)
{
global $globals, $platal;
- if (Banana::$protocole->name() == 'NNTP') {
+ $xnet = !empty($GLOBALS['IS_XNET_SITE']);
+ $feed = (@$params['action'] == 'rss' || @$params['action'] == 'rss2' || @$params['action'] == 'atom');
+ if (Banana::$protocole->name() == 'NNTP' && !$xnet) {
$base = $globals->baseurl . '/banana';
- if (@$params['action'] == 'rss' || @$params['action'] == 'rss2' || @$params['action'] == 'atom') {
+ if ($feed) {
return $base . hook_platalRSS(@$params['group']);
}
if (isset($params['page'])) {
return $base;
}
$base .= '/' . $params['group'];
+ } else if (Banana::$protocole->name() == 'NNTP' && $xnet) {
+ if ($feed) {
+ return 'http://www.polytechnique.org/banana' . hook_platalRSS(@$params['group']);
+ }
+ $base = $globals->baseurl . '/' . $platal->ns . 'forum';
} else if (Banana::$protocole->name() == 'MLArchives') {
$base = $globals->baseurl . '/' . $platal->ns . 'lists/archives';
- if (@$params['action'] == 'rss' || @$params['action'] == 'rss2' || @$params['action'] == 'atom') {
+ if ($feed) {
return $base . hook_platalRSS(MLBanana::$listname);
}
$base .= '/' . MLBanana::$listname;
}
return $base;
}
+}
+
+function get_banana_params(array &$get, $group = null, $action = null, $artid = null)
+{
+ if (!is_null($group)) {
+ $get['group'] = $group;
+ }
+ if (!is_null($action)) {
+ if ($action == 'new') {
+ $get['action'] = 'new';
+ } elseif (!is_null($artid)) {
+ $get['artid'] = $artid;
+ if ($action == 'reply') {
+ $get['action'] = 'new';
+ } elseif ($action == 'cancel') {
+ $get['action'] = $action;
+ } elseif ($action == 'from') {
+ $get['first'] = $artid;
+ unset($get['artid']);
+ } elseif ($action == 'read') {
+ $get['part'] = @$_GET['part'];
+ } elseif ($action == 'source') {
+ $get['part'] = 'source';
+ } elseif ($action == 'xface') {
+ $get['part'] = 'xface';
+ } elseif ($action) {
+ $get['part'] = str_replace('.', '/', $action);
+ }
+ if (Get::v('action') == 'showext') {
+ $get['action'] = 'showext';
+ }
+ }
+ }
+}
+
+function run_banana(&$page, $class, array $args)
+{
+ $banana = new $class($args);
+ $page->assign('banana', $banana->run());
+ $page->addCssInline($banana->css());
+ $page->addCssLink('banana.css');
+ $rss = $banana->feed();
+ if ($rss) {
+ if (Banana::$group) {
+ $page->setRssLink('Banana :: ' . Banana::$group, $rss);
+ } else {
+ $page->setRssLink('Banana :: Abonnements', $rss);
+ }
+ }
+ $bt = $banana->backtrace();
+ if ($bt) {
+ new PlBacktrace(Banana::$protocole->name(), $banana->backtrace(), 'response', 'time');
+ }
+}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
static public $domain;
static public $client;
- function __construct($params = null, &$client)
+ function __construct($params = null)
{
global $globals;
- ModerationBanana::$client = $client;
+ ModerationBanana::$client = $params['client'];
ModerationBanana::$listname = $params['listname'];
ModerationBanana::$domain = isset($params['domain']) ? $params['domain'] : $globals->mail->domain;
$params['group'] = ModerationBanana::$listname . '@' . ModerationBanana::$domain;
$sub['trombinoscope'] = "$dim/trombi";
$sub['carte'] = "$dim/geoloc";
}
- if ((is_member() || may_update()) && $globals->asso('mail_domain')) {
- $sub['listes de diffusion'] = "$dim/lists";
+ if (is_member() || may_update()) {
+ if ($globals->asso('forum')) {
+ $sub['forum'] = "$dim/forum";
+ }
+ if ($globals->asso('mail_domain')) {
+ $sub['listes de diffusion'] = "$dim/lists";
+ }
}
$sub['événement'] = "$dim/events";
if (may_update() || is_member()) {
function handler_banana(&$page, $group = null, $action = null, $artid = null)
{
+ $page->changeTpl('banana/index.tpl');
+ $page->assign('xorg_title','Polytechnique.org - Forums & PA');
+
$get = Array();
- if (!is_null($group)) {
- $get['group'] = $group;
- }
if (Post::has('updateall')) {
$get['updateall'] = Post::v('updateall');
}
- if (!is_null($action)) {
- if ($action == 'new') {
- $get['action'] = 'new';
- } elseif (!is_null($artid)) {
- $get['artid'] = $artid;
- if ($action == 'reply') {
- $get['action'] = 'new';
- } elseif ($action == 'cancel') {
- $get['action'] = $action;
- } elseif ($action == 'from') {
- $get['first'] = $artid;
- unset($get['artid']);
- } elseif ($action == 'read') {
- $get['part'] = @$_GET['part'];
- } elseif ($action == 'source') {
- $get['part'] = 'source';
- } elseif ($action == 'xface') {
- $get['part'] = 'xface';
- } elseif ($action) {
- $get['part'] = str_replace('.', '/', $action);
- }
- }
- }
- return BananaModule::run_banana($page, $get);
+ require_once 'banana/forum.inc.php';
+ get_banana_params($get, $group, $action, $artid);
+ run_banana($page, 'ForumsBanana', $get);
}
function handler_profile(&$page, $action = null)
function handler_subscription(&$page)
{
- return $this->run_banana($page, Array('action' => 'subscribe'));
+ $page->changeTpl('banana/index.tpl');
+ $page->assign('xorg_title','Polytechnique.org - Forums & PA');
+
+ require_once 'banana/forum.inc.php';
+ run_banana($page, 'ForumsBanana', Array('action' => 'subscribe'));
}
function handler_rss(&$page, $group, $alias, $hash, $file = null)
require_once 'banana/forum.inc.php';
$banana = new ForumsBanana(array('group' => $group, 'action' => 'rss2'));
- echo $banana->run();
+ $banana->run();
exit;
}
$page->assign('xorg_title','Polytechnique.org - Forums & PA');
require_once 'banana/forum.inc.php';
-
- $banana = new ForumsBanana($params);
- $res = $banana->run();
- $page->assign_by_ref('banana', $banana);
- $page->assign('banana_res', $res);
- $page->addCssInline($banana->css());
- $page->addCssLink('banana.css');
- $rss = $banana->feed();
- if ($rss) {
- if (@$params['group']) {
- $page->setRssLink('Banana :: ' . $params['group'], $rss);
- } else {
- $page->setRssLink('Banana :: Abonnements', $rss);
- }
- }
- new PlBacktrace('NNTP', $banana->backtrace(), 'response', 'time');
+ run_banana($page, 'ForumsBanana', $params);
}
}
if (Post::has('updateall')) {
$get['updateall'] = Post::v('updateall');
}
- if (!is_null($action)) {
- if ($action == 'new') {
- $get['action'] = 'new';
- } elseif (!is_null($artid)) {
- $get['artid'] = $artid;
- if ($action == 'reply') {
- $get['action'] = 'new';
- } elseif ($action == 'cancel') {
- $get['action'] = $action;
- } elseif ($action == 'from') {
- $get['first'] = $artid;
- unset($get['artid']);
- } elseif ($action == 'read') {
- $get['part'] = @$_GET['part'];
- } elseif ($action == 'source') {
- $get['part'] = 'source';
- } elseif ($action == 'xface') {
- $get['part'] = 'xface';
- } elseif ($action) {
- $get['part'] = str_replace('.', '/', $action);
- }
- if (Get::v('action') == 'showext') {
- $get['action'] = 'showext';
- }
- }
- }
- require_once('banana/ml.inc.php');
- $banana = new MLBanana($get);
- $page->assign('banana', $banana->run());
- $page->addCssInline($banana->css());
- $page->addCssLink('banana.css');
- $rss = $banana->feed();
- if ($rss) {
- $page->setRssLink('Banana :: ' . $list, $rss);
- }
- new PlBacktrace('MBox', $banana->backtrace(), 'response', 'time');
+ require_once 'banana/ml.inc.php';
+ get_banana_params($get, null, $action, $artid);
+ run_banana($page, 'MLBanana', $get);
} else {
$page->kill("La liste n'existe pas ou tu n'as pas le droit de la consulter");
}
}
require_once('banana/ml.inc.php');
$banana = new MLBanana(Array('listname' => $liste, 'domain' => $domain, 'action' => 'rss2'));
- echo $banana->run();
+ $banana->run();
}
exit;
}
}
} elseif (Env::has('mid')) {
if (Get::has('mid') && !Env::has('mok') && !Env::has('mdel')) {
+ $page->changeTpl('lists/moderate_mail.tpl');
require_once('banana/moderate.inc.php');
$params = array('listname' => $liste, 'domain' => $domain,
'artid' => Get::i('mid'), 'part' => Get::v('part'), 'action' => Get::v('action'));
- $banana = new ModerationBanana($params, $this->client);
- $res = $banana->run();
- $page->addCssInline($banana->css());
+ $params['client'] = $this->client;
+ run_banana($page, 'ModerationBanana', $params);
$msg = file_get_contents('/etc/mailman/fr/refuse.txt');
$msg = str_replace("%(adminaddr)s", "$liste-owner@{$domain}", $msg);
$msg = str_replace("%(reason)s", "<< TON EXPLICATION >>", $msg);
$msg = str_replace("%(listname)s", $liste, $msg);
$page->assign('msg', $msg);
-
- $page->addCssLink('banana.css');
- $this->changeTpl('lists/moderate_mail.tpl');
- $page->assign_by_ref('mail', $res);
return;
}
'%grp/logo' => $this->make_hook('logo', AUTH_PUBLIC),
'%grp/edit' => $this->make_hook('edit', AUTH_MDP),
'%grp/mail' => $this->make_hook('mail', AUTH_MDP),
+ '%grp/forum' => $this->make_hook('forum', AUTH_MDP),
'%grp/annuaire' => $this->make_hook('annuaire', AUTH_MDP),
'%grp/annuaire/vcard' => $this->make_hook('vcard', AUTH_MDP),
'%grp/trombi' => $this->make_hook('trombi', AUTH_MDP),
}
}
+ function handler_forum(&$page, $group = null, $artid = null)
+ {
+ global $globals;
+ new_group_page('xnetgrp/forum.tpl');
+ if (!$globals->asso('forum')) {
+ return PL_NOT_FOUND;
+ }
+ require_once 'banana/forum.inc.php';
+ $get = array();
+ get_banana_params($get, $globals->asso('forum'), $group, $artid);
+ run_banana($page, 'ForumsBanana', $get);
+ }
+
function handler_annuaire(&$page)
{
global $globals;
{**************************************************************************}
<br />
-{$banana_res|smarty:nodefaults}
+{$banana|smarty:nodefaults}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
Contenu du mail en attente
</h1>
-{$mail|smarty:nodefaults}
+{$banana|smarty:nodefaults}
<form method='post' action='{$platal->pl_self(1)}'>
<table class='tinybicol' cellpadding='0' cellspacing='0'>
Forum:
</td>
<td>
- <a href="https://www.polytechnique.org/banana/{$asso.forum}">par le web</a>
+ <a href="{$platal->ns}forum">par le web</a>
ou <a href="news://ssl.polytechnique.org/{$asso.forum}">par nntp</a>
</td>
</tr>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2007 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h1>{$asso.nom} : Forum</h1>
+
+{$banana|smarty:nodefaults}
+
+<p>
+ Cette page utiliser les <a href="https://www.polytechnique.org/banana/profile">préférences</a> de Polytechnique.org.<br />
+ Tu peux également retrouver tous les forums en te rendant à la rubrique
+ <a href="https://www.polytechnique.org/banana">Forums & PA</a>
+</p>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}