<?if(false):?>
<?=$this->load->view('objects/tabs')?>
<?endif;?>

<h1><?=lang('projects_kateg')?><?//=$heading?></h1>

<?if($kategoriak):?>

<form>
<select onchange="betolt(this.value,'objects')" class="letoltesek">
	<?foreach($kategoriak as $kategoria):?>
		<?if(hun()):?>
		<option value="<?=$kategoria->dl_id?>"<?if( $aktiv == $kategoria->dl_id ):?> selected="selected"<?endif;?>>
			<?=$kategoria->nev?>
			(<?=$kategoria->darab?>)
		</option>
		<?else:?>
		<option value="<?=$kategoria->dl_id?>"<?if( $aktiv == $kategoria->dl_id ):?> selected="selected"<?endif;?>>
			<?=$kategoria->nev?>
			(<?=$kategoria->darab?>)
		</option>
		<?endif;?>
	<?endforeach;?>
</select>

<?//<input type="submit" value="OK" name="dbkat">?>
</form>
<?endif;?>


<?if(!$objects):?>
	<?if(hun()):?><p>A választott kategóriában nincs objektum.</p><?else:?>The selected category doesn't contain any objects.<?endif;?>
<?else:?>
	<table cellspacing="10px">
		<?php $i=0; ?>
		<?foreach($objects as $object):?>
		<?php
			$i++;
			if($object->obj_size < 1024*1024){
				$object->obj_size = ceil($object->obj_size/1024).' KB';
			}else{
				$object->obj_size = round($object->obj_size/(1024*1024),1).' MB';
			}
		?>
		
				<?php if($i%3==1) print "<tr>"; ?>
				<td valign=top style="border: 1px solid #c4c4c4;">
				<div class="download-list-button-obj">
					
					<?if($object->kep!=""):?>
						<a href="/<?=$object->kep?>" target="_blank">
							<img src="/<?=$object->kep?>" align="left" style="float: left; margin: 0px 5px 0px 0px">
						</a>
					<?endif;?>
					
					<a href="/<?=$object->object?>">
						<strong><?=$object->title?></strong>
					</a>
					
					<p>
						<?if($object->szerzo != ""):?>
							<?if(hun()):?>Szerző<?else:?>Author<?endif;?>: <?=$object->szerzo?><br /><br />
						<?endif;?>
						
						<div style="max-height: 30px; overflow: hidden; cursor: pointer;" onclick="szovegmutat('azon<?=$object->obj_id?>')" id="azon<?=$object->obj_id?>">
						<?=preg_replace(array("/\n/"),array("<br />"),$object->text)?>
						</div>
					</p>
					
					<div style="width: 250px; clear: both;"></div>
					
					<p style="text-align: left;">
					<a href="/<?=$object->object?>">
						<img src="/public/img/gombok/btnDown_icon.gif" alt="">
						<strong>
							<?if(hun()):?>Letöltés indítása<?elseif(jap()):?>ダウンロード開始<?else:?>Start download<?endif;?>
							<?if($object->obj_size!='0 KB'):?>(<?=$object->obj_size?>)<?endif;?>
						</strong>
					</a>
					</p>
				</div>
				
				<?if(isset($this->muser->user['admin_lang'])):?>
					<?if($object->nyelv==$this->muser->user['admin_lang']):?>
						<p><?=anchor('admin/objectsedit/'.$object->obj_id,$this->lang->line('page_edit'))?></p>
					<?endif;?>
				<?endif;?>
				
				</td>
				<?php if($i%3==0) print "</tr>"; ?>
			
		<?endforeach;?>
	</table>
<?endif;?>