<!--<?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><b>提示信息</b></h3>
<div class="tr5">
<ol><li>可以自己添加分类和模块</li><li>系统默认的模块和分类无法编辑和删除</li></ol>
</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 width="70">操作</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="mr10">[编辑]</a><a href="$basename&action=delstamp&sid=$value[sid]">[删除]</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 width="70">操作</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="mr10">[编辑]</a><a href="$basename&action=delblock&bid=$value[bid]">[删除]</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="rang" 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="rang" value="$block[rang]" /></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');
?>-->
