<!--<?php
include_once PrintEot('left');
print <<<EOT
-->
<div class="nav3 mb10">
    <ul class="cc">
		<li><a href="$jobUrl">基本設置</a></li>
		<li><a href="$jobUrl&adminitem=setform">預設帖子格式</a></li>
		<li class="current"><a href="$jobUrl&adminitem=pwcode">自定義代碼</a></li>
		<li><a href="$jobUrl&adminitem=commonsmile">普通表情</a></li>
		<li><a href="$jobUrl&adminitem=specialsmile">特殊表情</a></li>
    </ul>
</div>
<!--
EOT;
if(!$action){print <<<EOT
-->
<div class="admin_info mb10">
	<h3 class="h1"><b>提示信息</b></h3>
	<div class="legend">自定義代碼功能說明:<ol><li>自定義代碼是 Wind Code 代碼功能的擴展和延伸,僅對帖子有效</li>
	<li>需在<a href="$admin_file?adminjob=editer"><font color="blue">編輯器->基本設置</font></a>中開啟後方可使用</li></ol></div>
</div>
<form action="$basename" method="post" name="FORM">
<input type="hidden" name="action" value="submit" />
<h2 class="h1">
<span class="fl mr10">自定義代碼格式</span>
<a class="btn_add fl" href="$basename&action=add" hidefocus="true"><i>添加代碼格式</i></a>
</h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr2 td_bgB">
		<td width="30"><span onclick="CheckAll(document.FORM)" class="cp">全選</span></td>
		<td width="80">標簽代碼</td>
		<td width="200">標題</td>
		<td width="80">圖標</td>
		<td>操作</td>
	</tr>
<!--
EOT;
if (empty($codedb)) {print <<<EOT
-->
<tr><td class="p10" colspan="6"><div class="admin_tips">啊哦，沒有你要的信息！</div></td></tr>
<!--
EOT;
}else{
foreach($codedb as $key=>$value){print <<<EOT
-->
	<tr class="tr1 vt">
		<td class="td2"><input type="checkbox" name="selid[]" value="$value[id]" /></td>
		<td class="td2">$value[name]</td>
		<td class="td2">$value[title]</td>
		<td class="td2"><img src="$imgpath/post/c_editor/$value[icon]" /></td>
		<td class="td2"><a href="$basename&action=edit&id=$value[id]" title="編輯">[編輯]</a></td>
	</tr>
<!--
EOT;
}}print <<<EOT
-->
</table>
</div>
<div class="tac mb10">
	<span class="bt"><span><button type="button" onclick="CheckAll(document.FORM)">全 選</button></span></span>
	<span class="btn"><span><button type="submit">刪除</button></span></span>
</div>
</form>
<!--
EOT;
}elseif($action=='add' || $action=='edit'){print <<<EOT
-->
<form name="R" action="$basename" method="post">
<input type="hidden" name="action" value="$action" />
<input type="hidden" name="step" value="2" />
<input type="hidden" name="id" value="$id" />
<h2 class="h1">
<!--
EOT;
if($action=='add'){print <<<EOT
-->
	<span class="mr10">添加自定義代碼</span>
<!--
EOT;
}else{print <<<EOT
-->
	<span class="mr10">編輯自定義代碼</span>
<!--
EOT;
}print <<<EOT
-->
<a href="$basename" class="linka">返回上一級<span class="f9">▲</span></a></h2>
<div class="admin_table mb10">
<table width="100%" cellspacing="0" cellpadding="0">
	<tr class="tr1 vt">
		<td class="td1">標簽代碼</td>
		<td class="td2"><input type="text" name="name" value="$rt[name]" class="input input_wa" /></td>
	 <td class="td2"><div class="help_a">填寫方括號中的標簽代碼，如 [tag] 的標簽為 <font color="red">tag</font> </div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">標題</td>
	<td class="td2"><input type="text" name="title" value="$rt[title]" class="input input_wb" /></td>
	 <td class="td2"><div class="help_a">填寫標簽標題</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">圖標文件名</td>
		<td class="td2"><input type="text" name="icon" value="$rt[icon]" class="input input_wb" /></td>
		<td class="td2"><div class="help_a">將圖片文件上傳至根目錄下images/post/c_editor中，然後在此填寫文件名</div></td>
	</tr>
	<tr class="tr1 vt">
			<td class="td1">搜索模式</td>
		<td class="td2">
			<select name="param" size="6" multiple="multiple" onchange="showparam(this.value)">
				<option value="1" $s_1>[tag]{1}[/tag]</option>
				<option value="2" $s_2>[tag={1}]{2}[/tag]</option>
				<option value="3" $s_3>[tag={1},{2}]{3}[/tag]</option>
			</select>
			 <td class="td2"><div class="help_a">選擇內容搜索規則</div></td>
		</td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">參數類型</td>
		<td class="td2">
<!--
EOT;
for($i=0;$i<3;$i++){
$j=$i+1;
$t_0=${'r_'.$i.'_0'};
$t_1=${'r_'.$i.'_1'};
$t_2=${'r_'.$i.'_2'};
print <<<EOT
-->
		<div id="pat_$i" class="cc" style="display:none">
			<span class="fl mr10"><b>參數{{$j}}:</b></span>
			<ul class="list_A list_120">
				<li><input type="radio" name="pattern[$i]" value="0" $t_0 /> 任意字符 </li>
				<li><input type="radio" name="pattern[$i]" value="1" $t_1 /> 字母和數字 </li>
				<li><input type="radio" name="pattern[$i]" value="2" $t_2 /> 只允許數字</li>
			</ul>
		</div>
<!--
EOT;
}print <<<EOT
-->
		</td>
		 <td class="td2"><div class="help_a">選擇參數類型</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">替換規則</td>
		<td class="td2"><textarea name="replace" class="textarea">$rt[replacement]</textarea></td>
		 <td class="td2"><div class="help_a">填寫使用此標簽以後得到的內容</div></td>
	</tr>
	<tr class="tr1 vt">
		<td class="td1">提示語言</td>
	<td class="td2"><textarea name="descrip" class="textarea">$rt[descrip]</textarea></td>
	 <td class="td2"><div class="help_a">填寫各個參數時的提示<br />每行一個,分別針對{1},{2},{3}</div></td>
	</tr>
</table>
</div>
<div class="tac mb10">
	<span class="btn"><span><button type="submit">提 交</button></span></span>
</div>
</form>
<script type="text/javascript">
function showparam(id){
	for(var i=0;i<3;i++){
		document.getElementById('pat_'+i).style.display = i<id ? '' : 'none';
	}
}
showparam(document.R.param.value);
</script>
<!--
EOT;
}include_once PrintEot('adminbottom');
?>-->