From 956724f02ae833a6d8fb02d663a4f1a881a7182e Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Wed, 5 Oct 2011 18:01:26 +0200 Subject: Bootos API public Feld wird nun auch berücksichtigt --- application/controllers/ResourceController.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'application') diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index ecc021c..1487b61 100755 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -884,6 +884,8 @@ class ResourceController extends Zend_Controller_Action } } else { $bootos = $bootosMapper->findBy(array('groupid' => $groupID)); + $childBootos = $this->getbootosOfChildGroups($groupID, 1); + $bootos = array_merge($bootos, $childBootos); } if($bootos == null){ @@ -940,6 +942,25 @@ class ResourceController extends Zend_Controller_Action echo $xml; } + private function getbootosOfChildGroups($groupID, $depth) { + $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); + $results = $groupgroupsMapper->findBy(array('parentID' => $groupID)); + $bootosMapper = new Application_Model_BootOsMapper(); + if(count($results)) { + $bootos = array(); + foreach($results as $result) { + $newbootos = $bootosMapper->findBy(array("groupID" => $result->getGroupID(), "public" => $depth)); + if(count($newbootos)) { + $bootos = array_merge($bootos, $newbootos); + } + $bootos = array_merge($bootos, $this->getbootosOfChildGroups($result->getGroupID(), $depth + 1)); + } + return $bootos; + } else { + return array(); + } + } + public function getpoolAction() { list($rightroles1) = $this->rightrolesMapper->findBy(array('rightID' => '79', 'roleID' => $this->membership->getRoleID())); if($rightroles1 == null){ @@ -1374,4 +1395,4 @@ class ResourceController extends Zend_Controller_Action return $path; } -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522