<?php if (count($this->rights)) : ?>

	<form action="<?=$this->baseUrl()?>/admin/categoryies/edit-rights" method="post">
	<table class="categoryies_table">
	<tr class="header">
		<td><?=$this->t('skupina-f')?></td>
		<td><?=$this->t('pristup-je-aktivni-f')?></td>
		<td><?=$this->t('cteni-f')?></td>
		<td><?=$this->t('pridavani-f')?></td>
		<td><?=$this->t('editace-f')?></td>
		<td><?=$this->t('mazani-f')?></td>
		<td class="right"><?=$this->t('moznosti-f')?></td>
	</tr>
	<?php foreach ($this->rights as $i) : ?>
	    <tr>
	        <td class="td_first"><?=$this->escape($i->group_name)?></td>
	        <td class="<?=($i->rights_active) ? 'active' : 'inactive';?>">
	        
	        	<?php if ($i->rights_active) : ?>
	        		<a href="<?=$this->baseUrl()?>/admin/categoryies/deactivate-rights-group/id/<?=$this->val($this->form, 'id_category')?>/rights/<?=$i->id_rights?>"><?=$this->t('aktivni-AF')?></a>
	        	<?php else : ?>
	        		<a href="<?=$this->baseUrl()?>/admin/categoryies/activate-rights-group/id/<?=$this->val($this->form, 'id_category')?>/rights/<?=$i->id_rights?>"><?=$this->t('neaktivni-AF')?></a>
	        	<?php endif; ?>    
	        </td>
	        
	        
	        <td><?=$this->formCheckbox('read[' . $i->id_rights .']', $i->read, null, array("1", "0"))?></td>
	        <td><?=$this->formCheckbox('add[' .  $i->id_rights .']', $i->add,  null, array("1", "0"))?></td>
	        <td><?=$this->formCheckbox('edit[' . $i->id_rights .']', $i->edit, null, array("1", "0"))?></td>
	        <td><?=$this->formCheckbox('del[' .  $i->id_rights .']', $i->del,  null, array("1", "0"))?></td>
	        <td class="actions">
	            <a class="action_delete" id="rights_del_<?=$i->id_rights?>"href="<?=$this->baseUrl()?>/admin/categoryies/delete-rights-group/rights/<?=$i->id_rights?>/id/<?=$this->val($this->form, 'id_category')?>"><?=$this->t('vyradit-AF')?></a> 
	        </td>
	    </tr>
	    <script type="text/javascript">
				$(document).ready(function(){
					$('#rights_del_<?=$i->id_rights?>').attr('href', $('#rights_del_<?=$i->id_rights?>').attr('href') + '/thru/1');
						$('#rights_del_<?=$i->id_rights?>').click(function(){
							if (confirm("<?=$this->t('delete_confirm')?>"))
							{
								return true;
							} else {
								return false;
							}
						});
					});
		</script>
	<?php endforeach; ?>
	</table>
	<div class="submit_line">
		<input type="hidden" name="id_category" value="<?=$this->val($this->form, 'id_category')?>" />
		<button type="submit" name="submit"><?=$this->t('ulozit-f')?></button>
	</div>
	</form>
<?php endif; ?>