<?php include 'header.tpl.php';?>
<div class="pMenu">
<li><a href="javascript:frmExecute('');">管理</a></li>
<li class="sel"><a href="javascript:frmExecute('edit');">编辑</a></li>
<li class="info"><a href="javascript:inc_show_help(192);" style="color:#ff0000">帮助</a></li>
</div>
<div>
<table class='pEditTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol' colspan="2"></td></tr>
<tr><td class="pTabColName">所属组：</td><td class="pTabColVal">
<select name="config_model_id">
<?php foreach($arr_model as $item){?>
<option value="<?php echo $item["model_id"];?>"<?php if($item["model_id"]==$arr_config["config_model_id"]) echo " selected";?>><?php echo $item["model_name"];?></option>
<?php }?>
</select>
</td></tr>
<tr><td class="pTabColName">类　型：</td><td class="pTabColVal">
	<select name="config_type" onchange="changeType(this.value)">
	<option value="str" <?php if("str"==$arr_config["config_type"]) echo "selected";?>>文本</option>
	<option value="textarea" <?php if("textarea"==$arr_config["config_type"]) echo "selected";?>>多行文本</option>
	<option value="int" <?php if("int"==$arr_config["config_type"]) echo "selected";?>>数字</option>
	<option value="date" <?php if("date"==$arr_config["config_type"]) echo "selected";?>>日期</option>
	<option value="bool" <?php if("bool"==$arr_config["config_type"]) echo "selected";?>>布尔</option>
	<option value="list" <?php if("list"==$arr_config["config_type"]) echo "selected";?>>列表</option>
	<option value="chk" <?php if("chk"==$arr_config["config_type"]) echo "selected";?>>多选</option>
	<option value="array" <?php if("array"==$arr_config["config_type"]) echo "selected";?>>数组</option>
	</select>
	</td></tr>
<tr><td class="pTabColName">变量名：</td><td class="pTabColVal"><input type="input" name="config_name" value="<?php echo $arr_config["config_name"];?>" size=50></td></tr>
<tr style="display:none" id="obj_sel"><td class="pTabColName">值列表：</td><td class="pTabColVal"><textarea name='config_list' id="config_list" style='width:400px;height:120px' onpropertychange='this.style.posHeight=this.scrollHeight+2'><?php echo $arr_config["config_list"];?></textarea></td>
	</tr>
<tr><td class="pTabColName">默认值：</td><td class="pTabColVal" id="obj_textarea"><input type="input" name="config_val" value="<?php echo $arr_config["config_val"];?>" size=50></td></tr>
<tr><td class="pTabColName">说　明：</td><td class="pTabColVal"><input type="input" name="config_intro" value="<?php echo $arr_config["config_intro"];?>" size=50></td></tr>
<tr><td colspan=2 class="pTabSubmit"><input type="button" name="dosubmit" value="保存" class="pSubmit" onclick="frmExecute('save')"></td></tr>
</table>
<textarea name='id_default_val' id="id_default_val" style="display:none"><?php echo $arr_config['config_val']?></textarea>
</div>
<script>
function changeType(msgval)
{
	obj=document.getElementById("obj_sel");
	if(msgval=="list"||msgval=="chk")
	{
		obj.style.display="";
		areabox_autoheight("config_list");
	}else{
		obj.style.display="none";
	}
	obj=document.getElementById("obj_textarea");
	obj_val=document.getElementById("id_default_val");
	str_default_val=obj_val.value;
	if(msgval=="textarea"||msgval=="array")
	{
		obj.innerHTML="<textarea name='config_val' id='config_val' style='width:400px;height:120px' onpropertychange='this.style.posHeight=this.scrollHeight+2'>"+str_default_val+"</textarea>";
		areabox_autoheight("config_val");
	}else{
		obj.innerHTML="<input type='input' name='config_val' value='"+str_default_val+"' size=50>";
	}
}
changeType("<?php echo $arr_config['config_type']?>");
</script>
</div>
<?php include 'footer.tpl.php';?>		