summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2011-03-10 16:40:22 +0100
committermichael pereira2011-03-10 16:40:22 +0100
commit6af55d49f3984d086872860832d0d296a2591647 (patch)
tree2eb0c2f6955555cf3df4a080b5cdea34973d7da4
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-6af55d49f3984d086872860832d0d296a2591647.tar.gz
pbs2-6af55d49f3984d086872860832d0d296a2591647.tar.xz
pbs2-6af55d49f3984d086872860832d0d296a2591647.zip
Bootmenu auf preboot JSON
-rw-r--r--application/controllers/BootmenuController.php32
-rw-r--r--application/models/BootMenuEntriesMapper.php18
2 files changed, 33 insertions, 17 deletions
diff --git a/application/controllers/BootmenuController.php b/application/controllers/BootmenuController.php
index 8cda756..9a212d6 100644
--- a/application/controllers/BootmenuController.php
+++ b/application/controllers/BootmenuController.php
@@ -66,27 +66,25 @@ class BootmenuController extends Zend_Controller_Action
}else{
$bootmenu = new Application_Model_BootMenu();
$bootmenumapper->find($bootmenuID, $bootmenu);
+
+ $cc['title'] = $bootmenu->getTitle();
$bootmenuentries = array();
- $bootmenuentries[$bootmenuID] = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID);
- $bootmenu->setGroupID("[".$bootmenu->getGroupID()."] ".$groupmapper->find($bootmenu->getGroupID())->getTitle());
- $bootmenu->setMembershipID("[".$bootmenu->getMembershipID()."] ".$personmapper->find($membershipmapper->find($bootmenu->getMembershipID())->getPersonID())->getFirstname());
-
- $this->view->bootmenulist = array($bootmenu);
-
+ $bootmenuentries = $bootmenuentriesmapper->findBy('bootmenuID',$bootmenuID);
+
+ foreach($bootmenuentries as $bootmenuentry){
+ $ar = array();
+ $ar['title'] = $bootmenu->getTitle();
+ $ar['id'] = $bootmenu->getID();
+ $cc['data'][] = $ar;
+ }
+
+ echo json_encode($cc);
+
+ // print_a($cc);
+
}
- $this->view->bootmenuentrylist = $bootmenuentries;
-
-
- echo json_encode(
- array(
- 'bootosmapper' => $this->view->bootosmapper,
- 'configmapper' => $this->view->configmapper,
- 'bootmenulist' => $this->view->bootmenulist,
- 'bootmenuentrylist' => $this->view->bootmenuentrylist
- )
- );
}
}
diff --git a/application/models/BootMenuEntriesMapper.php b/application/models/BootMenuEntriesMapper.php
index 7a2da59..a0a5309 100644
--- a/application/models/BootMenuEntriesMapper.php
+++ b/application/models/BootMenuEntriesMapper.php
@@ -30,6 +30,24 @@ class Application_Model_BootMenuEntriesMapper
echo "Error message 2: " . $e->getMessage() . "\n";
}
}
+
+ public function findByArray($criteria, $value)
+ {
+ try{
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $select = $this->getDbTable()->select()
+ ->from($this->_dbTable)
+ ->where($criteria . ' = ?', $value)
+ ->order('order');
+ $stmt = $select->query();
+ $result = $stmt->fetchAll();
+
+ return $result;
+
+ }catch (Zend_Exception $e) {
+ echo "Error message 2: " . $e->getMessage() . "\n";
+ }
+ }
public function setDbTable($dbTable)
{