

<style type="text/css">
	#content{
		color: white;
	}
</style>


<?if( !isset($szerk) || !$szerk):?>
	<div style="background: url('/public/img/collection/box_download_category.png'); width: 305px; height: 71px; padding: 10px 0px 0px 15px; float: left;">
		<h1 style="border-bottom: 0px none; margin: 0px 0px 5px 0px;"><?=lang('collec_valasszon')?></h1>
		<?if($kategoriak):?>
			<form>
			<select onchange="betolt(this.value,'collection')" class="letoltesek">
				<?foreach($kategoriak as $kategoria):?>
					
					<option value="<?=$kategoria->dl_id?>"<?if( $aktiv == $kategoria->dl_id ):?> selected="selected"<?endif;?>><?=$kategoria->nev?> (<?=$kategoria->darab?>)</option>
				<?endforeach;?>
			</select>
			</form>
		<?endif;?>
	</div>
	
	
	<?if(!$objects):?>
		<div style="background: url('/public/img/collection/box_errorbubble_download.png'); width: 244px; height: 66px; padding: 10px 10px 5px 20px; float: left; color: #ff8e8e;">
		<?if(hun()):?><p>A választott kategóriában nincs objektum.</p><?else:?>The selected category doesn't contain any objects.<?endif;?>
		</div>
	<?else:?>
		<div style="background: url('/public/img/collection/box_infobubble_download.png'); width: 244px; height: 66px; padding: 10px 10px 5px 20px; float: left;">
		<?=lang('collec_letoltinfok')?>
		</div>
	<?endif;?>
	
	<?/*
	<div style="padding: 8px 0 0 5px;">
	<a href="javascript:history.go(-1);" style="color: #f37d00;">
		<img src="/public/img/link_arrow_back.png" style="margin: 0px;" />
		<?=lang('back')?>
	</a>
	</div>
	*/?>

<?endif;?>

<div class="clear"></div>


<?if($objects):?>
	<table style="margin-left: -3px;" border="0">
		<?php $i=0; ?>
		<?foreach($objects as $object):?>
		<?php
			$i++;
			if($object->size < 1024*1024){
				$object->size = ceil($object->size/1024).' KB';
			}else{
				$object->size = round($object->size/(1024*1024),1).' MB';
			}
		?>
		
				<?php if($i%3==1) print "<tr>"; ?>
				<td valign="top" style="padding: 0px;">
				<div class="collection-download-list">
					
					<div style="height: 110px; overflow: hidden;" onclick="szovegmutat('azon<?=$object->c_id?>')" id="azon<?=$object->c_id?>">
					
					<?if($object->kep!=""):?>
						<a href="/<?=$object->kep?>"  class="fancy" rel="group">
							<img src="/<?=$object->kep?>" align="left" style="float: left; margin: 0px 5px 0px 0px" alt="<?=$object->title?>" />
						</a>
					<?endif;?>
					
					<div style="height: 60px; overflow: hidden;">
						<a href="/<?=$object->fajl?><?if($object->tipus == "project"):?>?filename=<?=$object->eredeti_nev?><?endif;?>">
							<strong><?=$object->title?></strong>
						</a>
						
						<?if($object->szerzo != ""):?>
							<p>
							<?=lang('collec_szerzo')?>: <?=$object->szerzo?>
							</p>
						<?endif;?>
					</div>
					
					<div class="clear"></div>
					
					<div style="margin: 0px; max-height: 36px; overflow: hidden;" id="leiras<?=($i-1)?>">
						<?=preg_replace(array("/\n/"),array("<br />"),$object->desc)?>
					</div>
					<div style="display: none;" id="readmore<?=($i-1)?>">
						<a href="/collection/desc/<?=$object->c_id?>" style="color: #f37d00;">Read more <img src="/public/img/link_arrow.png" style="margin: 0; width: 8px; height: 8px;" alt="more" />
						</a>
					</div>
					
					</div>
					
					
					<p style="text-align: left; margin-top: 0px;">
						
						<?if(!isset($szerk) || !$szerk):?>
						<input style="float: right; height: 30px;" type="button" value="<?=lang('download')?>" onclick="window.location.href='/<?=$object->fajl?><?if($object->tipus == "project"):?>?filename=<?=$object->eredeti_nev?><?endif;?>'" />
						<?else:?>
						<input style="float: right; height: 30px; background: url('/public/img/collection/button_delete.png'); padding: 0 0 4px 0;" type="button" value="<?=lang('forum_torles')?>" onclick="if(confirm('<?=lang('forum_torlesmegerosites')?>')){window.location.href='/collection/del/<?=$object->c_id?>'} else{};" />
						<input style="float: right; height: 30px; background: url('/public/img/collection/button_normal.png'); padding: 0 0 4px 0;" type="button" value="<?=lang('forum_szerk')?>" onclick="window.location.href='/collection/edit/<?=$object->c_id?>'" />
						<?endif;?>
					
					<div style="padding-top: 15px; color: #8D8D8D;">
						<?if($object->size!='0 KB'):?>(<?=$object->size?>)<?endif;?>
					</div>
					</p>
				</div>
				
				<?if(isset($this->muser->user['admin_lang'])):?>
					<?if($object->nyelv==$this->muser->user['admin_lang']):?>
						<p><?=anchor('admin/collectionedit/'.$object->c_id,$this->lang->line('page_edit'))?></p>
					<?endif;?>
				<?endif;?>
				
				</td>
				<?php if($i%3==0) print "</tr>"; ?>
			
		<?endforeach;?>
		<?php if($i%3!=0) print "</tr>"; ?>
	</table>
<?endif;?>
