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

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


<?if($kategoriak):?>

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

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


<?if(!$groups):?>
	<?if(hun()):?><p>A választott kategóriában nincs csoport.</p><?else:?>The selected category doesn't contain any groups.<?endif;?>
<?else:?>
	<table cellspacing="10px">
		<?php $i=0; ?>
		<?foreach($groups as $group):?>
		<?php
			$i++;
			if($group->gr_size < 1024*1024){
				$group->gr_size = ceil($group->gr_size/1024).' KB';
			}else{
				$group->gr_size = round($group->gr_size/(1024*1024),1).' MB';
			}
		?>
		
				<?php if($i%2==1) print "<tr>"; ?>
				<td valign=top style="border: 1px solid #c4c4c4;">
				<div class="download-list-button-obj">
					
					<?if($group->kep!=""):?>
						<a href="/<?=$group->kep?>" target="_blank">
							<img src="/<?=$group->kep?>" align="left" style="float: left; margin: 0px 5px 0px 0px">
						</a>
					<?endif;?>
					
					<a href="/<?=$group->group?>">
						<strong><?=$group->title?></strong>
					</a>
					
					<p>
						<?if($group->szerzo != ""):?>
							<?if(hun()):?>Szerző<?else:?>Author<?endif;?>: <?=$group->szerzo?><br /><br />
						<?endif;?>
						
						<div style="max-height: 30px; overflow: hidden; cursor: pointer;" onclick="szovegmutat('azon<?=$group->gr_id?>')" id="azon<?=$group->gr_id?>">
						<?=preg_replace(array("/\n/"),array("<br />"),$group->text)?>
						</div>
					</p>
					
					<div style="width: 250px; clear: both;"></div>
					
					<p style="text-align: left;">
					<a href="/<?=$group->group?>">
						<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($group->gr_size!='0 KB'):?>(<?=$group->gr_size?>)<?endif;?>
						</strong>
					</a>
					</p>
				</div>
				
				<?if(isset($this->muser->user['admin_lang'])):?>
					<?if($group->nyelv==$this->muser->user['admin_lang']):?>
						<p><?=anchor('admin/groupsedit/'.$group->gr_id,$this->lang->line('page_edit'))?></p>
					<?endif;?>
				<?endif;?>
				
				</td>
				<?php if($i%2==0) print "</tr>"; ?>
			
		<?endforeach;?>
	</table>
<?endif;?>