<ul class="tabBut">
	{?section name=i loop=$pages?}<li id="tab_setting_{?$i['order']?}" onclick="SwapTab({?$pagecount?},{?$i['order']?});"{?if $i['order']==1?} class="on"{?/if?}>{?$pages[i].name?}</li>{?/section?}
</ul>
{?section name=i loop=$pages?}
<form id="formAdd_{?$i['key']?}" method="post">
<input type="hidden" name="dosubmit" value="1">
<input type="hidden" name="catid" value="{?$catid?}">
<input type="hidden" name="lang" value="{?$i['key']?}">
{?if $pages[i].id>0?}<input type="hidden" name="id" value="{?$pages[i].id?}">{?/if?}
<div id="div_setting_{?$i['order']?}" class="contentList"{?if $i['order']>1?} style="display:none;"{?/if?}>
	<table width="100%" class="grid">
		<tr>
			<td class="tdleft"></td>
			<td><a href="{?$saxue_url?}/content.php?pl={?$i['key']?}&catid={?$catid?}" target="_blank"><span class="blue">点击访问测试</span></a></td>
		</tr>
		<tr>
			<td class="tdleft" width="80">添加时间：</td>
			<td>{?if $pages[i].addtime==0?}--{?else?}{?$pages[i].addtime|date:"Y-m-d H:i:s"?}{?/if?}</td>
		</tr>
		<tr>
			<td class="tdleft">最近更新：</td>
			<td>{?if $pages[i].updatetime==0?}--{?else?}{?$pages[i].updatetime|date:"Y-m-d H:i:s"?}{?/if?}</td>
		</tr>
		<tr>
			<td class="tdleft">标题：</td>
			<td><input type="text" class="text" name="title_{?$i['key']?}" value="{?$pages[i].title?}" size="60" maxlength="50"></td>
		</tr>
		<tr>
			<td class="tdleft">内容：</td>
			<td>{?function saxue_geteditor:$pages[i].editorname:680:500:'':1:array('Flash','Media')?}<textarea name="content_{?$i['key']?}" id="content_{?$i['key']?}">{?$pages[i].content?}</textarea></td>
		</tr>
		<tr>
			<td class="tdleft"></td>
			<td><input type="submit" name="submit" id="submit" class="button" value="提 交"/></td>
		</tr>
	</table>
</div>
</form>
{?/section?}
<script type="text/javascript">
function SwapTab(cnt,cur){
	for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_setting_'+i).show();
			 $('#tab_setting_'+i).attr('class','on');
		}else{
			 $('#div_setting_'+i).hide();
			 $('#tab_setting_'+i).attr('class','');
		}
	}
}
$(function(){
	{?section name=i loop=$pages?}
	$("#formAdd_{?$i['key']?}").ajaxForm({
        dataType: "json",
        success : function(data){
			if(data.flag == 0){
				doTip(data.msg);
			}else{
				doDialogClose();
				window.top.mainframe.location.reload();
				doTip('『{?$pages[i].name?}』栏目内容已更新');
			}
        }
    });
	{?/section?}
})
</script>