


<table width="100%"  border="0" cellspacing="1" cellpadding="5" class="tableborder">
	<tr>
	  <td class="header">{#Forums_title#}</td>
  </tr>
	<tr>
		<td class="second">
		{if !$categories}
		{$langadmin.no_forums_categs}<br /><br />
		{/if}
        <a href="" onclick="popup('?do=forums&amp;sub=newcategory&amp;id={$smarty.get.id|default:0}&amp;noframes=1', 'new','700','450','no')"><img class="absmiddle" src="{$imgpath}/add.png" alt="" border="" /></a>
        <a href="" onclick="popup('?do=forums&amp;sub=newcategory&amp;id={$smarty.get.id|default:0}&amp;noframes=1', 'new','700','450','no')">{#Forums_addCateg#}</a>
        
        
        </td>
	</tr>
	{if count($errors)}
	<tr>
		<td class="second">
			{foreach from=$errors item=error}
				<li>{$error}</li>
			{/foreach}
	  </td>
	</tr>
	{/if}
</table>
<br />
{if $categories}
<form action="" method="post">

<table width="100%"  border="0" cellspacing="0" cellpadding="5">
<tr>
	  <td colspan="3" class="header" >{#Forums_fheader#}</td>
	  <th  class="header" style="font-weight:bold">{#Global_Position#}</th>
	  <td nowrap class="header" style="font-weight:bold">{#Global_Actions#}</td>
    </tr>
	{foreach from=$categories item=category}

	
	
	
	<tr>
		<td colspan="3" class="headers" >{$category->title|sslash|escape:html}<br />
		<span style="font-weight:normal"><small>{$category->comment|sslash|escape:html}</small></span>		</td>
	  <th  class="headers" style="font-weight:normal"><input type="hidden" name="c_id[]" value="{$category->id}" />
      <input class="input" type="text" name="c_position[{$category->id}]" size="2" maxlength="2" value="{$category->position}" /></th>
		<td width="10%" nowrap class="headers" style="font-weight:normal">

{if perm('forum_categoryedit')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_CategEdit width=200} href="javascript:void(0);" onclick="popup('index.php?do=forums&amp;sub=editcategory&amp;id={$category->id}&amp;noframes=1', 'edit','700','450','no')"><img class="absmiddle" src="{$imgpath}/edit.png" alt="" border="" /></a>{/if} 
{if perm('forum_add')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_new width=200} href="javascript:void(0);" onclick="popup('index.php?do=forums&amp;sub=addforum&amp;id={$category->id}&amp;noframes=1','forumnew','700','600','no')"><img class="absmiddle" src="{$imgpath}/add.png" alt="" border="" /></a>{/if} 
{if perm('forum_categoryedit')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Global_Delete  width=200} onclick="if(confirm('{#Forums_CDelCateg#}')){ldelim}popup('index.php?do=forums&amp;sub=deletecategory&amp;id={$category->id}&amp;noframes=1','forumnew','1','1','no'){rdelim}" href="javascript:void(0);"><img class="absmiddle" src="{$imgpath}/delete.png" alt="" border="" /></a>{/if}	  </td>
	</tr>

	{if count($category->forums)}

		{foreach from=$category->forums item=forum}
				<tr>
					<td class="forum_rows"><strong>{$forum->visible_title|sslash|escape:html}</strong>
					  <div style="padding-left:8px">
				  <small>{$forum->comment|sslash|escape:html}</small>					</div>				  </td>
					<td width="10%" nowrap class="forum_rows" 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="forum_rows"><div align="center">{if $forum->active == 1}{$langadmin.active}{else}{$langadmin.inactive}{/if}</div></td>
					<td width="10%" align="center" nowrap class="forum_rows">
					  <input type="hidden" name="f_id[]" value="{$forum->id}" />					  
                      <input class="input" type="text" name="f_position[{$forum->id}]" value="{$forum->position}" size="2" maxlength="2" />			          </td>
					<td nowrap class="forum_rows">

{if perm('forum_edit')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_fEdit width=200}  href="javascript:void(0);" onclick="popup('index.php?do=forums&amp;sub=editforum&amp;id={$forum->id}&amp;noframes=1', 'edit','700','650','yes')"><img class="absmiddle" src="{$imgpath}/edit.png" alt="" border="" /></a>
{if $forum->status == 0}
<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_close width=200}  href="index.php?do=forums&amp;sub=closeforum&amp;id={$forum->id}{if $smarty.request.id}&amp;fid={$smarty.request.id}{/if}"><img class="absmiddle" src="{$imgpath}/opened.png" alt="" border="0" /></a>
{else}
<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_open width=200} href="index.php?do=forums&amp;sub=openforum&amp;id={$forum->id}{if $smarty.request.id}&amp;fid={$smarty.request.id}{/if}"><img class="absmiddle" src="{$imgpath}/closed.png" alt="" border="0" /></a>
{/if}
{/if}
{if perm('forum_add')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_addCateg width=200} href="javascript:void(0);" onclick="popup('?do=forums&amp;sub=newcategory&amp;id={$forum->id}&amp;noframes=1', 'new','700','450','no')"><img class="absmiddle" src="{$imgpath}/add.png" alt="" border="" /></a>{/if} 
{if perm('forum_mods')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_mods width=200} title="{$forum->mods}" href="javascript:void(0);" onclick="popup('?do=forums&amp;sub=editmods&amp;id={$forum->id}&amp;noframes=1', 'mods','700','450','no')"><img class="absmiddle" src="{$imgpath}/mods.png" alt="" border="" /></a>{/if} 
{if perm('forum_delete')}<a {popup sticky=$config_vars.POPSTICKY  text=$config_vars.Forums_del width=200}  onclick="if(confirm('{#Forums_CDelForum#}')){ldelim}popup('index.php?do=forums&amp;sub=deleteforum&amp;id={$forum->id}','del','1','1','no'){rdelim}" href="javascript:void(0);"><img class="absmiddle" src="{$imgpath}/delete.png" alt="" border="" /></a>{/if}
</td>
				</tr>
			{foreach from=$forum->categories item=sub_category}
				<tr>
					<td class="forum_rows" colspan="6">
						- - <a class="link" href="index.php?do=forums&amp;sub=overview&amp;id={$forum->id}">{$sub_category->title}</a>					
                        </td>
					
				</tr>
			{/foreach}
		{/foreach}

	{/if}
	
	{/foreach}
</table>
<input accesskey="s" class="button big" type="submit" value="{#Global_SavePos#}" />
<input name="subaction" type="hidden" id="subaction" value="{$smarty.request.action}" />
<input type="hidden" name="save" value="1" />
<input name="id" type="hidden" id="id" value="{$smarty.request.id}" />
</form>
{/if}
