ACC SHELL

Path : /srv/www/vhosts/tsisystem/app/views/files/
File Upload :
Current File : //srv/www/vhosts/tsisystem/app/views/files/admin_index.thtml

<script type="text/javascript"><!--
function togglePublic()
{
	var cbx = document.getElementsByTagName('input');

	for (var i = 0; i < cbx.length; i++) {
		if (cbx[i].name.substr(0, 7) == 'public[') {
			cbx[i].checked = ! cbx[i].checked;
		}
	}

}
// --></script>

<div id="main">
  <div style="padding: 1em">

<h1>Soubory</h1>

<?php 
   echo $filter->setFiltering($filters);
   $pagination->setPaging($paging);
   $ids = array();
?>

<form action="<?php echo $html->url('/admin/files/update'); ?>" method="post">
<table width="100%" class="list" cellspacing="2">
<tr>
	<th><?php echo $pagination->sortLink('id', '#', 1); ?></th>
	<th><?php echo $pagination->sortLink('file_name', 'Soubor'); ?></th>
	<th>Náhled</th>
	<th>Veřejný</th>
	<th>Akce</th>
</tr>
<?php foreach ($files as $row): ?>
<tr>
	<td style="width: 2.5em; text-align: right"><?php echo $row['File']['id'] ?></td>
	<td>
	  <strong>
		<?php echo $html->link(
		  $row['File']['file_name'],
		  '/admin/files/view/' . $row['File']['id']
		  )?>
	  </strong>
	  <br />
	  Velikost:
	  <?php if (! strncasecmp('image/', $row['File']['content_type'], 6)) : ?>
	  <?php echo $row['File']['dims'], ', '; ?>
	  <?php endif; ?>
	  <strong><?php echo round($row['File']['file_size'] / 1024, 1) ?>kB</strong>
	  <br />
	  Typ: <strong><?php echo $row['File']['content_type']; ?></strong>
	</td>
	<td style="width: 107px; text-align: center">
	  <?php if (! strncasecmp('image/', $row['File']['content_type'], 6)) : ?>
	  <img src="<?php echo $html->url('/image/thumb/' . $row['File']['id']) ; ?>"
			 alt="<?php echo $row['File']['file_name'] ?>">
	  <?php else : echo '-'; endif; ?>
	</td>
	<td style="text-align: center">
	  <?php 
		 if (strncasecmp('image/', $row['File']['content_type'], 6)) :
		   $ids[] = $row['File']['id'];
		 ?>
	  <input type="checkbox" value="1" name="public[<?php echo $row['File']['id']; ?>]"
		<?php echo $row['File']['public'] ? ' checked="checked"' : '' ?> />
	  <?php else: ?>
	  -
	  <?php endif; ?>

	  
	</td>
	<td style="text-align: center; width: 5%">
	  <?php echo $html->link('Smaž','/admin/files/delete/' .
	    $row['File']['id'], null, 'Opravdu smazat?')?>
	</td>
</tr>
<?php endforeach?>
</table>

<div class="pagination"><?php echo $pagination->pageNumbers(NULL, NULL, ' '); ?></div>
<div style="text-align: right"><a href="javascript: togglePublic()">Od/označ veřejné</a><br />
  <input type="submit" name="f_submit" value="Ulož" />
</div>
<input type="hidden" name="public_ids" value="<?php echo join(',', $ids); ?>" />
</form>

<p />
<?php echo $html->link('New File', '/admin/files/add'); ?>

  </div>
</div>


ACC SHELL 2018