diff options
| author | michael pereira | 2011-04-07 02:20:20 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-07 02:20:20 +0200 |
| commit | 169dd00f24dbce4c2828980a868c39115021a374 (patch) | |
| tree | 97b7546dc8b61f496dd6b69aa408d907f8bf6eac /application/modules/user/controllers/BootmenuController.php | |
| parent | neues Design eingebettet, bei Role, Person &Group muss noch etwas überlegt w... (diff) | |
| download | pbs2-169dd00f24dbce4c2828980a868c39115021a374.tar.gz pbs2-169dd00f24dbce4c2828980a868c39115021a374.tar.xz pbs2-169dd00f24dbce4c2828980a868c39115021a374.zip | |
Bootos und Configs in Bootmenuentry categorisiert
Diffstat (limited to 'application/modules/user/controllers/BootmenuController.php')
| -rw-r--r-- | application/modules/user/controllers/BootmenuController.php | 58 |
1 files changed, 53 insertions, 5 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index 560b9a5..77f509c 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -247,9 +247,31 @@ class user_BootmenuController extends Zend_Controller_Action $bootosMapper = new Application_Model_BootOsMapper(); $configMapper = new Application_Model_ConfigMapper(); - $bootoslist = $bootosMapper->fetchAll(); - $configlist = $configMapper->fetchAll(); - + $groupMapper = new Application_Model_GroupMapper(); + + $groupID = $this->membership->getGroupID(); + $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); + + $parents = array(); + $bootoslist = array(); + $parents = $groupgroupsMapper->getParentGroups($groupID); + + foreach($parents as $k => $parent){ + foreach($parent as $p){ + $bootos = $bootosMapper->findBy(array("groupID" => $p)); + foreach ($bootos as $b) + if($b->getPublic() - $k >= 0 ){ + $grouptitle = $groupMapper->find($p)->getTitle(); + $bootoslist[$b->getID()] = $b; + $bootosanzeige[$grouptitle][$b->getID()] = $b->getTitle(); + } + } + } + + $configlist = array('Preset' => array(), 'Custom' => Array()); + $configlist['Preset'] = $configMapper->findBy(array('groupID' => $groupID)); + $configlist['Custom'] = $configMapper->findBy(array('membershipID' => $this->membership->getID())); + if($this->membership->getGroupID() != $this->bootmenuMapper->find($bootmenuID)->getGroupID()) $this->_redirect('/user/bootmenu/index/page/'.$this->page.'/modifyresult/forbidden'); @@ -257,6 +279,7 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=> $bootoslist, + 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder, 'configlist'=> $configlist, 'page' => $this->page, @@ -272,6 +295,7 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=>$bootoslist, + 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder, 'configlist'=>$configlist, 'page' => $this->page, @@ -320,8 +344,30 @@ class user_BootmenuController extends Zend_Controller_Action $bootosMapper = new Application_Model_BootOsMapper(); $configMapper = new Application_Model_ConfigMapper(); - $bootoslist = $bootosMapper->fetchAll(); - $configlist = $configMapper->fetchAll(); + + $groupID = $this->membership->getGroupID(); + $groupgroupsMapper = new Application_Model_GroupGroupsMapper(); + $groupMapper = new Application_Model_GroupMapper(); + + $parents = array(); + $bootoslist = array(); + $parents = $groupgroupsMapper->getParentGroups($groupID); + + foreach($parents as $k => $parent){ + foreach($parent as $p){ + $bootos = $bootosMapper->findBy(array("groupID" => $p)); + foreach ($bootos as $b) + if($b->getPublic() - $k >= 0 ){ + $grouptitle = $groupMapper->find($p)->getTitle(); + $bootoslist[$b->getID()] = $b; + $bootosanzeige[$grouptitle][$b->getID()] = $b->getTitle(); + } + } + } + + $configlist = array('Preset' => array(), 'Custom' => Array()); + $configlist['Preset'] = $configMapper->findBy(array('groupID' => $groupID)); + $configlist['Custom'] = $configMapper->findBy(array('membershipID' => $this->membership->getID())); $bootmenuentry = new Application_Model_BootMenuEntries(); $bootmenu = new Application_Model_BootMenu(); @@ -335,6 +381,7 @@ class user_BootmenuController extends Zend_Controller_Action $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=> $bootoslist, + 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, 'kcl' => $bootmenuentry->getKcl(), @@ -354,6 +401,7 @@ class user_BootmenuController extends Zend_Controller_Action }else{ $bootmenuentryForm = new user_Form_BootmenuEntries(array( 'bootoslist'=> $bootoslist, + 'bootosanzeige' => $bootosanzeige, 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, 'kcl' => $bootmenuentry->getKcl(), |
