<!--<?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">
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');
?>-->
