
{include file="../head.tpl"}



<table width="100%"  border="0" cellspacing="1" cellpadding="5" class="tableborder">
	<tr>
	  <td class="header">{$langadmin.forum_header_category}      </td>
  </tr>
	<tr>
		<td class="secondrow">
		{if !$categories}
		{$langadmin.no_forums_categs}<br /><br />
		{/if}
		<input onClick="location.href = 'forum.php?action=add&amp;what=category&amp;area={$area}&amp;id={$smarty.get.id}';" type="button" class="button" value="{$langadmin.forum_add_category}"></td>
	</tr>
	{if count($errors)}
	<tr>
		<td class="secondrow">
			{foreach from=$errors item=error}
				<li>{$error}</li>
			{/foreach}
	  </td>
	</tr>
	{/if}
</table>
<br />
{if $categories}
<form action="forum.php?action=save&amp;what=position" method="post">
<table width="100%"  border="0" cellspacing="1" cellpadding="5" class="tableborder">
{foreach from=$categories item=category}

	
	
	<tr>
		<td class="header">{$category->title}</td>
		<td class="header">{$category->comment}</td>
		<td class="header">
			<div align="center">
			  <input type="hidden" name="c_id[]" value="{$category->id}" />
			  <input type="text" name="c_position[{$category->id}]" size="4" maxlength="3" value="{$category->position}" />
	          </div></td>
	  <td  class="header"><div align="center"></div></td>
	   <th  class="header">{$langadmin.pos}</th>
		<td width="10%" nowrap class="header">
			<select style="width:150px" onchange="eval(this.options[this.selectedIndex].value);selectedIndex=0;" name="cat_{$category->id}" id="cat_{$category->id}">
				<option value="location.href = 'forum.php?action=edit&amp;what=category&amp;id={$category->id}&amp;area={$area}'">{$langadmin.theoptions}</option>
				<option value="location.href = 'forum.php?action=add&amp;what=forum&amp;id={$category->id}&amp;area={$area}'">{$langadmin.forum_add_forum}</option>
				<option value="if(confirm('{$langadmin.confirm_del_forum_kat}')) location.href = 'forum.php?action=delete&amp;what=category&amp;id={$category->id}&amp;area={$area}'">{$langadmin.menue_navigation_delete}</option>
			</select>
			<input onclick="eval(document.getElementById('cat_{$category->id}').value);" type="button" class="button" value="{$langadmin.go}">
	  </td>
	</tr>

	{if count($category->forums)}

		{foreach from=$category->forums item=forum}
				<tr>
					<td nowrap class="firstrow">{$forum->visible_title}</td>
					<td class="secondrow">{$forum->comment}</td>
					<td width="10%" nowrap class="firstrow" style="font-weight:normal">
					  <div align="center">
					    {if $forum->status == 1}
                        {$langadmin.forum_status_closed}
                        {else}
                        {$langadmin.forum_status_open}
                        {/if}
</div></td>
				  <td width="10%" class="firstrow"><div align="center">{if $forum->active == 1}{$langadmin.active}{else}{$langadmin.inactive}{/if}</div></td>
					<td width="10%" nowrap class="secondrow">
						<div align="center">
						  <input type="hidden" name="f_id[]" value="{$forum->id}" />
						  <input type="text" name="f_position[{$forum->id}]" value="{$forum->position}" size="4" maxlength="4" />
				          </div></td>
					<td nowrap class="firstrow">
						<select style="width:150px" onchange="eval(this.options[this.selectedIndex].value);selectedIndex=0;" name="f_{$forum->id}" id="f_{$forum->id}">
							<option value="location.href = 'forum.php?action=edit&amp;what=forum&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.theoptions}</option>
							{if $forum->status == 0}
							<option value="location.href = 'forum.php?action=close&amp;what=forum&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.forum_close_forum}</option>
							{else}
							<option value="location.href = 'forum.php?action=open&amp;what=forum&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.forum_open_forum}</option>
							{/if}
							<option value="location.href = 'forum.php?action=add&amp;what=category&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.forum_add_category}</option>
							<option value="location.href = 'forum.php?action=edit&amp;what=mods&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.forum_edit_moderator} ({$forum->mods})</option>
							<option value="if(confirm('{$langadmin.confirm_del_forum}')) location.href = 'forum.php?action=delete&amp;what=forum&amp;id={$forum->id}&amp;area={$area}'">{$langadmin.menue_navigation_delete}</option>
						</select>
						<input onclick="eval(document.getElementById('f_{$forum->id}').value);" type="button" class="button" value="{$langadmin.go}">
				  </td>
				</tr>
			{foreach from=$forum->categories item=sub_category}
				<tr>
					<td nowrap class="firstrow">
						- - <a class="link" href="forum.php?action=view&amp;what=overview&amp;id={$forum->id}&amp;area={$area}">{$sub_category->title}</a>
					</td>
					<td colspan="6" class="firstrow">{$sub_category->comment}</td>
				</tr>
			{/foreach}
		{/foreach}

	{/if}
	
	{/foreach}

	<tr>
	  <td colspan="6" class="secondrow"><input accesskey="s" class="button" type="submit" value="{$langadmin.save}" /></td>
	</tr>
</table>
</form>
{/if}
{include file="../foot.tpl"}