- /** displays children tree of a post
- * @param $_id INTEGER MSGNUM of post
- * @param $_index INTEGER linear number of post in the tree
- * @param $_first INTEGER linear number of first post displayed
- * @param $_last INTEGER linear number of last post displayed
- * @param $_ref STRING MSGNUM of current post
- * @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_formatDisplayHeader
- */
- private function _to_html($_id, $_index, $_first=0, $_last=0, $_ref="", $_pfx_node="", $_pfx_end="", $_head=true, $_pfx_id="")
- {
- static $spfx_f, $spfx_n, $spfx_Tnd, $spfx_Lnd, $spfx_snd, $spfx_T, $spfx_L, $spfx_s, $spfx_e, $spfx_I;
- if (!isset($spfx_f)) {
- $spfx_f = Banana::$page->makeImg(Array('img' => 'k1', 'alt' => 'o', 'height' => 21, 'width' => 9));
- $spfx_n = Banana::$page->makeImg(Array('img' => 'k2', 'alt' => '*', 'height' => 21, 'width' => 9));
- $spfx_Tnd = Banana::$page->makeImg(Array('img' => 'T-direct', 'alt' => '+', 'height' => 21, 'width' => 12));
- $spfx_Lnd = Banana::$page->makeImg(Array('img' => 'L-direct', 'alt' => '`', 'height' => 21, 'width' => 12));
- $spfx_snd = Banana::$page->makeImg(Array('img' => 's-direct', 'alt' => '-', 'height' => 21, 'width' => 5));
- $spfx_T = Banana::$page->makeImg(Array('img' => 'T', 'alt' => '+', 'height' => 21, 'width' => 12));
- $spfx_L = Banana::$page->makeImg(Array('img' => 'L', 'alt' => '`', 'height' => 21, 'width' => 12));
- $spfx_s = Banana::$page->makeImg(Array('img' => 's', 'alt' => '-', 'height' => 21, 'width' => 5));
- $spfx_e = Banana::$page->makeImg(Array('img' => 'e', 'alt' => ' ', 'height' => 21, 'width' => 12));
- $spfx_I = Banana::$page->makeImg(Array('img' => 'I', 'alt' => '|', 'height' => 21, 'width' => 12));
- }
-
- $overview =& $this->overview[$_id];
- if ($_index + $overview->desc < $_first || $_index > $_last) {
- return '';
- }
-
- $res = '';
- if ($_index >= $_first) {
- $hc = empty($overview->children);
-
- $res .= '<tr id="'.$_pfx_id.$_id.'" class="' . ($_index%2 ? 'pair' : 'impair') . ($overview->isread ? '' : ' new') . "\">\n";
- $res .= '<td class="date">' . $this->formatDate($overview->date) . " </td>\n";
- $res .= '<td class="subj' . ($_index == $_ref ? ' cur' : '') . '"><div class="tree">'
- . $_pfx_node .($hc ? ($_head ? $spfx_f : ($overview->parent_direct ? $spfx_s : $spfx_snd)) : $spfx_n)
- . '</div>';
- $popup = $subject = $overview->subject;
- if (function_exists('hook_formatDisplayHeader')) {
- list($subject, $link) = hook_formatDisplayHeader('subject', $subject, true);
- } else {
- $subject = banana_catchFormats(banana_entities(stripslashes($subject)));
- $link = null;
- }
- if (empty($subject)) {
- $subject = _b_('(pas de sujet)');
- }
- if ($_index != $_ref) {
- $subject = Banana::$page->makeLink(Array('group' => $this->group, 'artid' => $_id,
- 'text' => $subject, 'popup' => $popup));
- }
- $res .= ' ' . $subject . $link;
- $res .= "</td>\n<td class='from'>" . BananaMessage::formatFrom($overview->from) . "</td>\n</tr>";