View file modules/downloads/views/default/list_files.tpl

File size: 3.2Kb
<?php $this->display('header', array('title' => 'Загрузки')) ?>

<div class="title"><img src="<?php echo URL ?>views/<?php echo THEME ?>/img/titl.gif" class="ico" alt="" />Загрузки <?php if($directory['name']): echo '| '. $directory['name']; endif; ?></div>

<div class="block">
<a href="<?php echo URL ?>downloads">Загрузки</a> <?php if(!empty($namepath)): ?>» <?php echo $namepath; endif; if($directory['directory_id'] > 0): ?> » <a href="<?php echo URL ?>downloads/<?php echo $directory['directory_id'] ?>"><?php echo $directory['name'] ?></a><?php endif; ?><br />
<?php if($directory['user_files'] == 'yes'): ?>
<a href="<?php echo a_url('downloads/upload_file', 'directory_id='. $directory['directory_id']) ?>">Загрузить ваш файл</a><br />
<?php endif; ?>
</div>

<?php if($files): ?>
    <?php foreach($files as $file): ?>
	<div class="menu">
		<?php if($file['type'] == 'directory'): ?>
			<img src="<?php echo URL ?>modules/downloads/views/default/img/dir.png" alt="" />
		<?php elseif($file['previews'] == 'yes' && @$_SESSION['downloads_preview'] > 0): ?>
			<img src="<?php echo URL . $file['path_to_file'] .'/preview_'. $_SESSION['downloads_preview'] .'.jpg' ?>" alt="" />
		<?php elseif(file_exists(ROOT .'modules/downloads/views/'. THEME .'/img/'. $file['file_ext'] .'.png')): ?>
			<img src="<?php echo URL ?>modules/downloads/views/default/img/<?php echo $file['file_ext'] ?>.png"  alt="" />
		<?php else: ?>
			<img src="<?php echo URL ?>modules/downloads/views/default/img/file.png" alt="" />
		<?php endif; ?>

		<?php if($file['type'] == 'directory'): ?>
			<a href="<?php echo URL ?>downloads/<?php echo $file['file_id'] ?>"><?php echo $file['name'] ?></a> <?php if($file['count_files'] > 0) echo '<span style="font-size: 11px; color: grey;">['. $file['count_files'] .']</span>' . ($file['new_day'] > 0 ? ' <span style="font-size: 11px; color: red;">+'. $file['new_day'] .'</span>' : ''); ?><br />
		<?php else: ?>
			<?php if($file['file_ext'] == 'jpg' || $file['file_ext'] == 'jpeg' || $file['file_ext'] == 'png' || $file['file_ext'] == 'gif'): ?>
				<a href="<?php echo URL ?>download_file/<?php echo $file['file_id'] .'_'. @$GLOBALS['CONFIG']['downloads']['files_prefix'] . $file['real_name'] ?>"><?php echo $file['name'] ?></a> (<?php echo main::byte_format($file['filesize']) ?>)
			<?php else: ?>
				<a href="<?php echo URL .'downloads/view/'. $file['file_id'] ?>"><?php echo $file['name'] ?></a> (<?php echo main::byte_format($file['filesize']) ?>)<br />
			<?php endif; ?>
		<?php endif; ?>
	</div>
	<?php endforeach; ?>
<?php else: ?>
	<div class="menu">
	<p>Папка пуста!</p>
	</div>
<?php endif; ?>

<?php if($pagination)
	echo '<div class="block">'. $pagination .'</div>';
?>

<div class="block">
<a href="<?php echo a_url('downloads') ?>">Загрузки</a> <?php if(!empty($namepath)): ?> » <?php echo $namepath; endif; if($directory['directory_id'] > 0): ?> » <a href="<?php echo a_url('downloads', 'directory_id='. $directory['directory_id']) ?>"><?php echo $directory['name'] ?></a><?php endif; ?>
</div>

<div class="block">
<a href="<?php echo URL ?>">На главную</a><br />
</div>

<?php $this->display('footer') ?>