summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/StatsController.php6
-rw-r--r--application/modules/user/layouts/user.phtml2
-rw-r--r--library/Pbs/Graph.php12
3 files changed, 15 insertions, 5 deletions
diff --git a/application/controllers/StatsController.php b/application/controllers/StatsController.php
index 3aee1d2..253c843 100644
--- a/application/controllers/StatsController.php
+++ b/application/controllers/StatsController.php
@@ -11,11 +11,15 @@ class StatsController extends Zend_Controller_Action
public function graphgroupAction(){
- $userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ $userIDsNamespace = Zend_Session::namespaceGet('userIDs');
if($userIDsNamespace['groupID'] !=''){
header("Content-Type: image/png");
$n = new Pbs_Graph();
+ $level = $this->_request->getParam('level');
+ if(is_numeric($level) && $level != ''){
+ $n->setHiglightLevel($level);
+ }
$str = $n->graph($userIDsNamespace['groupID']);
echo $str;
}
diff --git a/application/modules/user/layouts/user.phtml b/application/modules/user/layouts/user.phtml
index e2e424d..ae07f4d 100644
--- a/application/modules/user/layouts/user.phtml
+++ b/application/modules/user/layouts/user.phtml
@@ -77,7 +77,7 @@ echo $this->headScript()."\n";
<div id="head-titlebar">
<div style='float:right'><?php
if(Zend_Auth::getInstance()->hasIdentity()){
- echo 'Angemeldet als: ';
+ echo 'Angemeldet als ';
$userIDsNamespace = Zend_Session::namespaceGet('userIDs');
$membershipMapper = new Application_Model_MembershipMapper();
$membership = new Application_Model_Membership();
diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php
index df36ac4..c3f7139 100644
--- a/library/Pbs/Graph.php
+++ b/library/Pbs/Graph.php
@@ -5,12 +5,12 @@ class Pbs_Graph{
private $db = null;
private $membership;
private $graphstring;
+ private $level;
public function graph($groupID)
{
$this->db = Zend_Db_Table::getDefaultAdapter();
- $db = $this->db;
-
+ $db = $this->db;
$this->graphstring = 'digraph groups {
@@ -46,7 +46,7 @@ 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";
+ $this->graphstring .= '"'.$this->getGroupTitle($row['parentID']).'" -> "'.$this->getGroupTitle($groupID).'";'."\n";
// get the function recursive an increase the level
$this->getParentGroups($row['parentID'], $level+1);
}
@@ -62,8 +62,14 @@ class Pbs_Graph{
// save the current groupID in level-list
#$data[$level][] = $row['groupID'];
$this->graphstring .= '"'.$this->getGroupTitle($groupID).'" -> "'.$this->getGroupTitle($row['groupID']).'";'."\n";
+ if($this->level >= $level){
+ $this->graphstring .= '"'.$this->getGroupTitle($row['groupID']).'"'.' [ fontcolor="#ffffffff", style=filled, fillcolor="#004A99FF"];'."\n";
+ }
// get the function recursive an increase the level
$this->getChildGroups($row['groupID'], $level+1);
}
}
+ public function setHiglightLevel($i){
+ $this->level = $i;
+ }
}