<script language="javascript">
$(function(){
	
});

function onSubmitMenu(idd){
	$.messager.progress();
	var ids = $("#ids"+idd).val();
	$("#addFormMenu"+idd).form('submit',{
		url:'__APP__?g=<?php echo GROUP_NAME; ?>&m=<?php echo MODULE_NAME; ?>&a=role&id='+ids+'&go=1',
		onSubmit: function(){
			var isValid = $(this).form('validate');
			if (!isValid){
				$.messager.progress('close');
			}
			return isValid;
		},
		success:function(data){
			$.messager.progress('close');
			if(data==1){
				$.messager.alert('提示','权限文件修改成功！','info',function(){
					var sa = '{$TC.config.SUBMIT_ACTION}';
					$("#Menu").treegrid('reload');
					if(sa==1){
						cancel['MenuRole'].dialog('close');
						cancel['MenuRole'] = null;
					}
				});
			}else if(data==0){
				$.messager.alert('提示','权限文件修改失败！','warning');
			}else if(data==2){
				$.messager.alert('提示','权限文件修改失败！','warning');
				$.messager.alert('提示','菜单识别码无效，请检查！','warning',function(){
					var sa = '{$TC.config.SUBMIT_ACTION}';
					if(sa==1){
						cancel['MenuRole'].dialog('close');
						cancel['MenuRole'] = null;
					}
				});
			}else{
				$.messager.alert('提示','您没有修改权限！','warning',function(){
					var sa = '{$TC.config.SUBMIT_ACTION}';
					if(sa==1){
						cancel['MenuRole'].dialog('close');
						cancel['MenuRole'] = null;
					}
				});
			}
		}
	});
}

function onResetMenu(idd){
	cancel['MenuRole'].dialog('close');
	cancel['MenuRole'] = null;
}
</script>
<div class="con-tb">
<form id="addFormMenu{$uniqid}" method="post">
 <table class="infobox" width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="23%"><label for="path">文件地址</label></td>
    <td width="77%">
    {$path}<input name="code" type="hidden" value="{$code}" /><input id="ids{$uniqid}" type="hidden" value="{$id}" />
    </td>
  </tr>
  <tr>
    <td width="23%" height="325"><label for="file">配置内容</label></td>
    <td width="77%"><textarea style="width:99%; height:320px;" name="file">{$file}</textarea></td>
  </tr>
  <tr>
    <td height="38" colspan="2" align="center"><a href="javascript:void(0);" onclick="javascript:onSubmitMenu('{$uniqid}')" id="su" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a> &nbsp; <a href="javascript:void(0);" onclick="javascript:onResetMenu('{$uniqid}')" id="re" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">关闭</a></td>
  </tr>
 </table>
</form>
</div>