<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<tpl>$nc_charset</tpl>" />
<title><tpl>$admin_header_tools_manage</tpl> - <tpl>$admin_tools_flink</tpl></title><!-- 工具管理 - 友情链接 -->
<link type="text/css" rel="stylesheet" href="<tpl>$Site_Url</tpl>/admin/templates/css/toolbox.css" />
<link type="text/css" rel="stylesheet" href="<tpl>$Site_Url</tpl>/admin/templates/css/main.css" />
<script type="text/javascript" src="<tpl>$Site_Url</tpl>/js/jquery/jquery.js"></script>
<script type="text/javascript" src="<tpl> $site_url </tpl>/js/jquery/jquery.validate.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	/* 对需要填写验证的信息，进行验证 */
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txt_link_url		: {required:true,url:true},
			txt_link_web_name	: {required:true}
		},
		messages: {
			txt_link_url		: {required:"<tpl>$admin_tool_link_add_url_null</tpl>",url:"<tpl>$admin_tool__link_add_url_error</tpl>"},
			txt_link_web_name	: {required:"<tpl>$admin_tool_link_add_name_null</tpl>"}
		}
	});
});
</script>

<script type="text/javascript">
$(document).ready(function(){
	$("#show_pic").click(function(){
		$("tr.display_logo").css("display","");
	});
	$("#show_tx").click(function(){
		$("tr.display_logo").css("display","none");
	});
	<tpl>if $link_array.link_logo==''</tpl>
		$("tr.display_logo").css("display","none");
	<tpl>/if</tpl>
});
</script>
</head>

<body id="noulmenu">
<div id="content">
  <form action="admin_tool_link.php?action=link_save" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <input type="hidden" name="txt_link_id" value="<tpl>$link_array.link_id</tpl>" />
  <input type="hidden" name="txt_old_pic" value="<tpl>$link_array.link_logo</tpl>" />
    <h2><tpl>$admin_header_tools_manage</tpl><!-- 工具管理 --> >> <tpl>$admin_tools_flink</tpl><!-- 添加友情链接 -->
    	<span class="alignRight"><a href="admin_tool_link.php?action=link_list" target="_self">{<tpl>$admin_tool_link_list</tpl><!-- 友情链接列表 -->}</a></span>
	</h2>
    <div class="textRight btnDiv">
      <input type="submit" name="button" id="button" value="<tpl>$admin_tool_link_add_submit</tpl>" class="btnInput" /><!-- 点此保存 -->
    </div>
    <div class="entry-body">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="100"><tpl>$admin_tool_link_add_url</tpl><!-- 网站地址 -->:</td>
				<td><input type="text" name="txt_link_url" id="txt_link_url" size="21" value="<tpl>$link_array.link_url</tpl>" />&nbsp;<span class="red">*</span>
				<div class="check-error"><label style="display:none" for="txt_link_url" class="wrong" metaDone="true" generated="true"></label></div>
				</td>
			</tr>
			<tr>
				<td><tpl>$admin_tool_link_add_name</tpl><!-- 网站名称 -->:</td>
				<td><input type="text" name="txt_link_web_name" size="21" id="txt_link_web_name" value="<tpl>$link_array.link_web_name|escape:html</tpl>" />&nbsp;<span class="red">*</span>
				<div class="check-error"><label style="display:none" for="txt_link_web_name" class="wrong" metaDone="true" generated="true"></label></div>
				</td>
			</tr>
			<tr>
				<td><tpl>$admin_tool_link_add_sort</tpl><!-- 排列顺序 -->:</td>
				<td><input type="text" size="5"  name="txt_link_sort" id="txt_link_sort" value="<tpl>$link_array.link_sort</tpl>" /></td>
			</tr>
			<tr>
				<td><tpl>$admin_tool_link_add_email</tpl><!-- 站长邮箱 -->:</td>
				<td><input type="text"  name="txt_link_email" size="21" id="txt_link_email" value="<tpl>$link_array.link_email|escape:html</tpl>" /></td>
			</tr>
			<tr>
				<td><tpl>$admin_tool_link_add_type</tpl><!-- 链接类型 -->:</td>
				<td><input type="radio" name="show_type" value="1" id="show_pic" <tpl>if $link_array.link_logo!='' </tpl> checked="checked" <tpl>/if</tpl> />
				  <tpl>$admin_tool_link_add_image</tpl>
			      <input type="radio" name="show_type" value="0" id="show_tx" <tpl>if $link_array.link_logo=='' </tpl> checked="checked" <tpl>/if</tpl> />
			      <tpl>$admin_tool_link_add_text</tpl></td>
			</tr>
			<tr class="display_logo">
				<td><tpl>$admin_tool_link_add_logo</tpl><!-- 网站logo -->:</td>
				<td><tpl>if $link_array.link_logo!=''</tpl><img src="<tpl>$Site_Url</tpl>/<tpl> $link_array.link_logo</tpl>" width="100" height="60" /><tpl> else </tpl><img src="<tpl>$Site_Url</tpl>/admin/templates/images/no_logo.gif" /><tpl>/if</tpl></td>
			</tr>
			<tr class="display_logo">
				<td><tpl>$admin_tool_link_add_uplogo</tpl><!-- 上传logo -->:</td>
				<td><input type="file" name="txt_link_logo" class="fileInput" /></td>
			</tr>
			<tr>
				<td><tpl>$admin_tool_link_add_state</tpl><!-- 链接状态 -->:</td>
				<td><tpl>$state_select</tpl></td>
			</tr>
		</table>
    </div><!--  end of entry-body  -->
    <div class="textLeft btnDiv">
      <input type="submit" name="button" id="button" value="<tpl>$admin_tool_link_add_submit</tpl>" class="btnInput" /><!-- 点此保存 -->
      <input type="reset" name="button2" id="button2" value="<tpl>$admin_tool_link_add_reset</tpl>" class="btnInput" /><!-- 重置 -->
    </div>
	<div class="clear"></div>
</form>
<tpl>include_php file ='admin_footer.php'</tpl><!-- 底部版权信息 -->
</div><!--  end of content  -->
</body>
</html>
