<a href="{$config.url}admin/galleries/edit/{$link[2]}"><h2 class="cufon">Photos for gallery: {$gt}</h2></a>

{if $link[3] == 'del'}

	<form action="" method="POST">
		<input type="checkbox" name="confirm"> &nbsp; Remove this...<br><br>
		<input type="hidden" name="action" value="del" />
		<input type="submit" value="Remove" />
	</form>
	
{else}

	<form id="file" action="{$config.url}admin/photos/{$link[2]}/add" method="POST" enctype="multipart/form-data">
		<input type="hidden" name="action" value="add" />
		Add new picture <input onChange="$('#file').submit();" type="file" name="photo" />
	</form><br>
	
	{if $list}
	
		{foreach from=$list key=k item=v}
			
			<div class="fleft thumb">
				<a class="gallery" href="{$config.url}{$config.imagedir}/{$v.filename}">
					<img src="{$config.url}{$config.thumbdir}/{$v.filename}" />
				</a><br>
				{if $v.prev}
					<a href="{$config.url}admin/photos/{$link[2]}/swap/{$v.order}/{$v.prev}" title="up"><img src="{$config.templateImagesDir}admin/up.png" alt="up" /></a>
				{/if}
				{if $v.next}
					<a href="{$config.url}admin/photos/{$link[2]}/swap/{$v.order}/{$v.next}" title="down"><img src="{$config.templateImagesDir}admin/down.png" alt="down" /></a>
				{/if}
				<a href="{$config.url}admin/photos/{$link[2]}/del/{$v.id}" title="remove"><img src="{$config.templateImagesDir}admin/remove.png" alt="remove" /></a>
			</div>
				
		{/foreach}
		<div class="clear"></div>
		
		{literal}
		   <script type="text/javascript">
			    $(document).ready(function(){
			        $('a.gallery').colorbox({rel:'gallery'});
			    });
		    </script>
		{/literal}
		
	
	{else}
	
		No pictures.<br>
	
	{/if}
	
{/if}