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

                                                                 
                                
 


                                                                                                                             
                                                                    






                                                                                                                                                           
                                                                                  

              

                                                       


                                                 



                                           
 


                                                           
                                                              
                             
                                                             

                                                        
                                                                                                                                                                                           
                                                               



                                                                             
                                                                               



                                                                                  
                                                                                                               

                                                                                                                                                           
                                                               



                                                                               
                                                                               



                                                                                  
                                                                                                            
                                                


                                                                                                  



                                                                                                                      









                                                                                                                       
 
                                
 





                                                               
                                                               



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

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

<?php if((Pbs_Acl::checkRight('cc') &&  $this->type == 'group') || (Pbs_Acl::checkRight('cco') &&  $this->type == 'own')): ?>
<?php echo $this->formButton('createconfig', 'Create Config', array(
							'onclick' => 'self.location="/user/config/createconfig/type/'.$this->type.'/page/'.$this->page.'"',
							'class' => 'addbutton'))?>
<?php endif;?>

<?php if(Pbs_Acl::checkRight('csui')): ?>
<?php echo $this->formButton('ownconfig', 'Show '.$conflabel.' configs', array(
							'onclick' => 'self.location="/user/config/index/type/'.$conflabel.'/page/'.$this->page.'"',
							'class' => 'addbutton'))?>
<?php endif;?>

<div class='searchvars'>
	<div class='head'>Available searchfilter:</div>
	<?php if(Pbs_Acl::checkRight('csai')): ?>
		<div class='code'>configID</div>
	<?php endif; ?>
	<div class='code'>title</div>
	<div class='code'>shellscript</div>
	<div class='code'>created</div>
</div>	

<div class='listelement'>
	<?php if(count($this->configlist)==0)
		echo "There are no Config's to display." ?>
	<?php foreach ($this->configlist as $k => $config): ?>
	<div class='element'>
  		<div class='number'><?php echo $k+1; ?></div>
  		<div class='content'>  			
	  		<div class='actions'>
	  			<?php if(((Pbs_Acl::checkRight('ce') || Pbs_Acl::checkRight('cem')) && $this->type == 'group') || ($this->type == 'own' && Pbs_Acl::checkRight('ceo'))): ?>
	  			<a href="<?php echo $this->url(
					array(
						'module'	=> 'user',
						'controller' => 'config',
						'action'     => 'editconfig',
						'type'		=> $this->type,
						'configID'   =>  $config->getID(),
						'page'		=> $this->page
					),
					'default',
					true, false) ?>"><img src='/media/img/edit.png' alt='Edit Config'/></a>
				<?php endif; ?>
				<?php if((Pbs_Acl::checkRight('cd') && $this->type == 'group') || ($this->type == 'own' && Pbs_Acl::checkRight('cdo'))): ?>
		  		<a href="<?php echo $this->url(
					array(
						'module'	=> 'user',
						'controller' => 'config',
						'action'     => 'deleteconfig',
						'type'		=> $this->type,
						'configID'   =>  $config->getID(),
						'page'		=> $this->page
					),
					'default',
					true) ?>"><img src='/media/img/delete.png' alt='Delete Config'/></a>
				<?php endif; ?>	
	  		</div>  
	  		<div class='title'><?php echo $this->escape($config->getTitle()); ?></div>
	  		<div class='details'>
	  			<?php if(Pbs_Acl::checkRight('csai')): ?>
	  				<label>ConfigID</label>
	  					<div class='item'><?php echo $this->escape($config->getID()); ?></div>
				<?php endif; ?>
	  			<label>Shellscript</label>
	  				<div class='item'><?php echo $this->escape($config->getShellscript()); ?></div>
	  			<label>Created</label>
	  				<div class='item'><?php echo $this->escape($config->getCreated()); ?></div>
	  		</div>
  		</div>
  		<div class='clear'></div>
	</div>
	<?php endforeach; ?>
</div>

<?php echo $this->pagination; ?>

<script>
$(document).ready(function(){
	if($('.element').find('.dispnone').length >= 1){
		$(this).find('.title').css('cursor','pointer');
		
		$('.title').click(function(){
			$(this).siblings('.dispnone').toggle();
		});
	}
});
</script>