<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.factory.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.valueobject.*" %>
<%@ page import="com.gx.webpage.framework.valueobject.*" %>
<%@ page import="com.gx.webpage.engine.menupage.designdbengine.api.*" %>
<%@ page import="com.gx.webpage.framework.util.inoutformat.DataBean" %>
<%
    String errStr = "";
    boolean isError = false;
    boolean isSave = false;
    String uuid = "";
    String name = "";
		String parentUuidPath = "";
    try
    {
        UserInfoCtxModel uicm = new UserInfoCtxModel();
        uicm.setUserId("cc");
        boolean isConfirm = false;
        uuid = DataBean.getStr(request, "uuid");
        name = DataBean.getStr(request, "name");
        if(request.getMethod().equalsIgnoreCase("POST"))
        {
            isSave = true;
            String tmp = DataBean.getStr(request, "confirmDel");
            if(tmp.equals("true"))
            {
                isConfirm = true;
            }
            EbiMenuMgr delegate = MenuFactory.getInstance().getEbiMenuMgr();
						SysMenuModel menuModel = delegate.findSysMenu(uuid,false, uicm);
						parentUuidPath = menuModel.getParentCatPath();
						if(parentUuidPath==null || parentUuidPath.trim().length()==0){
							parentUuidPath = "com.cc.menu."+uuid;
						}else{
							parentUuidPath = "com.cc.menu"+"."+parentUuidPath+"."+uuid;
						}
						uicm.setRowCatPath(parentUuidPath);
						uicm.setNeedDeleteAcl(true);
            if(delegate.deleteSysMenu(uuid, isConfirm, uicm) == false)
            {
                isError = true;
            }
        }
    }
    catch(Exception ex)
    {
      errStr = DataBean.getErrStr(ex);
      isError = true;
    }
%>
<html>
    <head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="./../../../webpage/common/css/common.css" rel="StyleSheet"  type="text/css" />
<script language="javascript" src="./../../../webpage/common/engine/constant.js"></script>
<script language="JScript.Encode" src="./../../../webpage/common/engine/common.js"></script>
<script language="javascript">
<!--
    function confirmSubmit(c)
    {
       document.all("confirmDel").value=c;
       window.delForm.submit();
    }
//-->
</script>
    </head>
    <body class="main">
    <p class="title">删除菜单
    <center>
<%
    if(isSave)
    {
        if(isError)
        {
%>
            <p class="error">删除菜单失败．(<%= errStr%>)
            <p class="error"><input class="butACTION" type=button name=butOK value='确　　定' onclick='window.history.go(-2);'>
<%
						return;
        }
        else
        {
%>
            <p class="information">删除菜单成功．
           <script language="javascript">
           <!--
              try{
                  parent.window.leftFrame.window.location.reload();
              }catch(e){}
           //-->
           </script>
<%
        }
    }
    else
    {
        if(isError)
        {
%>
            <p class="error">错误，请联系管理员．(<%= errStr%>)
<%
        }
        else
        {
%>
    <form name="delForm" method="POST">
         <table class="buttable2">
             <tr><td width = "100%" align = "center" colspan = 2>确实要删除这个菜单吗？<input type="hidden" name="confirmDel" value="false"><td></tr>
             <tr><td width = "100%" align = "center" colspan = 2><%= name%><input type = "hidden" name="uuid" value = "<%= uuid%>"></td></tr>
             <tr><td width = "33%"  align = "center"><input class="butACTION" type = "button" name ="butSubmit1" value = "删　　除" onclick="confirmSubmit(false);"></td>
                 <td width = "33%"  align = "center"><input class="butACTION" type = "button" name ="butCancel"  value = "取　　消" onclick="CFPFORM.cancel();"></td>
         </table>
    </form>
    </center>
<%}}%>
    </body>
</html>
