summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorSimon2011-04-08 14:28:58 +0200
committerSimon2011-04-08 14:28:58 +0200
commitb8c98e142e9fc23058a51b603a8536df62f2930f (patch)
tree6fd78a14ae9361ef604c118a847c256efc37a338 /library
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.tar.gz
pbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.tar.xz
pbs2-b8c98e142e9fc23058a51b603a8536df62f2930f.zip
Endlosschleifen bei falschen Einträgen gefixt
Diffstat (limited to 'library')
-rw-r--r--library/Pbs/Graph.php7
-rw-r--r--library/Pbs/Pagination.php2
2 files changed, 8 insertions, 1 deletions
diff --git a/library/Pbs/Graph.php b/library/Pbs/Graph.php
index 3b20cea..521275d 100644
--- a/library/Pbs/Graph.php
+++ b/library/Pbs/Graph.php
@@ -7,6 +7,7 @@ class Pbs_Graph{
private $graphstring;
private $level;
private $edges;
+ private $crawledNodes;
public function graph($groupID)
{
@@ -40,6 +41,9 @@ class Pbs_Graph{
}
private function getParentGroups($groupID, $level=1) {
+ if($this->crawledNodes['parent'][$groupID] == 1)
+ return;
+ $this->crawledNodes['parent'][$groupID] = 1;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT parentID FROM pbs_groupgroups WHERE groupID="'.$groupID.'"';
$stmt = $db->query($query);
@@ -58,6 +62,9 @@ class Pbs_Graph{
// Gets all childs-groups from a given group
private function getChildGroups($groupID, $level=1) {
+ if($this->crawledNodes['child'][$groupID] == 1)
+ return;
+ $this->crawledNodes['child'][$groupID] = 1;
$db = Zend_Db_Table::getDefaultAdapter();
$query = 'SELECT groupID FROM pbs_groupgroups WHERE parentID="'.$groupID.'"';
$stmt = $db->query($query);
diff --git a/library/Pbs/Pagination.php b/library/Pbs/Pagination.php
index c31dacf..0be192c 100644
--- a/library/Pbs/Pagination.php
+++ b/library/Pbs/Pagination.php
@@ -74,7 +74,7 @@ class Pbs_Pagination{
return $this->requestpage * $this->perpage;
}
public function getElements(){
- return array_slice($this->element,$this->getStartItem(),$this->getPerPage());
+ return array_slice($this->element,$this->getStartItem(),$this->getPerPage(),true);
}
public function setPageUrl($url){
$this->pageUrl = $url;