summaryrefslogblamecommitdiffstats
path: root/application/modules/user/views/scripts/bootmenu/index.phtml
blob: 6758fae772a7729cb2a0808089eececad7c94337 (plain) (tree)
1
2
3
4
5
6
7
8
                                                                                                                        
                                                                 




                                                                                                                                                                                                                                 
                                                   


                                          
 


                                                                                                                                
                                                                        
                                                                                                                                                               





                                                                                                                                                     
                                                                                  
              







                                                               



                                                            
                                                                  





                                                           



                                                            
                                                        
                                                  
                                                                                                                         
                                                                                             
                                                                                                                   
                                                      




                                                                                          
                                                                                       




                                                                                              

                                                                                                                                
                                               
                                                                                                   




                                                                                       
                                                                                       





                                                                                                                         
                                                                                                   
                                                               



                                                                                 
                                                                               

                                                                                      

                                                  
                                                                                                              
                                               
                                                                                                                                                                 




                                                                                           
                                                                                       






                                                                                                                          

                                                                                                    

                                                                                                                                                              





                                                                 



                                                                                                                        
                                                                       
                                                                                                                        
                                                                              



                                                                                      

                                                                                
                                                                                                                                                                                         



                                                                                                                        
                                                                                                               
                                                                                                                                
                                                                                               




                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                            




                                                                                                                                
                                                                                                               






                                                                                                                                                  
                                                                                                                                                                                         




                                                                                                                      
                                                                                                               





                                                                                                                                           
                                                        



                                                                                                                                                      


                                                                                                                                      



                                                                                                                                                     
                                                                                  










                                                                                                                                                                                                                
                              


                                         
                            


                                
 
                
                                      

                             
                                                           














                                                                                                                
        





                                                                                                
<h1>BootMenu<?php if($this->type == 'own'):?><img class='helpericon' src='/media/img/bulb_off.png' /><?php endif;?></h1>
<?php if($this->notification != ''){echo $this->notification;} ?>

<?php if($this->type == 'own'):?>
	<div class='helper infobox'>Here you can see your Bootmenu. You can add a BootOs with a default Config or with a default Config. If you are overwhelmed by the possibilities the default Config is the best choice.</div>
<?php endif;?>

<div id='notification' style='display:none;'></div>
<?php if(Pbs_Acl::checkRight('booai')): ?>
	<?php echo $this->searchform; ?>
<?php endif; ?>

<?php $conflabel = $this->type == 'group'?'own':'group';?>

<?php if((Pbs_Acl::checkRight('booc') &&  $this->type== 'group') || (Pbs_Acl::checkRight('booco') &&  $this->type == 'own')): ?>
<?php echo $this->formButton('createbootmenu', 'Create BootMenu', array(
							'onclick' => 'self.location="/user/bootmenu/createbootmenu/type/'.$this->type.'/page/'.$this->page.'"',
							'class' => 'addbutton'))?>
<?php endif;?>

<?php if(Pbs_Acl::checkRight('booai')): ?>
<?php echo $this->formButton('groupbootmenu', 'Show '.$conflabel.' Bootmenu', array(
							'onclick' => 'self.location="/user/bootmenu/index/type/'.$conflabel.'/page/'.$this->page.'"',
							'class' => 'addbutton'))?>
<?php endif;?>
<?php if(Pbs_Acl::checkRight('booai')): ?>
	<div class='searchvars'>
		<div class='head'>Available searchfilter:</div>
		<div class='code'>bootmenuID</div>	
		<div class='code'>title</div>
		<div class='code'>changed</div>	
	</div>
<?php endif; ?>

<div class='listelement'>
	<?php if(count($this->bootmenulist)==0)
		echo "There are no BootMenus to display." ?>
	<?php foreach ($this->bootmenulist as $k => $bootmenu): ?>
	<?php 
		$class='';
		if($bootmenu->getDefaultbootmenu() == true)
			$class= 'highlight';
	?>
	<div class='element<?php echo " $class";?>'>
  		<div class='number'>  		
			<div class='smallnumber'>BMenu</div>
  			<?php echo $k+1 ?>
  		</div>
  		<div class='content'>  			
	  		<div class='actions'>	  
	  			<?php if(Pbs_Acl::checkRight('boodbm') && $this->type == 'group'): ?>			 
					<?php if($bootmenu->getDefaultbootmenu() == true): ?>
						<a><img src='/media/img/default.png' alt='Checked as default'/></a>
					<?php else: ?>
						<a href="<?php echo $this->url(
						array(
							'module'	=> 'user',
							'controller' => 'bootmenu',
							'action'     => 'defaultbootmenu',
							'type'		=> $this->type,
							'bootmenuID'   =>  $bootmenu->getID(),
							'page'		=> $this->page
						),
						'default',
						true, false) ?>">
						<img src='/media/img/default_grey.png' alt='Not checked as default' /></a>	
					<?php endif; ?>
				<?php endif; ?>
				<?php if(Pbs_Acl::checkRight('booe') && $this->type == 'group'): ?>
		  			<a href="<?php echo $this->url(
						array(
							'module'	=> 'user',
							'controller' => 'bootmenu',
							'action'     => 'editbootmenu',
							'type'		=> $this->type,
							'bootmenuID'   =>  $bootmenu->getID(),
							'page'		=> $this->page
						),
						'default',
						true, false) ?>"><img src='/media/img/edit.png' alt='Edit Bootmenu'/></a>
				<?php endif; ?>
				<?php if(Pbs_Acl::checkRight('bood') && $this->type == 'group'): ?>
				<a href="<?php echo $this->url(
					array(
						'module'	=> 'user',
						'controller' => 'bootmenu',
						'action'     => 'deletebootmenu',
						'type'		=> $this->type,
						'bootmenuID'   =>  $bootmenu->getID(),
						'page'		=> $this->page
					),
					'default',
					true) ?>"><img src='/media/img/delete.png' alt='Delete Bootmenu'/></a>
				<?php endif; ?>
				<?php if((Pbs_Acl::checkRight('booae') && $this->type == 'group') || (Pbs_Acl::checkRight('booaeo') && $this->type == 'own')): ?>
					<a href="<?php echo $this->url(
						array(
							'module'	=> 'user',
							'controller' => 'bootmenu',
							'action'     => 'addbootmenuentry',
							'type'		=> $this->type,
							'bootmenuID'   =>  $bootmenu->getID(),
							'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
							'page'		=> $this->page
						),
						'default',
						true) ?>"><img src='/media/img/add.png' alt='Add Entry'/></a>
				<?php endif; ?>
	  		</div>  
	  		<div class='title'><?php echo $this->escape($bootmenu->getTitle()); ?></div>
	  		<div class='subtitle'><?php echo count($this->bootmenuentrylist[$bootmenu->getID()]);?> Entrys - 
	  		Startcounter: <?php echo $this->escape($bootmenu->getStartcounter()); ?> - <?php echo $this->escape($bootmenu->getCreated()); ?></div>
	  		<?php
	  			$class='';
	  			if($this->type != 'own')
	  				$class=' dispnone';
	  		?>	
	  		<div class='details<?php echo $class;?>'>
	  			<?php if(Pbs_Acl::checkRight('booai')): ?>
  					<label>BootmenuID</label>
			  			<div class='item'><?php echo $this->escape($bootmenu->getID()); ?></div>
			  	<?php endif; ?>
			  	<div id="sortable" class="ui-sortable">
	  			<?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $k => $bootmenuentry): ?>
	  			<div class='element' id=entry-<?php echo $k?>>
			  		<div class='number'>
						<div class='smallnumber'>BMEntry</div>
			  			<?php echo $k+1 ?>
			  		</div>
			  		<div class='content'>  			
				  		<div class='actions'>
				  			<?php if((Pbs_Acl::checkRight('booai') && $this->type == 'group') || (Pbs_Acl::checkRight('booaio') && $this->type == 'own')): ?>
					  			<a class='play' href="<?php echo $this->url(
									array(						
										'controller' => 'resource',
										'action'     => 'getbootmenuentry',
										'type'		=> $this->type,
										'bootmenuentryID'   =>  $bootmenuentry->getID(),
										'alpha' => '0',
										'page'		=> $this->page
									),
									'default',
									true, false) ?>"><img src='/media/img/play.gif'></a>
							<?php endif; ?>
							<?php if(((Pbs_Acl::checkRight('booee') || Pbs_Acl::checkRight('booeem')) && $this->type == 'group') || (Pbs_Acl::checkRight('booeeo') && $this->type == 'own')): ?>
					  			<a class='edit' href="<?php echo $this->url(
									array(
										'module'	=> 'user',
										'controller' => 'bootmenu',
										'action'     => 'editbootmenuentry',
										'bootmenuentryID'   =>  $bootmenuentry->getID(),
										'type'		=> $this->type,
										'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
										'oldorder' => $bootmenuentry->getOrder(),
										'page'		=> $this->page
									),
									'default',
									true, false) ?>"><img src='/media/img/edit.png' alt='Edit Entry'/></a>
							<?php endif; ?>
							<?php if((Pbs_Acl::checkRight('boode') && $this->type == 'group') || (Pbs_Acl::checkRight('boodeo') && $this->type == 'own')): ?>
						  		<a href="<?php echo $this->url(
									array(
										'module'	=> 'user',
										'controller' => 'bootmenu',
										'action'     => 'removebootmenuentry',
										'type'		=> $this->type,
										'bootmenuentryID'   =>  $bootmenuentry->getID(),
										'page'		=> $this->page
									),
									'default',
									true) ?>"><img src='/media/img/delete.png' alt='Remove Entry'/></a>
							<?php endif; ?>
				  		</div>  
				  		<?php if(!Pbs_Acl::checkRight('booai')){
  							$bootmenuentry->setBootosID(preg_replace("!^\[[0-9]+\]\s!",'',$bootmenuentry->getBootosID()));
  							$bootmenuentry->setConfigID(preg_replace("!^\[[0-9]+\]\s!",'',$bootmenuentry->getConfigID()));
  						} ?>
				  		<div class='title'><?php echo $this->escape($bootmenuentry->getTitle()); ?></div>
				  		<div class='subtitle'><?php echo $this->escape($bootmenuentry->getBootosID()) ?></div>
				  		<div class='details dispnone'>
				  			<?php if(Pbs_Acl::checkRight('booai')): ?>
				  				<label>BootmenuentryID</label>
				  					<div class='item'><?php echo $this->escape($bootmenuentry->getID()); ?></div>
				  			<?php endif; ?>
				  			<label>Default KCL</label>
				  				<div class='item'><?php echo $this->escape($bootmenuentry->getKcl()); ?></div>
				  			<label>KCL-Append</label>
				  				<div class='item'><?php echo $this->escape($bootmenuentry->getKclappend()); ?></div>
				  			<label>ConfigID</label>
				  				<div class='item'><?php echo $this->escape($bootmenuentry->getConfigID()) ?></div>				  				
				  		</div>
			  		</div>
			  		<div class='clear'></div>
				</div>
	  			<?php endforeach; ?>
	  		</div>
	  		</div>
  		</div>
  		<div class='clear'></div>
	</div>
	<?php endforeach; ?>
</div>
 
<?php echo $this->pagination; ?>

	<script>
	$(document).ready(function(){ 
	function getId(el){
		  if(el.attr)
		    return el.attr("id").split("-").pop();;
		  return 0;
		}
	
	$(function() {
		$( "#sortable" ).sortable({
			  update: function(event, ui){
			    var nxt_id = getId(ui.item.next());
			    var id = getId(ui.item);
			    if(id < nxt_id)
				    nxt_id = (nxt_id-1);
			  	location.href=ui.item.find('.edit').attr('href')+'/neworder/'+(nxt_id);  	
			  }
			});
		$( "#sortable" ).disableSelection();
	});
	
    $('.actions .play').click(function (){
    	$("#notification").load($(this).attr('href')).addClass('infobox').show();    		
        return false;
	});
});
</script>