<?php
	!defined('DIRCMS_MANAGE') && exit('Access Denied!');
?>
<!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>
<title>数据调用</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="admin/template/css/style.css" />
<script type="text/javascript" src="images/js/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
	$('#createbutton').click(function(){
		var parentid=$('#parentid').val();
		$('#tag').val('{{dir:area parentid="'+parentid+'" row="'+$('#num').val()+'"}}\n'+$('#template').val()+'\n{{/dir:area}}');
		$('#msg').html('↓将以下代码贴到模板的对应位置');
	});
	$('#areaid').change(function(){
		$('#parentid').val($('#areaid').val());
	});
});
</script>
</head>
<style type="text/css">
body,table,tr,td,input{font-family:"宋体"}
</style>
<body>
<div id="wrap">
	<div class="tab">
		<ul>
			<li><a href="javascript:void(0);" class="on">地区调用</a></li>			
		</ul>
	</div>
	<div class="main">
	<fieldset>
		<legend>操作提示</legend>
		1：通过内容调用可以方便的调用所有内容数据； 2：更多帮助文档请参看http://doc.dircms.net/
	</fieldset>
		<table cellspacing="0" class="sub">
			<tr>
				<td colspan="2" height="30" style="padding-left:10px">父地区ID：<input type="text" value="0" id="parentid" size="4" /> <?php echo $areaselect;?> <input type="checkbox" class="checkbox" onclick="if(this.checked){$('#parentid').val('$areaid')}else{$('#parentid').val(0)}" /> 按照变量读取</td>
			</tr>
			<tr>
				<td colspan="2" height="30" style="padding-left:10px">调用条数：<input type="text" value="10" id="num" size="4" /> 条 <font color="#FF0000">*0为不限条数</font></td>
			</tr>
			<tr>
				<td colspan="2" height="30" style="padding-left:10px">标记模板： 
				<br />
				<textarea id="template" cols="120" rows="13" style="font-family:'宋体'"><a href="" target="_blank" title="{{mydc:area}}">{{mydc:area}}</a>&amp;nbsp;</textarea></td>
			</tr>
			<tr>
				<td colspan="2" height="30" style="padding-left:10px">
				<ul>
					<li style="font-weight:bold">模板语法：</li>
					<li>1：{{mydc:area}}是地区的名称；</li>
					<li>2：调用条数是指显示的地区条数，结合地区排序显示对应的地区；</li>
				</ul>
				</td>
			</tr>
			<tr>
				<td colspan="2" height="30" style="padding-left:10px"><input type="button" class="button" value="生成模板调用标记" id="createbutton" /></td>
			</tr>
			<tr>
				<td colspan="2" height="30" style="padding-left:10px"><span id="msg" style="color:#ff0000; font-family:'宋体'"></span><br /><textarea id="tag"  cols="120" rows="13" style="font-family:'宋体'"></textarea></td>
			</tr>
		</table>
	</div>
</div>
</body>
</html>