summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael pereira2011-03-22 13:19:22 +0100
committermichael pereira2011-03-22 13:19:22 +0100
commit45cc51e9ac7631621ea3e8cd98097605eb39b922 (patch)
treed38407562fc8244a0a0b276e73307ca6b58bc01c
parentDownload des BootIsos gefixt (diff)
parentMerge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff)
downloadpbs2-45cc51e9ac7631621ea3e8cd98097605eb39b922.tar.gz
pbs2-45cc51e9ac7631621ea3e8cd98097605eb39b922.tar.xz
pbs2-45cc51e9ac7631621ea3e8cd98097605eb39b922.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
-rw-r--r--application/modules/fbgui/Bootstrap.php9
-rw-r--r--application/modules/fbgui/controllers/IndexController.php25
-rw-r--r--application/modules/fbgui/views/scripts/index/index.phtml52
-rw-r--r--public/media/css/fbgui.css47
-rw-r--r--public/media/img/os/ubuntu.pngbin0 -> 12448 bytes
-rw-r--r--public/media/img/startOs.pngbin0 -> 1989 bytes
6 files changed, 112 insertions, 21 deletions
diff --git a/application/modules/fbgui/Bootstrap.php b/application/modules/fbgui/Bootstrap.php
index 7ddaf6b..1a66a79 100644
--- a/application/modules/fbgui/Bootstrap.php
+++ b/application/modules/fbgui/Bootstrap.php
@@ -1,5 +1,12 @@
<?php
class fbgui_Bootstrap extends Zend_Application_Module_Bootstrap
{
-
+ function _initViewHelpers()
+ {
+ $this->bootstrap('layout');
+
+ $layout = $this->getResource('layout');
+ $view = $layout->getView();
+ $view->headLink()->appendStylesheet('/media/css/fbgui.css');
+ }
}
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index adbe4cb..ef04b9d 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -48,30 +48,33 @@ class Fbgui_IndexController extends Zend_Controller_Action
$session->setTime(time());
$session->setIp($_SERVER['REMOTE_ADDR']);
$session = $n->createSession($session);
- $_SESSION['alphasessionID'] = $session->getAlphasessionID();
- echo "<h1>Welcome</h1>";
- print_a('Session is now set',
- 'Your sessionID is '.$session->getID(),
- 'Your alphasessionID is '.$session->getAlphasessionID(),
- 'Your client is '.$session->getClientID());
+ $_SESSION['alphasessionID'] = $session->getAlphasessionID();
// Request Bootmenu
$pbsFilter = new Pbs_Filter();
$bootmenuID = $pbsFilter->evaluate();
if($bootmenuID != null){
- print_a('goto bootmenu '.$bootmenuID);
+ print_a('Debug Output',
+ 'Session is now set',
+ 'Your sessionID is '.$session->getID(),
+ 'Your alphasessionID is '.$session->getAlphasessionID(),
+ 'Your client is '.$session->getClientID(),
+ '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');
- #$this->_redirect('/dev/auth/index/');
+ print_a('Debug Output',
+ 'Session is now set',
+ 'Your sessionID is '.$session->getID(),
+ 'Your alphasessionID is '.$session->getAlphasessionID(),
+ 'Your client is '.$session->getClientID(),
+ 'there is no bootmenu for you');
}
}
else{
- echo "<h1>Not Welcome</h1>";
- print_a($_POST);
+ echo "<h1>Not Welcome</h1>";
}
}
diff --git a/application/modules/fbgui/views/scripts/index/index.phtml b/application/modules/fbgui/views/scripts/index/index.phtml
index b2b813d..9f243e5 100644
--- a/application/modules/fbgui/views/scripts/index/index.phtml
+++ b/application/modules/fbgui/views/scripts/index/index.phtml
@@ -1,9 +1,43 @@
-<table>
-<?php foreach($this->entries as $entry):?>
-<tr>
- <td><?php echo $entry->getID();?></td>
- <td><?php echo $entry->getTitle();?></td>
- <td><a href='/fbgui/index/start/bme/<?php echo $entry->getID();?>'>take this</td>
-</tr>
-<?php endforeach; ?>
-</table>
+<?php if(isset($this->entries)):?>
+ <script>
+ $(document).ready(function(){
+ $('.menu').click(function(){
+ $('.menu').removeClass('selected');
+ $(this).addClass('selected');
+ console.log($(this).find('.id').val());
+ $("#selectedBootOs").val($(this).find('.id').val());
+ });
+ });
+ function start(){
+ if($('#selectedBootOs').val() != ''){
+ window.location='/fbgui/index/start/bme/'+$('#selectedBootOs').val();
+ }
+ else{
+ alert('You have to select a BootOs');
+ }
+ }
+ </script>
+ <h1>Bootmenu</h1>
+ <?php foreach($this->entries as $entry):?>
+ <?php
+ $bootosMapper = new Application_Model_BootOsMapper();
+ $bootos = new Application_Model_BootOs();
+ $bootos = $bootosMapper->find($entry->getBootosID());
+ #print_a($entry->getBootosID(),$bootos);
+ ?>
+ <div id="menu_item_1" class="menu" class="flexbox">
+ <img src="/media/img/os/ubuntu.png"/>
+ <h2><?php echo $entry->getTitle(); ?></h2>
+ <i><?php echo $bootos->getTitle();?></i>
+ <p><?php echo $bootos->getDescription();?></p>
+ <input type="hidden" class="id" value="<?php echo $entry->getID();?>"/>
+ </div>
+ <?php endforeach; ?>
+
+ <input style="display:none;" type='text' id="selectedBootOs" />
+
+ <div class="right" style='cursor:pointer;' onClick="start();">
+ <img style='vertical-align:-8px;' src='/media/img/startOs.png'>
+ <span style='font-size:18px;'>Start System</span>
+ </div>
+<?php endif;?>
diff --git a/public/media/css/fbgui.css b/public/media/css/fbgui.css
new file mode 100644
index 0000000..81f2448
--- /dev/null
+++ b/public/media/css/fbgui.css
@@ -0,0 +1,47 @@
+.menu {
+ font-size: 10.5px;
+ padding:14px;
+ float:none;
+}
+
+div.menu>img {
+ float: left;
+ margin-right: 10px;
+}
+
+.menu h2 {
+ color:#000033;
+ text-align:left !important;
+ display:inline;
+ font-size:14px;
+}
+
+.flex {
+ -moz-box-flex: 1;
+ -webkit-box-flex: 1;
+ box-flex: 1;
+}
+
+.selected {
+ border: 1px solid #9999FF;
+ -moz-border-radius: 6px;
+ -webkit-border-radius: 6px;
+ border-radius: 6px;
+ background-color: #F2F2FF;
+}
+
+.right{
+ text-align:right;
+ width:100%;
+}
+
+.middle{
+ width:100%;
+ text-align: center;
+}
+
+.left{
+ width:100%;
+ text-align: left;
+}
+
diff --git a/public/media/img/os/ubuntu.png b/public/media/img/os/ubuntu.png
new file mode 100644
index 0000000..acac3ba
--- /dev/null
+++ b/public/media/img/os/ubuntu.png
Binary files differ
diff --git a/public/media/img/startOs.png b/public/media/img/startOs.png
new file mode 100644
index 0000000..0dbf540
--- /dev/null
+++ b/public/media/img/startOs.png
Binary files differ