summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-03-21 14:07:06 +0100
committerSimon2011-03-21 14:07:06 +0100
commit15437db2980b0ab7782fe1dab261aa75b6b0b410 (patch)
treeba626719c49ae732127ada0f44ec2c22c253d3c7
parentmerge (diff)
downloadpbs2-15437db2980b0ab7782fe1dab261aa75b6b0b410.tar.gz
pbs2-15437db2980b0ab7782fe1dab261aa75b6b0b410.tar.xz
pbs2-15437db2980b0ab7782fe1dab261aa75b6b0b410.zip
Filter angepasst, wenn keine Mitgliedschaft besteht
fbgui als beispiel mit bootmenu ausgestattet
-rw-r--r--application/controllers/IndexController.php8
-rw-r--r--application/modules/fbgui/controllers/IndexController.php14
-rw-r--r--application/modules/fbgui/views/scripts/index/index.phtml52
-rw-r--r--library/Pbs/Filter.php8
4 files changed, 31 insertions, 51 deletions
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index 5f61df4..f3e5256 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -10,10 +10,12 @@ class IndexController extends Zend_Controller_Action
public function indexAction()
{
- print_a($_SERVER);
- if(stristr($_SERVER['HTTP_USER_AGENT'],'prebootGUI')){
- $this->_forward('index','Index','fbgui');
+ if(stristr($_SERVER['HTTP_USER_AGENT'],'prebootGUI')){
+ $_SESSION['postdata'] = $_POST;
+ $this->_redirect('/fbgui/index/index') ;
}
+
+
// action body
}
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index f5f8cdf..fe457b6 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -10,7 +10,10 @@ class Fbgui_IndexController extends Zend_Controller_Action
public function indexAction()
{
-
+ if(isset($_SESSION['postdata'])){
+ $_POST = ($_SESSION['postdata']);
+ unset($_SESSION['postdata']);
+ }
$keys = $this->_request->getParam('keys');
$post = $this->_request->getParam('post');
if($post != '' && $keys != ''){
@@ -51,10 +54,11 @@ class Fbgui_IndexController extends Zend_Controller_Action
// Request Bootmenu
$pbsFilter = new Pbs_Filter();
$bootmenuID = $pbsFilter->evaluate();
- print_a('bootmenuID is ',$bootmenuID);
if($bootmenuID != null){
- print_a('goto bootmenu');
- #$this->_redirect('/dev/bootmenu/index/bootmenuid/'.$bootmenuID);
+ print_a('goto bootmenu '.$bootmenuID);
+ $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();
+ $res = $bootmenuentriesMapper->findBy('bootmenuID',$bootmenuID);
+ $this->view->entries = $res;
}
else{
print_a('no filter is valid, goto login');
@@ -65,7 +69,7 @@ class Fbgui_IndexController extends Zend_Controller_Action
echo "<h1>Not Welcome</h1>";
print_a($_POST);
}
- die();
+
}
diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml
index 4b38f0a..2e93bda 100644
--- a/application/modules/fbgui/views/scripts/index/index.phtml
+++ b/application/modules/fbgui/views/scripts/index/index.phtml
@@ -1,43 +1,9 @@
-<style>
- a:link,
- a:visited
- {
- color: #0398CA;
- }
-
- span#zf-name
- {
- color: #91BE3F;
- }
-
- div#welcome
- {
- color: #FFFFFF;
- background-image: url(http://framework.zend.com/images/bkg_header.jpg);
- width: 600px;
- height: 400px;
- border: 2px solid #444444;
- overflow: hidden;
- text-align: center;
- }
-
- div#more-information
- {
- background-image: url(http://framework.zend.com/images/bkg_body-bottom.gif);
- height: 100%;
- }
-</style>
-<div id="welcome">
- <h1>Welcome to the <span id="zf-name">Zend Framework!</span></h1>
-
- <h3>This is your project's main page</h3>
-
- <div id="more-information">
- <p><img src="http://framework.zend.com/images/PoweredBy_ZF_4LightBG.png" /></p>
- <p>
- Helpful Links: <br />
- <a href="http://framework.zend.com/">Zend Framework Website</a> |
- <a href="http://framework.zend.com/manual/en/">Zend Framework Manual</a>
- </p>
- </div>
-</div> \ No newline at end of file
+<table>
+<?php foreach($this->entries as $entry):?>
+<tr>
+ <td><?php echo $entry->getID();?></td>
+ <td><?php echo $entry->getTitle();?></td>
+ <td>take this</td>
+</tr>
+<?php endforeach; ?>
+</table>
diff --git a/library/Pbs/Filter.php b/library/Pbs/Filter.php
index 91e97e9..1759412 100644
--- a/library/Pbs/Filter.php
+++ b/library/Pbs/Filter.php
@@ -208,6 +208,14 @@ class Pbs_Filter{
//TODO: GET GROUP from SESSION
$groupID = $this->membership->getGroupID();
}
+ }
+ else{
+ $bootisoMapper = new Application_Model_BootisoMapper();
+ $bootiso = new Application_Model_BootIso();
+ $bootisoMapper->find($session->getBootisoID(),$bootiso);
+ $groupID = $bootiso->getGroupID();
+ }
+ if(isset($groupID)){
try{
$stmt = $db->query("SELECT * FROM pbs_filterentries WHERE
filtertypeID = ".$filtertypID." AND