From 4ef5ef67e07245296fe73d3948d9526338bced63 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 14 Apr 2011 13:39:56 +0200 Subject: Ticket #207 - Graph wird beim verlinken angezeigt --- library/Pbs/Graph.php | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'library') diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php index e42b9d4..664c078 100644 --- a/library/Pbs/Graph.php +++ b/library/Pbs/Graph.php @@ -8,6 +8,7 @@ class Pbs_Graph{ private $level; private $edges; private $crawledNodes; + private $childs = array(); public function graph($groupID) { @@ -25,6 +26,13 @@ class Pbs_Graph{ node [ style=filled fillcolor="#ffffffff" ]; "'.$this->getGroupTitle($groupID).'" [ fontcolor="#ffffffff", style=filled, fillcolor="#004A99FF"]; '; + if(count($this->childs) >=1){ + foreach($this->childs as $childID){ + $this->edges[$groupID][$childID] = 1; + $this->graphstring .= '"'.$this->getGroupTitle($groupID).'" -> "'.$this->getGroupTitle($childID).'";'."\n"; + $this->getChildGroups($childID); + } + } $this->getParentGroups($groupID); $this->getChildGroups($groupID); $this->graphstring .= '}'; @@ -73,6 +81,9 @@ class Pbs_Graph{ $groupmapper->find($groupID,$group); return $group->getTitle(); } + public function newChild($id){ + $this->childs[] = $id; + } private function getParentGroups($groupID, $level=1) { if($this->crawledNodes['parent'][$groupID] == 1) -- cgit v1.2.3-55-g7522