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é'),
} 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']);
&& 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;
}
}
-// vim:set et sw=4 sts=4 ts=4 enc=utf-8:
+// vim:set et sw=4 sts=4 ts=4 fenc=utf-8:
?>