<!--<?php
include_once PrintEot('left');
if(!$action){
print <<<EOT
-->
<h3><b>提示信息</b></h3>
<div class="tr5">
1、可以根据自己的需求来定义各页面各个元素所要调用的模块<br />
2、也可通过导入导出功能和别的站长分享自己的各页面配置
</div>
<h2>各页面管理</h2>
<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr3 s3">
		<td>名称</td>
		<td>SCR</td>
		<td>模板文件</td>
		<td>设置</td>
	</tr>
<!--
EOT;
foreach ($db_modepages as $key=>$value) {
print <<<EOT
-->
	<tr class="tr3">
		<td>$value[name]</td>
		<td>$key</td>
		<td>{$value[template]}.htm</td>
		<td><a href="$basename&action=setpage&template=$value[template]" class="fourm-two" title="设置"><span class="edit"></span></a></td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
	<tr class="tr3">
		<td class="xia2">导入设置</td>
		<td>
			<form action="$basename" method="post" enctype="multipart/form-data">
			<input name="modeconfig" type="file" class="input" id="modeconfig" size="30" />
			<input name="action" type="hidden" id="action" value="import" />
			<input type="submit" name="Submit5" class="btn" value="导入" />
			</form>
		</td>
		<td><a href="$basename&action=export" style="color:#ff0000">导出配置信息</a></td>
		<td><a href="$basename&action=default" style="color:#ff0000">恢复默认</a></td>
	</tr>
</table>
<!--
EOT;
}elseif($action=='setpage'){print <<<EOT
-->
<h3><b>提示信息</b></h3>
<div class="tr5">
1、可以设置每个元素的名称及调用模块<br />
</div>
<h2><b>$thispage[name]页面管理</b></h2>
<form action="$basename" method="post">
	<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
		<tr class="tr3 s3">
			<td>名称</td>
			<td>所属分类</td>
			<td>ID</td>
			<td>调用模块</td>
			<td>自定义</td>
<!--
EOT;
if($scr=='index'){
print <<<EOT
-->
			<td>更新</td>
<!--
EOT;
}
print <<<EOT
-->
		</tr>
<!--
EOT;
foreach ($pageconfig as $key=>$value) {
print <<<EOT
-->
		<tr class="tr3">
			<td>
				<input type="text" class="input" name="names[$key]" value="$value[name]">
			</td>
			<td>$value[stamp]</td>
			<td>$value[id]</td>
			<td>
				<select name="blocks[$key]">
<!--
EOT;
foreach ($value[block] as $k=>$val) {
$add = $val[bid] == $value[bid] ? 'selected="selected"':'';
print <<<EOT
-->
					<option value="$val[bid]" $add>$val[name]</option>
<!--
EOT;
}
print <<<EOT
-->
				</select>
			</td>
			<td><a href="$basename&action=setelement&id=$value[id]&scr=$scr&template=$template" class="fourm-two" title="设置"><span class="edit"></span></a></td>
<!--
EOT;
if($scr=='index'){
print <<<EOT
-->
			<td><a href="$basename&action=updatelement&id=$value[id]&scr=$scr&template=$template" class="fourm-two" title="更新"><span class="update"></span></a></td>
<!--
EOT;
}
print <<<EOT
-->
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</table><br />
	<input type="hidden" name="template" value="$template">
	<input type="hidden" name="step" value="2">
	<input type="hidden" name="action" value="setpage">
	<center><input type="submit" value="提 交" class="btn"></center><br />
</form>
<!--
EOT;
}elseif($action=='setelement'){
$paramname = array('postdate'=>'时间','url'=>'链接地址','image'=>'图片地址','title'=>'标题','costs'=>'费用','location'=>'活动地点','num'=>'人数','authorid'=>'作者uid','author'=>'作者','replies'=>'回复数','hits'=>'点击数','fid'=>'版块fid');
if ($thisconfig[$id]['stamp']=='forum') {
$paramname['title'] = '版块名称';
}elseif($thisconfig[$id]['stamp']=='user'){
$paramname['title'] = '用户名';
}elseif($thisconfig[$id]['stamp']=='tag'){
$paramname['title'] = '标签名称';
}else{
$paramname['title'] = '标题';
}
print <<<EOT
-->
<h3><b>提示信息</b></h3>
<div class="tr5">
1、自定义设置信息，自定义的部分将在排在前面<br />
2、一条信息中，如果输入不全，将不会录入
</div>
<h2><b>{$thisconfig[$id][name]} 自定义设置</b></h2>
<form action="$basename" method="post">
	<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
		<tr  class="tr3 s3">
<!--
EOT;
foreach ($params as $key=>$value) {
if(array_key_exists($value,$paramname)){
$value=$paramname[$value];
}else{
$value.='属性';
}
print <<<EOT
-->
			<td>{$value}</td>
<!--
EOT;
}
print <<<EOT
-->
		</tr>
<!--
EOT;
$i = 0;
foreach ($custom as $key=>$value) {
$i++;
print <<<EOT
-->
		<tr class="tr3">
<!--
EOT;
foreach ($params as $val) {
print <<<EOT
-->
			<td><input type="text" class="input" name="custom[$key][$val]" value="$value[$val]"></td>
<!--
EOT;
}
print <<<EOT
-->
		</tr>
<!--
EOT;
}
print <<<EOT
-->

<!--
EOT;
for ($j=$i;$j<$numlimit;$j++) {
print <<<EOT
-->
		<tr class="tr3">
<!--
EOT;
foreach ($params as $val) {
print <<<EOT
-->
			<td><input type="text" class="input" name="custom[$j][$val]" value=""></td>
<!--
EOT;
}
print <<<EOT
-->			
		</tr>
<!--
EOT;
}
print <<<EOT
-->
	</table>
	<input type="hidden" name="template" value="$template">
	<input type="hidden" name="id" value="$id">
	<input type="hidden" name="scr" value="$scr">
	<input type="hidden" name="step" value="2">
	<input type="hidden" name="action" value="setelement">
	<br /><center><input type="submit" value="提 交" class="btn"><a style="padding-left:2em" href="javascript:;" onclick="cancelCustom();">清空自定义</a></center><br />
</form>
<script language="JavaScript">
function cancelCustom(){
	var e =  document.getElementsByTagName("input");
	for (var i=0;i<e.length;i++) {
		if (e[i].type == 'text') {
			e[i].value = '';
		}
	}
}
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->