Add a generic way to catch some informations from the subject...
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Wed, 12 Jul 2006 14:16:38 +0000 (14:16 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:54 +0000 (00:34 +0100)
Useful for crossposts

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@87 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/spool.inc.php

index d8171fe..e9e81f8 100644 (file)
@@ -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 .= '<span class="cur">'.htmlentities($subject).'</span>';
+                $res .= '<span class="cur">' . $subject . $link . '</span>';
             } else {
                 $res .= makeHREF(Array('group' => $this->group,
                                        'artid' => $_id),
-                                 htmlentities($subject),
-                                 htmlentities($subject));
+                                 $subject,
+                                 $subject)
+                     . $link;
             }
             $res .= "</td>\n<td class='from'>".formatFrom($this->overview[$_id]->from)."</td>\n</tr>";