Show the post subject in the 'message'-tab
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Fri, 2 Nov 2007 20:31:33 +0000 (20:31 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:58 +0000 (00:35 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@303 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/page.inc.php

index 2d8abf6..40fd970 100644 (file)
@@ -112,7 +112,17 @@ class BananaPage extends Smarty
         if (!is_null(Banana::$group)) {
             $this->registerPage('thread', Banana::$group, null);
             if (!is_null(Banana::$artid)) {
-                $this->registerPage('message', _b_('Message'), null);
+                if (Banana::$spool) {
+                    $subject = Banana::$spool->overview[Banana::$artid]->subject;
+                } else if (Banana::$message) {
+                    $subject = Banana::$message->getHeaderValue('subject');
+                } else {
+                    $subject = _b_('Message');
+                }
+                if (strlen($subject) > 30) {
+                    $subject = substr($subject, 0, 30) . '…';
+                }
+                $this->registerPage('message', $subject, null);
                 if ($this->page == 'cancel') {
                     $this->registerPage('cancel', _b_('Annulation'), null);
                 } elseif ($this->page == 'new') {