{*
  Template for the edit interface
  $Id: manage_categories.tpl,v 1.00 2007/04/22 14:00:00
*}

<!-- {$smarty.template} -->
<div id="toppage">{if $categorie.id}<a href="show_categories.php?id={$categorie.id}">{$categorie.q_longname}</a>{else}<a href="#">{$lang.newcategorie}</a>{/if}</div>

<div id="actions">
<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
	<tr>
		<td>
			<form action="categories.php" method="get" name="show">
				<input type="hidden" name="id" value="{$categorie.id}" />
				<span class="onglet">
				<input type="submit"  value="{$lang.competitions}" />
				</span>
			</form>
		</td>
	</tr>
</table>
		<!-- /actions -->
</div>	 



<script language="JavaScript" type="text/javascript" src="javascript/edit.js"></script>

<div id="pagecontent">
{if $http_error}<div class="center">{$http_error}</div>{/if}
<form action="edit_categories.php" id="edi" name="edi" method="post" enctype="multipart/form-data">
  <input type="hidden" name="id" id="id" value="{$categorie.id}" />
  <input type="hidden" name="save" id="save" value="1" />

<table id="tableshow" width="100%" cellpadding="2" cellspacing="0" border="0">
	<tr>
		<td class="title-classement" align="center">{$lang.categorys}</td>
		<td class="title-classement" align="center">{$lang.actions}</td>
		<td class="title-classement" align="center">{$lang.moveto}</td>
		
	</tr>
	{foreach item=categorie from=$categories name=cat}
 	{cycle values="lineeven,lineodd" assign=CLASS print=false}
	<tr>
		<td class="{$CLASS}"><b>» {$categorie.shortname} :</b></td>
		<td class="{$CLASS}">
		{assign var="moveup" value="`$categorie.pos-1`"}
		{assign var="movedown" value="`$categorie.pos+1`"}
		{if !$smarty.foreach.cat.first}
		<a title="{$lang.moveup}" href="manage_categories.php?op=moveup&id={$categorie.id}&pos={$moveup}&parent={$categorie.parent}"><img src="{$url_moveup}" alt="{$lang.moveup}" border="0"></a>
		{/if}
		{if !$smarty.foreach.cat.last}
		<a title="{$lang.movedown}" href="manage_categories.php?op=movedown&id={$categorie.id}&pos={$movedown}&parent={$categorie.parent}"><img src="{$url_movedown}" alt="{$lang.movedown}" border="0"></a>
		{/if}
		<a title="{$lang.edit}" href="edit_categories.php?id={$categorie.id}"><img src="{$url_edit}" alt="$lang.edit" border="0"></a>
		<a title="{$lang.del}" href="delete.php?id={$categorie.id}&cat=13"><img src="{$url_delete}" alt="{$lang.del}" border="0"></a>
		</td>
		<td class="{$CLASS}" align="right">
		<select name="parent" style="width:200px">
			<option value="0">---{$lang.category}---</option>
			{foreach item=parent from=$categories}
			<option value="{$parent.id}" {if $parent.id == $categorie.parent}Selected{/if}>{$parent.longname}</option>
			{/foreach}
		</select>
		</td>
	</tr>
	{/foreach}
	<tr>
		<td colspan="3">	
			<div>
				<span class="onglet">
				<input style="width:100%;" type="submit" value="{$lang.save}" id="savebutton" accesskey="s" />
				</span>
				<span class="onglet">
				<input style="width:100%;" type="button" value="{$lang.back}" id="backbutton" onclick="javascript:history.go(-1);" accesskey="b" />
				</span>
			</div>
		</td>
	</tr>
</table>
</form>


</div>
<!-- /content -->
