summaryrefslogtreecommitdiffstats
path: root/library/Pbs/Graph.php
diff options
context:
space:
mode:
Diffstat (limited to 'library/Pbs/Graph.php')
-rw-r--r--library/Pbs/Graph.php11
1 files changed, 11 insertions, 0 deletions
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)