diff options
author | Simon | 2011-04-14 15:07:32 +0200 |
---|---|---|
committer | Simon | 2011-04-14 15:07:32 +0200 |
commit | 9e30df97c5273dddff21ec0650fece03fad2a110 (patch) | |
tree | d80da82ed2594df1f91832ff5b73f548e353be84 /application/modules/fbgui | |
parent | Ticket #210 - Menueinträge mit Pfeiltasten navigierbar (diff) | |
download | pbs2-9e30df97c5273dddff21ec0650fece03fad2a110.tar.gz pbs2-9e30df97c5273dddff21ec0650fece03fad2a110.tar.xz pbs2-9e30df97c5273dddff21ec0650fece03fad2a110.zip |
Ticket #211 - Es werden Meldungen angezeigt, sobald es das eigene oder andere Bootmenus sind
Diffstat (limited to 'application/modules/fbgui')
-rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 16 | ||||
-rw-r--r-- | application/modules/fbgui/views/scripts/index/index.phtml | 9 |
2 files changed, 17 insertions, 8 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index c27fb10..1058a11 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -90,11 +90,21 @@ class Fbgui_IndexController extends Zend_Controller_Action // 'Your client is '.$session->getClientID(), // 'goto bootmenu '.$bootmenuID); + $bootmenuMapper = new Application_Model_BootMenuMapper(); + $bm = $bootmenuMapper->find($bootmenuID); + $this->view->title = $bm->getTitle(); + $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); $res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false); $this->view->entries = $res; if (!Zend_Auth::getInstance()->hasIdentity()) { - echo "<a href='/fbgui/auth/login/'>Goto Login to get your Bootmenu</a>"; + #echo "<a href='/fbgui/auth/login/'>Goto Login to get your Bootmenu</a>"; + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. You have to login to get your own Bootmenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'info'); + } + if(Zend_Auth::getInstance()->hasIdentity() && $bm->MembershipID != $this->membership->getID() ){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. There is currently a BootMenu with a higher priority active.",'info'); } } else{ @@ -106,7 +116,9 @@ class Fbgui_IndexController extends Zend_Controller_Action // 'Your client is '.$session->getClientID(), // 'there is no bootmenu for you'); - echo "<a href='/fbgui/auth/login/'>Goto Login to get your Bootmenu</a>"; + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify("There is no BootMenu to show. Please log in to get your BootMenu.<br />Click here to <a href='/fbgui/auth/login/'>login</a>",'error'); + } } else{ diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml index f12e93c..0ef6e4e 100644 --- a/application/modules/fbgui/views/scripts/index/index.phtml +++ b/application/modules/fbgui/views/scripts/index/index.phtml @@ -1,3 +1,4 @@ +<?php if($this->notification != ''){echo $this->notification;} ?> <?php if(isset($this->entries)):?> <script type="text/javascript"> var activeElement = 0; @@ -20,22 +21,17 @@ $(function() { $(document).keyup(function (event) { - //console.log(activeElement); if (event.keyCode == 38) { // up if(activeElement >=1) activeElement = activeElement-1; $('.menu').eq(activeElement).click(); - $('#startbutton').focus(); - } else if (event.keyCode == 40) { // Down if(activeElement < $('.menu').length-1 ) activeElement = activeElement+1; $('.menu').eq(activeElement).click(); - $('#startbutton').focus(); } - //console.log(activeElement); }); }); @@ -49,7 +45,7 @@ } } </script> - <h1>Bootmenu</h1> + <h1><?php echo $this->title;?></h1> <?php $first = true; ?> <?php foreach($this->entries as $entry):?> <?php @@ -69,4 +65,5 @@ <input style="display:none;" type='text' id="selectedBootOs" /> <button style='cursor:pointer;float:right;margin-top:10px;' id='startbutton' onClick="start();"><img id='startball' src='/media/img/button-red.png'> <span style='font-size:14px;'>Start System</span></button> <div class='clear'></div> + <?php if($this->notificationbot != ''){echo $this->notificationbot;} ?> <?php endif;?> |