<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<style type="text/css">
	.tr3 .wid {
		width: 40px;
		text-align: left;
	}
	.open {
		background: url($imgpath/admin/setfourm/fourm.gif) 0 0 no-repeat;
		width: 12px;
		height: 12px;
		margin: 6px 6px 6px 0;
		cursor: pointer
	}
	.close {
		background: url($imgpath/admin/setfourm/fourm.gif) 0 -12px no-repeat;
		width: 12px;
		height: 12px;
		margin: 6px 6px 6px 0;
		cursor: pointer
	}
	.fourm {
		line-height: 22px;
		margin-left: 6px;
	}
	.fourm span {
		float: left;
		background: url($imgpath/admin/setfourm/fourm-one.gif) 0 0 no-repeat;
	}
	.fourm .fourm-one {
		background-position: left 0;
		width: 40px;
		height: 21px;
	}
	.fourm .fourm-two {
		background-position: 0 -21px;
		width: 40px;
		height: 21px;
	}
</style>
<!--
EOT;
if (empty($action)) {
print <<<EOT
-->
<h3>提示信息</h3>
<div class="tr5">
1、可以自己添加分类和模块<br />
2、系统默认的模块和分类无法编辑和删除
</div>
<h2><b>分类列表</b></h2>
<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr3 s3">
		<td>名称</td>
		<td>唯一标识</td>
		<td>默认模块</td>
		<td class="tac">内置分类</td>
		<td class="tac">查看模块</td>
		<td class="tac" style="width:40px;">编辑</td>
		<td class="tac" style="width:40px;">删除</td>
	</tr>
<!--
EOT;
foreach ($mode_stamp as $key=>$value) {
$iflock = $value[iflock] ? "是":"否";
print <<<EOT
-->
	<tr class="tr3">
		<td>$value[name]</td>
		<td>$value[stamp]</td>
		<td>$value[block]</td>
		<td class="tac">$iflock</td>
		<td class="tac"><a href="$basename&action=viewblock&sid=$value[sid]">查看</a></td>
		<td><a href="$basename&action=editstamp&stamp=$value[stamp]" class="fourm-two" title="编辑"><span class="edit"></span></a></td>
		<td><a href="$basename&action=delstamp&sid=$value[sid]" title="删除" class="fourm-two"><span class="del"></span></a></td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
</table>

<h2><b>添加新分类</b></h2>

<form action="$basename&" method="post">
	<table ellspacing="0" cellpadding="0" width="100%">
		<tr class="tr3">
			<td>名称:</td>
			<td><input type="text" class="input" name="name" /></td>
		</tr>
		<tr class="tr3">
			<td>唯一标识:</td>
			<td><input type="text" class="input" name="stamp" /></td>
		</tr>
		<tr><td></td><td style="padding:5px 5px 5px 12px;"><input type="submit" value="提 交" class="btn"/></td></tr>
	</table>
	<input type="hidden" name="action" value="addstamp" />
</form>
<!--
EOT;
}elseif($action=='viewblock'){
print <<<EOT
-->
<h3><a href="$basename&action=viewblock&sid=$stamp[sid]">$stamp[name]</a> 分类</h3>
<br/>
<h2><b>模块列表</b></h2>
<table cellspacing="0" cellpadding="0" width="100%" id="ftable">
	<tr class="tr3 s3">
		<td>名称</td>
		<td>调用函数</td>
		<td class="tac">内置模块</td>
		<td class="tac">设为默认</td>
		<td style="width:40px;" class="tac">编辑</td>
		<td style="width:40px;" class="tac">删除</td>
	</tr>
<!--
EOT;
foreach ($blocks as $key=>$value) {
$iflock = $value[iflock] ? "是":"否";
print <<<EOT
-->
	<tr class="tr3">
		<td>$value[name]</td>
		<td>$value[function]</td>
		<td class="tac">$iflock</td>
		<td class="tac"><a href="$basename&action=setdefault&bid=$value[bid]&sid=$sid">点击设为默认</a></td>
		<td><a href="$basename&action=editblock&bid=$value[bid]" class="fourm-two" title="编辑"><span class="edit"></span></a></td>
		<td><a href="$basename&action=delblock&bid=$value[bid]" title="删除" class="fourm-two"><span class="del"></span></a></td>
	</tr>
<!--
EOT;
}
print <<<EOT
-->
</table>
<br/>
<h2><b>添加新模块</b></h2>
<form action="$basename&" method="post">
	<table ellspacing="0" cellpadding="0" width="100%">
		<tr class="tr3">
			<td>名称:</td>
			<td><input type="text" class="input" name="name" value="" /></td>
		</tr>
		<tr class="tr3">
			<td>调用函数:</td>
			<td><input type="text" class="input" name="function" value="" /></td>
		</tr>
		<tr class="tr3">
			<td>type属性:</td>
			<td><input type="text" class="input" name="type" value="" /></td>
		</tr>
		<tr class="tr3">
			<td>fid属性:</td>
			<td><input type="text" class="input" name="fid" value="" /></td>
		</tr>
		<tr class="tr3">
			<td>special属性:</td>
			<td><input type="text" class="input" name="special" value="" /></td>
		</tr>
		<tr class="tr3">
			<td>缓存时间(秒)</td>
			<td><input type="text" class="input" name="cachetime" value="" /></td>
		</tr>
		<tr class="tr3" style="display:none;">
			<td>是否为外部函数:</td>
			<td><input type="radio" name="ifextra" value="0" checked>否&nbsp;<input type="radio" name="ifextra" value="1">是</td>
		</tr>
		<tr>
			<td></td>
			<td style="padding:5px 5px 5px 12px;"><input type="submit" value="提 交" class="btn"/></td>
		</tr>
	</table>
	<input type="hidden" name="sid" value="$sid" />
	<input type="hidden" name="action" value="addblock" />
</form>


<!--
EOT;
}elseif($action=='editstamp'){
print <<<EOT
-->
<h2><b>修改分类</b></h2>

<form action="$basename&" method="post">
	<table ellspacing="0" cellpadding="0" width="100%">
		<tr class="tr3">
			<td>名称:</td>
			<td><input type="text" class="input" name="name" value="$stamp[name]" /></td>
		</tr>
		<tr class="tr3">
			<td>唯一标识:</td>
			<td><input type="text" class="input" name="stamp" value="$stamp[stamp]" /></td>
		</tr>
		<tr class="tr3">
			<td>默认模块:</td>
			<td>
				<select name="init">
<!--
EOT;
foreach($blocks as $value){
$add = $stamp[init]==$value[bid]?'selected="selected"':'';
print <<<EOT
-->
					<option value="$value[bid]" $add>$value[name]</option>
<!--
EOT;
}
print <<<EOT
-->
				</select>
			</td>
		</tr>
		<tr>
			<td></td>
			<td style="padding:5px 5px 5px 12px;"><input type="submit" value="提 交" class="btn"/></td>
		</tr>
	</table>
	<input type="hidden" name="sid" value="$sid" />
	<input type="hidden" name="action" value="editstamp" />
	<input type="hidden" name="step" value="2" />
</form>
<!--
EOT;
}elseif($action=='editblock'){
print <<<EOT
-->
<h3><a href="$basename&action=viewblock&sid=$stamp[sid]">$stamp[name]</a> 分类 -- 模块修改</h3>
<form action="$basename&" method="post">
	<table ellspacing="0" cellpadding="0" width="100%">
		<tr class="tr3">
			<td>名称:</td>
			<td><input type="text" class="input" name="name" value="$block[name]" /></td>
		</tr>
		<tr class="tr3">
			<td>调用函数:</td>
			<td><input type="text" class="input" name="function" value="$block[function]" /></td>
		</tr>
		<tr class="tr3">
			<td>type属性:</td>
			<td><input type="text" class="input" name="type" value="$block[type]" /></td>
		</tr>
		<tr class="tr3">
			<td>fid属性:</td>
			<td><input type="text" class="input" name="fid" value="$block[fid]" /></td>
		</tr>
		<tr class="tr3">
			<td>special属性:</td>
			<td><input type="text" class="input" name="special" value="$block[special]" /></td>
		</tr>
		<tr class="tr3">
			<td>缓存时间(秒)</td>
			<td><input type="text" class="input" name="cachetime" value="$block[cachetime]" /></td>
		</tr>
		<tr class="tr3" style="display:none">
			<td>是否为外部函数:</td>
			<td><input type="radio" name="ifextra" value="0" $ifextra_N>否&nbsp;<input type="radio" name="ifextra" value="1" $ifextra_Y>是</td>
		</tr>
		<tr>
			<td></td>
			<td style="padding:5px 5px 5px 12px;"><input type="submit" value="提 交" class="btn" /></td>
		</tr>
	</table>
	<input type="hidden" name="sid" value="$stamp[sid]" />
	<input type="hidden" name="bid" value="$bid" />
	<input type="hidden" name="action" value="editblock" />
	<input type="hidden" name="step" value="2" />
</form>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->
