<!--{template 'head'}-->
<style>
table.tableborder td{padding:8px 5px}
</style>
<script language=JavaScript>
function doCheck( obj)
{
	if (document.myform.title.value=="") 
	{
		alert("请输入标题！");
		return false;
	}
	$('submit').disabled = true ;
	return true;
}
</script>
<table cellpadding="2" cellspacing="1" border="0" align=center class="tableborder" width="100%">
	<tr>
		<td class="tablerow"><b>管理选项：</b><a href="plugin.php?plugin=announcement&action=add"> 公告添加 </a> | <a href="plugin.php?plugin=announcement&action=manage">公告管理</a></td>
	</tr>
</table>

<!--{if $action=='add' || $action == 'edit'}-->
<form name="myform" id="myform" method="post" action="plugin.php?plugin=announcement&action={$action}&submit=1" onsubmit="return doCheck();">
<table cellpadding="2" cellspacing="1" class="tableborder">
	<tr>
		<th colspan=2>公告添加</th>
	</tr>
	<tr>
		<td width="15%" align="center" class="tablerowl">公告标题</td>
		<td width="85%" class="tablerow"><input class="f-text" name="title" type="text" size="60" value="{$r[title]}"></td>
	</tr>
	<tr>
		<td width="15%" align="center" class="tablerowl">所属频道</td>
		<td width="85%" class="tablerow">
			<select name="channelid" id="channelid">
				<!--{if $admin_info[groupid]==3}-->
					<!--{loop $channel $ch}-->
						<!--{if in_array($ch[channelid], $manage_channel)}-->
							<option value={$ch[channelid]}>{$ch[channelname]}</option>
						<!--{else}-->
							<OPTGROUP label="{$ch[channelname]}"></OPTGROUP>
						<!--{/if}-->
					<!--{/loop}-->
				<!--{else}-->
					<option value=0>所有频道</option>
					<!--{loop $channel $ch}-->
					<option value={$ch[channelid]}>{$ch[channelname]}</option>
					<!--{/loop}-->
				<!--{/if}-->
			</select>
		</td>
	</tr>
	<tr>
		<td align="center" class="tablerowl">公告内容</td>
		<td class="tablerow">
			<textarea name="content" id="content" style="display:none">{$r[content]}</textarea>
			<iframe height="400" frameborder="0" width="100%" scrolling="no" src="../images/fck/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Standard" id="FCKeditor1___Frame" name="FCKeditor1___Frame" style="border: 0pt none ; margin: 0pt; padding: 0pt; background-color: transparent; background-image: none; width: 100%; height: 400px;"></iframe>
		</td>
	</tr>
	<tr>
		<td class="tablerowl" colspan=2>
			<input type="hidden"  name="announceid" value="{$announceid}">
			<input type="hidden" name="insert" value=1>
			<input type="submit" name="Submit" value=" 发布公告 " id="submit" class="f-button"> &nbsp;
		</td>
	</tr>
</table>
</form>
<script type="text/javascript">
	<!--{if $action == 'edit'}-->
	selectChecked( 'channelid', '{$r[channelid]}');
	<!--{/if}-->
</script>
<!--{/if}-->


<!--{if $action=='manage'}-->
<form method="post" name="myform">
<table cellpadding="0" cellspacing="0" class="tableborder" id="mytable">
	<tr align="center">
		<td width="45" class="tablerowhighlight"></td>
		<td width="100" class="tablerowhighlight">分类</td>
		<td class="tablerowhighlight">标题</td>
		<td width=100 class="tablerowhighlight">管理操作</td>
	</tr>
	<!--{if $announces}-->
	<!--{loop $announces $announce}-->
	<tr class="item" id="item-{$announce[id]}">
		<td class="tablerowl"><input type="checkbox" name="announceid[]"  id="ids_{$announce[id]}" value="{$announce[id]}"></td>
		<td align="center">
			<!--{if $announce[channelid]>0}-->
			<a href=plugin.php?plugin=announcement&action=manage&channelid={$announce[channelid]}>{$channel[$announce[channelid]][channelname]}</a>
			<!--{else}-->
			所有频道
			<!--{/if}-->
		</td>
		<td align="left" style="padding-left:12px;">
			<a href='{W_P}index.php?ac=announcement#announcement_{$announce[id]}' target='_blank'>{$announce[title]}</a>
		</td>
		<td align="center">
			<a href='plugin.php?plugin=announcement&action=edit&announceid={$announce[id]}'>修改</a> | 
			<a onclick="return makeSure();" href='plugin.php?plugin=announcement&action=delete&announceid={$announce[id]}'>删除</a>
		</td>
	</tr>
	<!--{/loop}-->
	<!--{else}-->
	<tr>
		<td colspan="4"><p style="padding:25px;text-align:center">还没有相关数据</p></td>
	</tr>
	<!--{/if}-->
	<tr>
		<td class="tablerowl">
			<input name='chkall' type='checkbox' id='chkall' onclick='checkall(this.form)' value='checkbox'>
		</td>
		<td colspan=3 class="tablerowl" style="text-align:left;">
			<input type="submit" name="submit" value="删除选定公告" class="f-button" onClick="document.myform.action='plugin.php?plugin=announcement&action=delete'">&nbsp;&nbsp;
		</td>
	</tr>
</table>
</form>
<!--{/if}-->
<!--{template 'foot'}-->
