- $res .= '<tr 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' : '') . '">'
- . $_pfx_node .($hc ? ($_head ? $spfx_f : ($overview->parent_direct ? $spfx_s : $spfx_snd)) : $spfx_n);
- $subject = $overview->subject;
- 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));
- }
- $res .= ' ' . $subject . $link;
- $res .= "</td>\n<td class='from'>" . BananaMessage::formatFrom($overview->from) . "</td>\n</tr>";
-
- if ($hc) {
- return $res;
- }
- }
-
- $_index ++;
- $children = $overview->children;
- while ($child = array_shift($children)) {
- $overview =& $this->overview[$child];
- if ($_index > $_last) {
- return $res;
- }
- if ($_index + $overview->desc >= $_first) {
- if (sizeof($children)) {
- $res .= $this->_to_html($child, $_index, $_first, $_last, $_ref,
- $_pfx_end . ($overview->parent_direct ? $spfx_T : $spfx_Tnd),
- $_pfx_end . $spfx_I, false);
+ private function &_buildTree(BananaSpoolHead &$head) {
+ static $t_e, $u_h, $u_ht, $u_vt, $u_l, $u_f, $r_h, $r_ht, $r_vt, $r_l, $r_f;
+ if (!isset($spfx_f)) {
+ $t_e = Banana::$page->makeImg(Array('img' => 'e', 'alt' => ' ', 'height' => 18, 'width' => 14));
+ $u_h = Banana::$page->makeImg(Array('img' => 'h2', 'alt' => '-', 'height' => 18, 'width' => 14));
+ $u_ht = Banana::$page->makeImg(Array('img' => 'T2', 'alt' => '+', 'height' => 18, 'width' => 14));
+ $u_vt = Banana::$page->makeImg(Array('img' => 't2', 'alt' => '`', 'height' => 18, 'width' => 14));
+ $u_l = Banana::$page->makeImg(Array('img' => 'l2', 'alt' => '|', 'height' => 18, 'width' => 14));
+ $u_f = Banana::$page->makeImg(Array('img' => 'f2', 'alt' => 't', 'height' => 18, 'width' => 14));
+ $r_h = Banana::$page->makeImg(Array('img' => 'h2r', 'alt' => '-', 'height' => 18, 'width' => 14));
+ $r_ht = Banana::$page->makeImg(Array('img' => 'T2r', 'alt' => '+', 'height' => 18, 'width' => 14));
+ $r_vt = Banana::$page->makeImg(Array('img' => 't2r', 'alt' => '`', 'height' => 18, 'width' => 14));
+ $r_l = Banana::$page->makeImg(Array('img' => 'l2r', 'alt' => '|', 'height' => 18, 'width' => 14));
+ $r_f = Banana::$page->makeImg(Array('img' => 'f2r', 'alt' => 't', 'height' => 18, 'width' => 14));
+ }
+ $style = 'background-color:' . $head->color . '; text-decoration: none';
+ $text = '<span style="' . $style . '" title="' . banana_entities($head->name . ', ' . $this->formatDate($head))
+ . '"><input type="radio" name="banana_tree" '
+ . (Banana::$msgshow_javascript ? 'onchange="window.location=\'' .
+ banana_entities(Banana::$page->makeURL(array('group' => $this->group, 'artid' => $head->id))) . '\'"'
+ : ' disabled="disabled"')
+ . ' /></span>';
+ $array = array($text);
+ foreach ($head->children as $key=>&$msg) {
+ $tree =& $this->_buildTree($msg);
+ $last = $key == count($head->children) - 1;
+ foreach ($tree as $kt=>&$line) {
+ if ($kt === 0 && $key === 0 && !$last) {
+ $array[0] .= ($msg->isread ? $r_ht : $u_ht) . $line;
+ } else if($kt === 0 && $key === 0) {
+ $array[0] .= ($msg->isread ? $r_h : $u_h) . $line;
+ } else if ($kt === 0 && $last) {
+ $array[] = $t_e . ($msg->isread ? $r_vt : $u_vt) . $line;
+ } else if ($kt === 0) {
+ $array[] = $t_e . ($msg->isread ? $r_f : $u_f) . $line;
+ } else if ($last) {
+ $array[] = $t_e . $t_e . $line;