From: x2003bruneau Date: Sat, 13 Jan 2007 14:35:59 +0000 (+0000) Subject: Remove "hook_getSubject", use a new param of hook_formatDisplayHeader instead X-Git-Tag: 1.8~138 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=b87c9103f471bdf7d7640ce7fb5d063ea79e90e6;p=banana.git Remove "hook_getSubject", use a new param of hook_formatDisplayHeader instead git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@161 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/message.inc.php b/banana/message.inc.php index 295af5b..17fcf5c 100644 --- a/banana/message.inc.php +++ b/banana/message.inc.php @@ -107,12 +107,8 @@ final class BananaMessage extends BananaMimePart return $rsl; case "subject": - $link = null; $text = stripslashes($text); - if (function_exists('hook_getSubject')) { - $link = hook_getSubject($text); - } - return banana_catchFormats($text) . $link; + return banana_catchFormats($text); default: return $text; diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 73641e6..505c2c1 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -49,7 +49,7 @@ class BananaSpoolHead public function __construct(array &$message) { $this->date = $message['date']; - $this->subject = stripslashes($message['subject']); + $this->subject = $message['subject']; $this->from = $message['from']; $this->desc = 1; $this->isread = true; @@ -395,9 +395,7 @@ class BananaSpool * @param $_pfx_end STRING prefix used for children of current node * @param $_head BOOLEAN true if first post in thread * - * If you want to analyse subject, you can define the function hook_getSubject(&$subject) which - * take the subject as a reference parameter, transform this subject to be displaid in the spool - * view and return a string. This string will be put after the subject. + * If you want to analyse subject, you can define the function hook_formatDisplayHeader */ private function _to_html($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true) { @@ -429,14 +427,15 @@ class BananaSpool $res .= '' . $_pfx_node .($hc ? ($_head ? $spfx_f : ($overview->parent_direct ? $spfx_s : $spfx_snd)) : $spfx_n); $subject = $overview->subject; + if (function_exists('hook_formatDisplayHeader')) { + list($subject, $link) = hook_formatDisplayHeader('subject', $subject, true); + } else { + $subject = banana_catchFormats(stripslashes($subject)); + $link = null; + } if (empty($subject)) { $subject = _b_('(pas de sujet)'); } - $link = null; - if (function_exists('hook_getSubject')) { - $link = hook_getSubject($subject); - } - $subject = banana_catchFormats($subject); if ($_index != $_ref) { $subject = Banana::$page->makeLink(Array('group' => $this->group, 'artid' => $_id, 'text' => $subject, 'popup' => $subject));