From e2347ffcdc46ceeb3136e2ac7620dd0163d74ed5 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Wed, 12 Jul 2006 14:16:38 +0000 Subject: [PATCH] Add a generic way to catch some informations from the subject... Useful for crossposts git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@87 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/spool.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/banana/spool.inc.php b/banana/spool.inc.php index d8171fe..e9e81f8 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -309,6 +309,10 @@ class BananaSpool * @param $_pfx_node STRING prefix used for current node * @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. */ function _to_html($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true) @@ -342,13 +346,19 @@ class BananaSpool if (strlen($subject) == 0) { $subject = _b_('(pas de sujet)'); } + $link = null; + if (function_exists('hook_getSubject')) { + $link = hook_getSubject($subject); + } + $subject = htmlentities($subject); if ($_index == $_ref) { - $res .= ''.htmlentities($subject).''; + $res .= '' . $subject . $link . ''; } else { $res .= makeHREF(Array('group' => $this->group, 'artid' => $_id), - htmlentities($subject), - htmlentities($subject)); + $subject, + $subject) + . $link; } $res .= "\n".formatFrom($this->overview[$_id]->from)."\n"; -- 2.1.4