summaryrefslogblamecommitdiffstats
path: root/application/modules/fbgui/views/scripts/index/index.phtml
blob: 8a5f0e695a4460bfc466d0c1ca878a40e37a55ce (plain) (tree)
1
                                                                 


























                                                                                           


                                                       














                                                                                                                                
                                                       

                           
                               
           

















                                                              

















                                                                                                                                  
               
                                  












                                                                                            
                                       
                              
                                    
                                        

                                                                   
                                                                        
                                                                            
                                                                        
                   
                                                                       
                                          

                                                                   

                                                                            
                                                  

                                

                              


                                                       
                                                            



                                                                                
                                                                                     

                                                                 
                                                                                                                                
                                                                                                                        
                                                                                     

                                                                 
                                                                  
                                 
                                                       

                           


                                                       
           

















                                                              
                                        
                                                     
                                                                  
                                                                    

                                                                         
                               
                                                                                                     
                         





                                                             
                                           


                                                                                                                                            



                                                      


                                                                             
                                                                                                
                  
                                                                                                 
                                                               
                                                                  

                                                                                    


                                                                                                
                
                                                                       


                                                                                                                                  
                                        
              
<?php if($this->notification != ''){echo $this->notification;} ?>

<?php if($this->nobootmenu === true):?>
	<div class="fbguilogin selectswitch" style=''> 
		<div style='font-size:16px;font-weight:bold;margin-bottom:5px;'>Login</div>
		<i>There is no BootMenu to show. Please login to get your BootMenu.</i> 
		<input type="hidden" class="id" value="login"/> 
	</div>
	<script type="text/javascript">
	var activeElement = 0;
	$(document).ready(function(){	
		$('.selectswitch').click(function(){
			$('.selectswitch').removeClass('selected');
			$(this).addClass('selected');			
			$("#selectedBootOs").val($(this).find('.id').val());
			$("#startbutton").focus();
		});
		$('.selectswitch').click();
		$('#startbutton').focus();
		$('.selectswitch').dblclick(function(){
			$('.selectswitch').removeClass('selected');
			$(this).addClass('selected');			
			$("#selectedBootOs").val($(this).find('.id').val());
			$("#startbutton").focus();
			start();
		});
		
		$(function() {
			$(document).click(function(){
				abortStartcount = true;
			})
			$(document).keyup(function (event) {
				if (event.keyCode == 38) {
					// up
					if(activeElement >=1)
						activeElement = activeElement-1;
					$('.selectswitch').eq(activeElement).click();
				} else if (event.keyCode == 40) {
					// Down
					if(activeElement < $('.selectswitch').length-1 )					
						activeElement = activeElement+1;					
					$('.selectswitch').eq(activeElement).click();
				} else if (event.keyCode == 13) {
					// Down
					$('#startbutton').click();
				}
				abortStartcount = true;
			});
		});
		decreaseDown();
	});
	function decreaseDown(){
		var act = parseInt($('.startcounter').html());
		if(act == 0){
			start();
			return;
		}
		var next = act-1;		
		$('.startcounter').html(next);
		if(next == 0){
			start();
		}
		if(next > 0 && abortStartcount == false){
			setTimeout('decreaseDown()',1000);
		}
		if(abortStartcount == true){
			$('.startcounter').parent().fadeOut();
		}
	}
	function start(){		
		if($('#selectedBootOs').val() != ''){
			if($('#selectedBootOs').val() == 'login'){
				window.location='/fbgui/auth/login/'
			} else{
				window.location='/fbgui/index/start/bme/'+$('#selectedBootOs').val();
			}
		}
		else{
			alert('You have to select a BootOs');
		}
	}
	</script>
	<input style="display:none;" type='text' id="selectedBootOs" />
	<button onClick="start();" id='startbutton' class="fbguistart" style='font-size:16px;font-weight:bold;margin-bottom:5px;'>
		Login
	</button>	
	<div class='clear'></div>
<?php endif; ?>
<?php if(isset($this->entries)):?>
	<?php if($this->loginmenu):?>
	<div class="fbguilogin selectswitch" style=''> 
		<div style='font-size:16px;font-weight:bold;margin-bottom:5px;'>Login</div>
		<i>This is not your Bootmenu. Select this to get your own Bootmenu.</i> 
		<input type="hidden" class="id" value="login"/> 
	</div>
	<?php else:?>
	<div class="fbguilogin selectswitch" style=''> 
		<div style='font-size:16px;font-weight:bold;margin-bottom:5px;'>Logout</div>
		<i>Select this to logout and get to the default BootMenu.</i> 
		<input type="hidden" class="id" value="logout"/> 
	</div>
	<?php endif;?>
	<script type="text/javascript">
	var activeElement = 0;
	var abortStartcount = false;
	$(document).ready(function(){	
		$('.selectswitch').click(function(){
			$('.selectswitch').removeClass('selected');
			$(this).addClass('selected');			
			$("#selectedBootOs").val($(this).find('.id').val());
			$("#startbutton").focus();			
		});
		$('.bootmenu .selectswitch').eq(activeElement).click();
		$('#startbutton').focus();
		$('.selectswitch').dblclick(function(){
			$('.selectswitch').removeClass('selected');
			$(this).addClass('selected');			
			$("#selectedBootOs").val($(this).find('.id').val());
			$("#startbutton").focus();
			start();
		});
		
		$(function() {
			$(document).click(function(){
				abortStartcount = true;
			})
			$(document).keyup(function (event) {
				if (event.keyCode == 38) {
					// up
					if(activeElement >=1)
						activeElement = activeElement-1;
					$('.selectswitch').eq(activeElement).click();
				} else if (event.keyCode == 40) {
					// Down
					if(activeElement < $('.selectswitch').length-1 )					
						activeElement = activeElement+1;					
					$('.selectswitch').eq(activeElement).click();
				} else if (event.keyCode == 13) {
					// Down
					$('#startbutton').click();
				}
				abortStartcount = true;
			});
		});
		<?php if(count($this->entries) > 0): ?>
		decreaseDown()
		<?php endif; ?>
	});
	function decreaseDown(){
		var act = parseInt($('.startcounter').html());
		if(act == 0){
			start();
			return;
		}
		var next = act-1;		
		$('.startcounter').html(next);
		if(next == 0){
			start();
		}
		if(next > 0 && abortStartcount == false){
			setTimeout('decreaseDown()',1000);
		}
		if(abortStartcount == true){
			$('.startcounter').parent().fadeOut();
		}
	}
	function start(){		
		if($('#selectedBootOs').val() != ''){
			if($('#selectedBootOs').val() == 'login'){
				window.location='/fbgui/auth/login/'
			}else if($('#selectedBootOs').val() == 'logout'){
				window.location='/fbgui/auth/logout/'
			} else{
				window.location='/fbgui/index/start/bme/'+$('#selectedBootOs').val();
			}
		}
		else{
			alert('You have to select a BootOs');
		}
	}
	</script>
	<h1><?php echo $this->title;?></h1>
	<?php if(count($this->entries) > 0): ?>
	<div style='padding:5px;float:right;'>Starting in <span class='startcounter'><?php echo $this->startcounter; ?></span> seconds</div>
	<?php endif; ?>
	<div class='bootmenu'>
	<?php $first = true; 	
	?>
	<?php foreach($this->entries as $k=>$entry):?>
		<?php
			$bootosMapper = new Application_Model_BootOsMapper();
			$bootos = new Application_Model_BootOs();
			$bootos = $bootosMapper->find($entry->getBootosID());			
		?>
		<div id="menu_item_<?php echo $k;?>" class="menu selectswitch"  class="flexbox"> 
			<img src="/media/img/os/ubuntu.png" /> 
			<h2><?php echo $entry->getTitle(); ?></h2>
			<i>BootOs-Name: <?php echo $bootos->getTitle();?></i> 
			<p>Description: <?php echo $bootos->getDescription();?></p> 
			<input type="hidden" class="id" value="<?php echo $entry->getID();?>"/> 
		</div> 
	<?php endforeach; ?>
	</div>	
	<input style="display:none;" type='text' id="selectedBootOs" />
	<button onClick="start();" id='startbutton' class="fbguistart" style='font-size:16px;font-weight:bold;margin-bottom:5px;'>
		Start System
	</button>	
	<div class='clear'></div>	
<?php endif;?>