
{include file="../head.tpl"}
<form action="forum.php?action=save&amp;what=category" method="post">
	<input type="hidden" name="c_id" value="{$category->id}" />
	<input type="hidden" name="f_id" value="{$category->parent_id|default:$smarty.get.id}" />
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="tableborder">
	
	  <tr>
	    <td colspan="2" class="header">
		{if $smarty.request.action=="add"}
		{$langadmin.forum_add_category}
		{else}
		{$langadmin.forum_edit_category}
		{/if}
		</td>
    </tr>
	{if count($errors)}
    <tr>
		<td colspan="2">
			{foreach from=$errors item=error}
				<li>{$error}</li>
			{/foreach}
		</td>
	</tr>
	{/if}
	<tr>
		<td width="10%" class="firstrow">{$langadmin.title}</td>
		<td class="secondrow">
			<input type="text" name="title" value="{$smarty.post.title|default:$category->title|escape:"htmlall"|sslash}" size="50" maxlength="200" />
		</td>
	</tr>
	<tr>
		<td width="10%" class="firstrow">{$langadmin.position}</td>
		<td class="secondrow">
			<input type="text" name="position" value="{if $smarty.request.action=="add"}1{else}{$smarty.post.position|default:$category->position}{/if}" size="4" maxlength="3" />
		</td>
	</tr>
	<tr>
		<td width="10%" valign="top" class="firstrow">{$langadmin.forum_group_permission}</td>
		<td class="secondrow">
			<select name="group_id[]" multiple="multiple">
				{foreach from=$groups item=group}
				<option value="{$group->ugroup}" {if @in_array($group->ugroup, $category->group_id) || @in_array($group->ugroup, $smarty.post.group_id) || $smarty.request.action=="add"}selected="selected"{/if}>{$group->groupname}</option>
				{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		<td valign="top" class="firstrow">{$langadmin.forum_header_comment}</td>
		<td class="secondrow">
			<textarea name="comment" cols="50" rows="10">{$smarty.post.comment|default:$category->comment|escape:"htmlall"|sslash}</textarea>
		</td>
	</tr>

	<tr>
		<td colspan="2" class="secondrow">
			<input class="button" type="submit" value="{$langadmin.edit}" />
	  </td>
	</tr>
</table>
</form>
{include file="../foot.tpl"}