diff options
author | Simon | 2011-04-08 14:04:07 +0200 |
---|---|---|
committer | Simon | 2011-04-08 14:04:07 +0200 |
commit | e242fc0729b326637ebd4d3602aa604341bdbb03 (patch) | |
tree | f28edb11fc21955f6ce45f8df1b6a9dca2addf7e /library/Pbs | |
parent | highlight in Bootmenu gefixt und das default-Bootmenu bekomtm kein Link zum s... (diff) | |
download | pbs2-e242fc0729b326637ebd4d3602aa604341bdbb03.tar.gz pbs2-e242fc0729b326637ebd4d3602aa604341bdbb03.tar.xz pbs2-e242fc0729b326637ebd4d3602aa604341bdbb03.zip |
graph nun auch mit mehreren gleihen kindern
Diffstat (limited to 'library/Pbs')
-rw-r--r-- | library/Pbs/Graph.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php index 1431c70..3b20cea 100644 --- a/library/Pbs/Graph.php +++ b/library/Pbs/Graph.php @@ -6,6 +6,7 @@ class Pbs_Graph{ private $membership; private $graphstring; private $level; + private $edges; public function graph($groupID) { @@ -46,7 +47,10 @@ class Pbs_Graph{ foreach($result as $row){ // save the current groupID in level-list #$data[$level][] = $row['parentID']; - $this->graphstring .= '"'.$this->getGroupTitle($row['parentID']).'" -> "'.$this->getGroupTitle($groupID).'";'."\n"; + if($this->edges[$row['parentID']][$groupID] != 1){ + $this->graphstring .= '"'.$this->getGroupTitle($row['parentID']).'" -> "'.$this->getGroupTitle($groupID).'";'."\n"; + $this->edges[$row['parentID']][$groupID] = 1; + } // get the function recursive an increase the level $this->getParentGroups($row['parentID'], $level+1); } @@ -61,7 +65,10 @@ class Pbs_Graph{ foreach($result as $row){ // save the current groupID in level-list #$data[$level][] = $row['groupID']; - $this->graphstring .= '"'.$this->getGroupTitle($groupID).'" -> "'.$this->getGroupTitle($row['groupID']).'";'."\n"; + if($this->edges[$groupID][$row['groupID']] != 1){ + $this->graphstring .= '"'.$this->getGroupTitle($groupID).'" -> "'.$this->getGroupTitle($row['groupID']).'";'."\n"; + $this->edges[$groupID][$row['groupID']] = 1; + } if($this->level >= $level){ $this->graphstring .= '"'.$this->getGroupTitle($row['groupID']).'"'.' [ fontcolor="#ffffffff", style=filled, fillcolor="#004A99FF"];'."\n"; } |