{include file="page_header.htm"}
{insert_scripts files="../js/utils.js"}

<form enctype="multipart/form-data" name="theForm" action="channel.php" method="post" onsubmit="return validate()">
{foreach from=$channel_info item=list name=foo}
	<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table_form1" {if $smarty.foreach.foo.index>0} style="display:none" {/if} id="language_{$list.language_id}-table">
		<tr {if $is_page == 2} style="display:none;"{/if}>
		<td class="label" width="120">{if $channel.channel_id == 14}企业名称{else}名称{/if}:</td>
		<td><input name="name_{$list.language_id}" type="text" value="{$list.name}" size="40" class="FormSmall" /><span class="required">&nbsp;</span></td>
		</tr>
		
		{include file="channel_info_ext.htm"}

		<tr{if $is_page == 1 || $is_page == 2} style="display:none;"{/if}>
		<td class="label">上级栏目:</td>
		<td>
		<select name="parent_id_{$list.language_id}" id="parent_id_{$list.language_id}" class="channel_select" style="padding-top:3px; padding-bottom:3px;">
		<option value="0">--设为顶级分类--</option>
		{foreach from=$list.channel_tree item=val}
		<option value="{$val.channel_id}"{if $val.channel_id == $channel.parent_id} selected{/if}>{'--'|str_repeat:$val.level}{$val.name}</option>
		{/foreach}
		</select>
		</td>
		</tr>	
	
		{if $smarty.foreach.foo.index == 0}
		{if $channel.show_type != 1}
			<tr {if $is_page == 1 || $is_page == 2} style="display:none;"{/if}>
			<td class="label">栏目类型:</td>
			<td>
			<label><input name="show_type" type="radio" value="2" {if $channel.show_type == 2}checked="checked"{/if} /> 列表</label>
			<label><input name="show_type" type="radio" value="5" {if $channel.show_type == 5}checked="checked"{/if}  /> 单页</label>
			<label><input name="show_type" type="radio" value="3" {if $channel.show_type == 3}checked="checked"{/if} /> 图文</label>
			<label><input name="show_type" type="radio" value="4" {if $channel.show_type == 4}checked="checked"{/if} /> 链接</label>
			</td>
			</tr>
		{/if}
		{/if}
	
	
		<tr {if $is_page == 0 || $is_page == 2 ||  $channel.show_type == $channel_type.channel_type_link}style="display:none;"{/if}>
		<td class="label">{if $channel.channel_id == 14}企业简介{else}描述{/if}:</td>
		<td>
		{$list.description}
		</td>
		</tr>	
		
		<tr {if $is_page == 0 || $is_page == 2  || $channel.show_type == 4} style="display:none;"{/if}>
		<td class="label">模版:</td>
		<td>
		<select name="template_{$list.language_id}" class="select_input">
		<option value="">默认</option>
		{foreach from=$template item=t}
		<option value="{$t}" {if $list.template == $t}selected{/if}>{$t}</option>
		{/foreach}
		</select>
		</td>
		</tr>
		
		{if $smarty.foreach.foo.index == 0}
		<tr {if $is_page == 1 || $is_page == 2} style="display:none;"{/if}>
		<td class="label">栏目排序:</td>
		<td><input name="sort_order" type="text" value="{$channel.sort_order}" class="FormSmall" style="width:100px;" /></td>
		</tr>		
		{/if}			
	<tr>
	<td style="border:none;" class="label">&nbsp;</td>
	<td style="border:none;">
		<input type="hidden" name="id" value="{$channel.channel_id}" />
		<input type="hidden" name="status" value="{$channel.status}" />

		<input type="hidden" name="status" value="{$channel.status}" />
		<input type="hidden" name="is_page" value="{$is_page}" />
		<input type="hidden" name="source" value="{$source}" />

		<input type="hidden" name="act" value="{$form_act}" />
		<input type="submit" value="提交" class="bginput" />
		<input type="reset" value="重置" class="bginput" />
	</td>
	</tr> 	
	</table>
{/foreach}
</form>

{literal}
<script type="text/javascript">
function validate(){
    validator = new Validator("theForm");
	validator.required("name_{/literal}{$language[0].language_id}{literal}",'名称不能为空!');
    return validator.passed();
}

$(document).ready(function(){
	$('.channel_select').change(function(){
		var sel_id = $(this).val();
		$('.channel_select').val(sel_id);
	})
}) 
</script>
{/literal}
{insert_scripts files="tab.js,validator.js"}
{include file="page_footer.htm"}