summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-04-14 15:07:32 +0200
committerSimon2011-04-14 15:07:32 +0200
commit9e30df97c5273dddff21ec0650fece03fad2a110 (patch)
treed80da82ed2594df1f91832ff5b73f548e353be84
parentTicket #210 - Menueinträge mit Pfeiltasten navigierbar (diff)
downloadpbs2-9e30df97c5273dddff21ec0650fece03fad2a110.tar.gz
pbs2-9e30df97c5273dddff21ec0650fece03fad2a110.tar.xz
pbs2-9e30df97c5273dddff21ec0650fece03fad2a110.zip
Ticket #211 - Es werden Meldungen angezeigt, sobald es das eigene oder andere Bootmenus sind
-rw-r--r--application/modules/fbgui/controllers/IndexController.php16
-rw-r--r--application/modules/fbgui/views/scripts/index/index.phtml9
-rw-r--r--library/Pbs/NewMember.php4
-rw-r--r--library/Pbs/Notifier.php3
4 files changed, 22 insertions, 10 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;?>
diff --git a/library/Pbs/NewMember.php b/library/Pbs/NewMember.php
index b73e00a..62069c2 100644
--- a/library/Pbs/NewMember.php
+++ b/library/Pbs/NewMember.php
@@ -21,7 +21,7 @@ class Pbs_NewMember{
$userBootmenu->setID(null);
$userBootmenu->setGroupID(null);
$userBootmenu->setMembershipID($membership->getID());
- $userBootmenu->setTitle("Private BootMenu of ".$personname);
+ $userBootmenu->setTitle("BootMenu of ".$personname);
$userBootmenu->setCreated(time());
$userBootmenu->setDefaultbootmenu(0);
$userBootmenuID = $bootmenuMapper->save($userBootmenu);
@@ -39,7 +39,7 @@ class Pbs_NewMember{
// Second we create a filter
$filter = new Application_Model_Filter();
- $filter->setTitle("Private Filter of ".$personname);
+ $filter->setTitle("Filter of ".$personname);
$filter->setDescription("This filter was automatically created to forward the user to his own bootmenu");
$filter->setMembershipID($membership->getID());
$filter->setGroupID($membership->getGroupID());
diff --git a/library/Pbs/Notifier.php b/library/Pbs/Notifier.php
index 74971f7..c4fa730 100644
--- a/library/Pbs/Notifier.php
+++ b/library/Pbs/Notifier.php
@@ -17,6 +17,9 @@ class Pbs_Notifier{
case "error":
$result = "warningbox";
break;
+ case "info":
+ $result = "infobox";
+ break;
}
$result = "<div class='$result'>$action</div>";
break;