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


<form action="forum.php?action=save&amp;what=forum" method="post">
	<input type="hidden" name="f_id" value="{$forum->id}" />
	<input type="hidden" name="c_id" value="{$forum->category_id|default:$smarty.get.id}" />
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="tableborder">
<tr>
<td colspan="2" class="header">{$langadmin.forums_options}</td>
</tr>
	{if count($errors)}
	<tr>
		<td colspan="2">
			{foreach from=$errors item=error}
				<li>{$error}</li>
			{/foreach}
		</td>
	</tr>
	{/if}
	<tr>
		<td width="40%" class="firstrow">{$langadmin.title}</td>
		<td class="secondrow">
			<input type="text" name="title" value="{$smarty.post.title|default:$forum->title}" size="50" maxlength="200" />
		</td>
	</tr>
	<tr>
		<td width="40%" valign="top" class="firstrow">{$langadmin.forum_descr}</td>
		<td class="secondrow">
			<textarea name="comment" cols="50" rows="10">{$smarty.post.comment|default:$forum->comment}</textarea>
		</td>
	</tr>
{if $smarty.request.action != "add"}
	<tr>
		<td width="40%" valign="top" class="firstrow">{$langadmin.forum_group_permission}</td>
		<td class="secondrow">
			{foreach from=$groups item=group}
			
				{if @in_array($group->ugroup, $forum->group_id) || @in_array($group->ugroup, $smarty.post.group_id)}
				<a href="javascript:;" onclick="window.open('forum.php?action=edit&amp;what=permissions&amp;g_id={$group->ugroup}&amp;f_id={$forum->id}','','left=0,top=0,scrollbars=yes,width=550,height=600');">{$group->groupname}</a><br />
				<input type="hidden" name="group_id[]" value="{$group->ugroup}" />
				{/if}
			{/foreach}
		</td>
	</tr>
{/if}
	<tr>
		<td width="40%" class="firstrow">{$langadmin.forum_active}<br>
	    <small><small>{$langadmin.forum_notactive_text}</small></small></td>
		<td class="secondrow">
			<select name="active">
				<option value="1" {if $forum->active == 1 || $smarty.request.action == "add"}selected="selected"{/if}>{$langadmin.yes}</option>
				<option value="0" {if $forum->active == 0 && $smarty.request.action != "add"}selected="selected"{/if}>{$langadmin.no}</option>
			</select>
		</td>
	</tr>
	<tr>
		<td width="40%" class="firstrow">{$langadmin.status}<small><small><br>
	    {$langadmin.forum_closed_text}</small></small></td>
		<td class="secondrow">
			<select name="status">
				<option value="0" {if $forum->status == 0}selected="selected"{/if}>{$langadmin.forum_opened}</option>
				<option value="1" {if $forum->status == 1}selected="selected"{/if}>{$langadmin.forum_closed}</option>
			</select>
		</td>
	</tr>
	<tr>
	  <td width="40%" class="firstrow">{$langadmin.topic_notification_title}<br />
	  <small>
	  {$langadmin.topic_notification_text}</small></td>
	  <td class="secondrow"><input name="topic_emails" type="text" id="topic_emails" value="{$forum->topic_emails|escape:"htmlall"}" size="50"></td>
    </tr>
	<tr>
	  <td width="40%" class="firstrow">{$langadmin.post_notification_title}<br />
        <small> <small>{$langadmin.post_notification_text}</small></small></td>
	  <td class="secondrow"><input name="post_emails" type="text" id="post_emails" value="{$forum->post_emails|escape:"htmlall"}" size="50"></td>
    </tr>
	<tr>
		<td width="40%" class="firstrow">{$langadmin.forum_moderated}<br />
		 <small>{$langadmin.moderate_topics_text}</small></td>
		<td class="secondrow">
			<input name="moderated" type="checkbox" value="1" {if $forum->moderated==1}checked="checked"{/if} />
		</td>
	</tr>
	<tr>
	  <td width="40%" class="firstrow">{$langadmin.moderate_posts}<br />
	  <small>{$langadmin.moderate_posts_text}</small></td>
	  <td class="secondrow">
	  <input name="moderated_posts" type="checkbox" value="1" {if $forum->moderated_posts==1}checked="checked"{/if} />
	  </td>
    </tr>
	<tr>
		<td width="40%" class="firstrow">{$langadmin.forum_password}<br />
          <small>{$langadmin.forum_password_text}</small></td>
		<td class="secondrow">
			<input type="text" name="password" value="{$forum->password_raw}" />
		</td>
	</tr>
	<tr>
		<td colspan="2" class="secondrow">
			<input accesskey="s"  class="button" type="submit" value="{$langadmin.edit}" />
	  </td>
	</tr>
</table>
</form>
{include file="../foot.tpl"}