<!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=<?php echo $cfg_soft_lang; ?>">
<title>关键字管理</title>
<script language="javascript">
//获得选中文件的文件名
function SelKw(kw)
{
	if(document.form2.keywords.value)
	{
		document.form2.keywords.value += ","+kw;
	} else {
		document.form2.keywords.value = kw;
	}
}
function ReturnValue()
{
	if(window.opener.document.<?php echo $f?>.value)
	{
		window.opener.document.<?php echo $f?>.value += ','+document.form2.keywords.value;
	} else {
		window.opener.document.<?php echo $f?>.value = document.form2.keywords.value;
	}
	//window.opener=true; //firefox出错
	window.close();
}
function showHide(objname)
{
	var obj = document.getElementById(objname);
	if(obj.style.display=="none") obj.style.display = "block";
	else obj.style.display="none";
}
function AddNewKw()
{
	showHide("addnew");
}
</script>
<link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link href="../static/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="css/base.css" rel="stylesheet" type="text/css">
</head>
<body background="images/allbg.gif" leftmargin="1" topmargin="1">
<div class="main">
  <table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" bgcolor="#D6D6D6" class="table maintable table-bordered mt-3">
   <form name='form1' action="article_keywords_main.php">
   <input type='hidden' name='dopost' value='add' />
    <tr id="addnew" style="display:none">
        <td width="100%" height="26" colspan="2" align="center" bgcolor="#009900">
          <table border="0" cellspacing="0" cellpadding="0" class="table table-borderless">
            <tr>
              <td width="60" align="center">关键字:</td>
              <td width="140"><input name="keyword" type="text" id="keyword" style="width:130px" /></td>
              <td width="40">链接:</td>
              <td width="140"><input name="rpurl" type="text" id="rpurl" style="width:130px" /></td>
              <td width="40">频率:</td>
              <td width="50"><input name="rank" type="text" id="rank" style="width:30px" value="30" /></td>
              <td width="86"><input type="submit" name="Submit" value="保存" class="np"></td>
            </tr>
          </table>
		</td>
     </tr>
	 </form>
	<form name='form2'>
      <tr>
        <td width="100%" height="26" colspan="2" background="images/tbg.gif">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-borderless">
            <tr>
              <td width="31%"><strong>选择关键字</strong></td>
              <td width="69%" align="right">
                <button class="btn btn-success btn-sm" type="button" name="kwa" onClick="AddNewKw()">新增关键字</button>
                <button class="btn btn-success btn-sm" type="button" name="kwm" onClick="location='article_keywords_main.php';">关键字管理</button>
                </td>
            </tr>
          </table></td>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF" style="line-height:180%">
        	{dede:datalist}
        	 <a href='javascript:SelKw("{dede:field.keyword/}")'>{dede:field.keyword/}</a>
          {/dede:datalist}
          </td>
      </tr>
      <tr>
        <td height="26" bgcolor="#E4FAC7" style="line-height:180%">
        <table border="0" cellspacing="0" cellpadding="0" class="table table-borderless">
            <tr>
              <td width="120">已选的关键字:</td>
              <td width="320"><input name="keywords" type="text" id="keywords" style="width:300" value="<?php echo $keywords?>"></td>
              <td width="93"><button type="button" class="btn btn-success btn-sm" name="Submit" onClick="ReturnValue()"> 选用 </button></td>
            </tr>
          </table>
        </td>
      </tr>
      <tr align="center">
        <td height="26" bgcolor="#F9FCEF">
         {dede:pagelist listsize=3/}
         </td>
      </tr>
    </form>
  </table>
  <div class="tbbottom" style="text-align:right;width:99%" align="left"></div>
</div>
</body>
</html>