<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
		<title>文档关键词选择</title>
		<link rel="stylesheet" href="/static/web/css/font-awesome.min.css">
		<link rel="stylesheet" href="/static/web/css/bootstrap.min.css">
		<link rel="stylesheet" href="/static/web/css/admin.css">
	</head>
	<body>
		<div class="container-fluid">
			<div class="card shadow-sm mb-3">
				<div class="card-body">
					<input type="text" name="keywords" id="keywords" value="<?php echo $keywords?>" class="admin-input-lg mr-2">
					<button type="button" onclick="ReturnValue();" class="btn btn-success btn-sm">选用</button>
					<button type="button" onclick="location='article_keywords_main.php';" class="btn btn-success btn-sm">关键词管理</button>
				</div>
			</div>
			<div class="card shadow-sm">
				<div class="card-header">文档关键词选择</div>
				<div class="card-body">
					<form name="form2">
						<div class="table-responsive">
							<table class="table table-borderless table-hover">
								<tbody>
									<tr>
										<td colspan="2">
											{dede:datalist}
											<a href="javascript:SelKw('{dede:field.keyword/}')">{dede:field.keyword/}</a>
											{/dede:datalist}
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</form>
					{dede:pagelist listsize='6'/}
				</div>
			</div>
		</div>
		<script>
			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.close();
			}
			function showHide(objname) {
				var obj = document.getElementById(objname);
				if (obj.style.display=="none") obj.style.display = "block";
				else obj.style.display="none";
			}
		</script>
	</body>
</html>