static public $spool_tmax = 10;
static public $spool_boxlist = true;
+### Tree options ###
+ static public $tree_read = 'dg';
+ static public $tree_unread = 'b';
+
### Message processing ###
static public $msgparse_headers = array('content-disposition', 'content-transfer-encoding',
'content-type', 'content-id', 'date', 'followup-to',
if ($pageclass == 'BananaPage') {
Banana::load('page');
}
- Banana::$page = new $pageclass;
+ Banana::$page = new $pageclass(@$this->params['output']);
$types = array('multipart/report' => _b_('Rapport d\'erreur'),
'multipart/mixed' => _b_('Composition'),
'text/html' => _b_('Texte formaté'),
$groups = Banana::$protocole->getBoxList(Banana::BOXES_SUB, Banana::$profile['lastnews'], true);
Banana::$page->assign('groups', $groups);
}
+ if (function_exists('hook_markAsRead')) {
+ hook_markAsRead($group, $artid, $msg);
+ }
Banana::$page->assign_by_ref('message', $msg);
Banana::$page->assign('extimages', Banana::$msgshow_hasextimages);
Banana::$page->assign('headers', Banana::$msgshow_headers);
$hdr_values[$header] = utf8_encode($hdr_values[$header]);
}
}
- $values = split('[,; ]', $hdr_values[$hdrs['dest']]);
+ $values = preg_split('/[,; ]/', $hdr_values[$hdrs['dest']]);
$hdr_values[$hdrs['dest']] = preg_replace('/,+/', ',', implode(',', $values));
if (!is_null($artid)) {
$old =& $this->loadMessage($group, $artid);
} else {
if (!is_null($artid)) {
$msg =& $this->loadMessage($group, $artid);
- $body = $msg->getSender() . _b_(' a écrit :') . "\n" . $msg->quote();
+ $body = $msg->quote();
+
+ if (isset($_POST['reply'])) {
+ $res = '';
+ $body = explode("\n", $body);
+ $replies = $_POST['reply'];
+ ksort($replies);
+ $previous = 0;
+ foreach ($replies as $line => $data) {
+ if (!is_array($data)) {
+ $data = array('quote' => $previous, 'text' => $data);
+ } else if (!isset($data['quote'])) {
+ $data['quote'] = $previous;
+ } else if ($data['quote'] < $previous) {
+ $data['quote'] = $previous;
+ }
+ $res .= implode("\n", array_slice($body, $data['quote'], $line - $data['quote'] + 1));
+ $res .= "\n\n" . $data['text'] . "\n\n";
+ $previous = $line + 1;
+ }
+ $body = $res;
+ }
+ $body = $msg->getSender() . _b_(' a écrit :') . "\n" . $body;
+
$subject = $msg->getHeaderValue('subject');
$headers['Subject']['user'] = 'Re: ' . preg_replace("/^re\s*:\s*/i", '', $subject);
$target = $msg->getHeaderValue($hdrs['reply']);
}
if (isset($_POST['cancel'])) {
$this->loadSpool($group);
- $ndx = Banana::$spool->getNdX($id) - 1;
if (!Banana::$protocole->cancel($msg)) {
return _b_('Une erreur s\'est produite lors de l\'annulation du message :') . '<br />'
. Banana::$protocole->lastError();
}
- if ($ndx < 50) {
- $ndx = 0;
- }
$this->removeMessage($group, $artid);
- Banana::$page->redirect(Array('group' => $group, 'first' => $ndx));
+ Banana::$page->redirect(Array('group' => $group));
}
Banana::$page->assign_by_ref('message', $msg);
{
Banana::load('spool');
if (!Banana::$spool || Banana::$spool->group != $group) {
- $clean = false;
- if (php_sapi_name() != 'cli') {
- if ($group == @$_SESSION['banana_group'] && isset($_SESSION['banana_spool'])) {
- Banana::$spool = unserialize($_SESSION['banana_spool']);
- $clean = @(Banana::$profile['lastnews'] != $_SESSION['banana_lastnews']);
- } else {
- unset($_SESSION['banana_message']);
- unset($_SESSION['banana_artid']);
- unset($_SESSION['banana_showhdr']);
- }
- }
- BananaSpool::getSpool($group, Banana::$profile['lastnews'], Banana::$profile['autoup'] || $clean);
- if (php_sapi_name() != 'cli') {
- $_SESSION['banana_group'] = $group;
- if (!Banana::$profile['display']) {
- $_SESSION['banana_spool'] = serialize(Banana::$spool);
- $_SESSION['banana_lastnews'] = Banana::$profile['lastnews'];
- }
- }
+ BananaSpool::getSpool($group, Banana::$profile['lastnews'], Banana::$profile['autoup']);
Banana::$spool->setMode(Banana::$profile['display'] ? Banana::SPOOL_UNREAD : Banana::SPOOL_ALL);
}
return true;
&& isset($_SESSION['banana_message'])) {
$message = unserialize($_SESSION['banana_message']);
Banana::$msgshow_headers = $_SESSION['banana_showhdr'];
- } else {
+ } else {
$message = Banana::$protocole->getMessage($artid);
$_SESSION['banana_group'] = $group;
$_SESSION['banana_artid'] = $artid;
return true;
}
- static private function load($file)
+ static public function load($file)
{
$file = strtolower($file) . '.inc.php';
if (!@include_once dirname(__FILE__) . "/$file") {
}
}
-// vim:set et sw=4 sts=4 ts=4 enc=utf-8:
+// vim:set et sw=4 sts=4 ts=4 fenc=utf-8:
?>