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

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

<?if($kategoriak):?>

<form>
<select onchange="betolt(this.value,'projects')" 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;?>

<?if(!$projects):?>
	<?if(hun()):?><p>A választott kategóriában nincs projekt.</p><?else:?>The selected category doesn't contain any projects.<?endif;?>
<?else:?>
	<table cellspacing="10px">
		<?php $i=0; ?>
		<?foreach($projects as $project):?>
		<?php
			$i++;
			if($project->pr_size < 1024*1024){
				$project->pr_size = ceil($project->pr_size/1024).' KB';
			}else{
				$project->pr_size = round($project->pr_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($project->kep!=""):?>
						<a href="/<?=$project->kep?>" target="_blank">
							<img src="/<?=$project->kep?>" align="left" style="float: left; margin: 0px 5px 0px 0px">
						</a>
					<?endif;?>
					
					<a href="/<?=$project->project?>?filename=<?=$project->eredeti_nev?>">
						<strong><?=$project->title?></strong>
					</a>
					
					<p>
						<?if($project->szerzo != ""):?>
							<?if(hun()):?>Szerző<?else:?>Author<?endif;?>: <?=$project->szerzo?><br /><br />
						<?endif;?>
						
						<div style="max-height: 30px; overflow: hidden; cursor: pointer;" onclick="szovegmutat('azon<?=$project->pr_id?>')" id="azon<?=$project->pr_id?>">
						<?=preg_replace(array("/\n/"),array("<br />"),$project->text)?>
						</div>
					</p>
					
					<div style="width: 250px; clear: both;"></div>
					
					<p style="text-align: left;">
					<a href="/<?=$project->project?>?filename=<?=$project->eredeti_nev?>">
						<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($project->pr_size!='0 KB'):?>(<?=$project->pr_size?>)<?endif;?>
						</strong>
					</a>
					</p>
				</div>
				
				<?if(isset($this->muser->user['admin_lang'])):?>
					<?if($project->nyelv==$this->muser->user['admin_lang']):?>
						<p><?=anchor('admin/projectsedit/'.$project->pr_id,$this->lang->line('page_edit'))?></p>
					<?endif;?>
				<?endif;?>
				
				</td>
				<?php if($i%3==0) print "</tr>"; ?>
			
		<?endforeach;?>
	</table>
	
	
	
	
	
	
	
	
	
	<?/*
	
	<ul class="projects-ul">
		<?foreach($projects as $project):?>
		<?php
			if($project->pr_size < 1024*1024)
			{
				$project->pr_size = ceil($project->pr_size/1024).' KB';
			}
			else
			{
				$project->pr_size = round($project->pr_size/(1024*1024),1).' MB';
			}
		?>
		
			<li>
				<a href="/<?=$project->project?>?filename=<?=$project->eredeti_nev?>">
					&nbsp;<strong><?=$project->title?></strong>
				</a>
				<?if($project->kep!=""):?>
					<a href="/<?=$project->kep?>" target="_blank">
						<img src="/<?=$project->kep?>" align="right">
					</a>
				<?endif;?>
			
				<p><?=date('Y. m. d.',strtotime($project->datum))?></p>
				<p>
					<?if($project->szerzo != ""):?>
						Szerző: <?=$project->szerzo?><br /><br />
					<?endif;?>
					<?=preg_replace(array("/\n/"),array("<br />"),$project->text)?>
				</p>
				
				<div class="clear" style="height: 5px;"></div>
				
				<span class="download-list-button">
					<?//<a href="/projects/get/<?=$project->pr_id?><?//">?>
					<a href="/<?=$project->project?>?filename=<?=$project->eredeti_nev?>">
						<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($project->pr_size!='0 KB'):?>
							(<?=$project->pr_size?>)
							<?endif;?>
							</strong>
					</a>
				</span>
			
				<div class="clear"></div>
				
				<?if(isset($this->muser->user['admin_lang'])):?>
					<?if($project->nyelv==$this->muser->user['admin_lang']):?>
						<p><?=anchor('admin/projectsedit/'.$project->pr_id,$this->lang->line('page_edit'))?></p>
					<?endif;?>
				<?endif;?>
			</li>
		<?endforeach;?>
	</ul>
	*/?>
<?endif;?>