Add ability to add a text at the end of the branches.
[banana.git] / banana / tree.inc.php
index 6a3d1cc..0f66d67 100644 (file)
@@ -40,7 +40,7 @@ class BananaTree
 
     /** Construct a new tree from a given root
      */
-    public function __construct(BananaSpoolHead &$root)
+    public function __construct(BananaSpoolHead $root)
     {
         if (empty($root->children)) {
             $this->data = null;
@@ -52,7 +52,7 @@ class BananaTree
         $this->saveToFile($root->id);
     }
 
-    private function &builder(BananaSpoolHead &$head)
+    private function &builder(BananaSpoolHead $head)
     {
         $array = array(array($head->id));
         $this->urls[$head->id]  = banana_entities(Banana::$page->makeURL(array('group' => Banana::$group,
@@ -124,6 +124,7 @@ class BananaTree
         $text = '<div class="tree">';
         foreach ($this->data as &$line) {
             $text .= '<div style="height: 18px">';
+            unset($head);
             foreach ($line as &$item) {
                 if ($item == ' ') {
                     $text .= $t_e;
@@ -142,9 +143,13 @@ class BananaTree
                     if (Banana::$artid == $item) {
                         $text .= ' checked="checked"';
                     }
+                    $last_title = $head->subject;
                     $text .= '/></span>';
                 }
             }
+            if (function_exists('hook_spoolTagBranch') && isset($head)) {
+                $text .= hook_spoolTagBranch($head);
+            }
             $text .= "</div>\n";
         }
         $text .= '</div>';