示例#1
0
        //生成模板
        protected void lbtnRemark_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("app_plugin_list", MXEnums.ActionEnum.Build.ToString()); //检查权限
            //插件目录
            string pluginPath = Utils.GetMapPath("../../plugins/");

            BLL.plugin bll = new BLL.plugin();
            //查找列表
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                string   currDirName = ((HiddenField)rptList.Items[i].FindControl("hidDirName")).Value;
                CheckBox cb          = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    //是否安装
                    Model.plugin model = bll.GetInfo(pluginPath + currDirName + @"\");
                    if (model.isload == 1)
                    {
                        //生成模板
                        bll.MarkTemplet(siteConfig.webpath, "plugins/" + currDirName, "templet", pluginPath + currDirName + @"\", @"plugin/urls");
                    }
                    else
                    {
                        JscriptMsg("该插件尚未安装!", "plugin_list.aspx", "Error");
                    }
                }
            }
            AddAdminLog(MXEnums.ActionEnum.Build.ToString(), "生成插件模板"); //记录日志
            JscriptMsg("生成模板成功!", "plugin_list.aspx", "Success");
        }
示例#2
0
        //安装插件
        protected void lbtnInstall_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_plugin_config", DTEnums.ActionEnum.Instal.ToString()); //检查权限
            //插件目录
            string pluginPath = Utils.GetMapPath("../../plugins/");

            BLL.plugin bll = new BLL.plugin();
            //查找列表
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                string   currDirName = ((HiddenField)rptList.Items[i].FindControl("hidDirName")).Value;
                CheckBox cb          = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    //是否未安装
                    Model.plugin model = bll.GetInfo(pluginPath + currDirName + @"\");
                    if (model.isload == 0)
                    {
                        //安装DLL
                        string currPath = pluginPath + currDirName + @"\bin\";
                        if (Directory.Exists(currPath))
                        {
                            string[] file = Directory.GetFiles(currPath);
                            foreach (string f in file)
                            {
                                FileInfo info = new FileInfo(f);
                                //复制DLL文件
                                if (info.Extension.ToLower() == ".dll")
                                {
                                    //移动到站点目录下
                                    string newFile = Utils.GetMapPath(sysConfig.webpath + @"bin\" + info.Name);
                                    File.Copy(info.FullName, newFile, true);
                                }
                            }
                        }
                        //执行SQL语句
                        bll.ExeSqlStr(pluginPath + currDirName + @"\", @"plugin/install");
                        //添加URL映射
                        bll.AppendNodes(pluginPath + currDirName + @"\", @"plugin/urls");
                        //添加后台导航记录
                        bll.AppendMenuNodes(string.Format("{0}plugins/{1}/", sysConfig.webpath, currDirName), pluginPath + currDirName + @"\", @"plugin/menu", "sys_plugin_manage");
                        //遍历插件模板目录下的站点目录,生成模板
                        DirectoryInfo tempPath = new DirectoryInfo(pluginPath + currDirName + @"\templet\"); //插件模板目录实例
                        foreach (DirectoryInfo dirInfo in tempPath.GetDirectories())
                        {
                            //如果该站点目录存在则生成模板
                            if (Directory.Exists(Utils.GetMapPath(sysConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + dirInfo.Name + "/")))
                            {
                                bll.MarkTemplet(sysConfig.webpath, "plugins/" + currDirName + "/templet", dirInfo.Name, pluginPath + currDirName + @"\", @"plugin/urls");
                            }
                        }
                        //修改plugins节点
                        bll.UpdateNodeValue(pluginPath + currDirName + @"\", @"plugin/isload", "1");
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Instal.ToString(), "安装插件"); //记录日志
            JscriptMsg("插件安装成功!", "plugin_list.aspx", "parent.loadMenuTree");
        }
示例#3
0
 //安装插件
 protected void lbtnInstall_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("app_plugin_list", DTEnums.ActionEnum.Instal.ToString()); //检查权限
     //插件目录
     string pluginPath = Utils.GetMapPath("../../plugins/");
     BLL.plugin bll = new BLL.plugin();
     //查找列表
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         string currDirName = ((HiddenField)rptList.Items[i].FindControl("hidDirName")).Value;
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             //是否未安装
             Model.plugin model = bll.GetInfo(pluginPath + currDirName + @"\");
             if (model.isload == 0)
             {
                 //安装DLL
                 string currPath = pluginPath + currDirName + @"\bin\";
                 if (Directory.Exists(currPath))
                 {
                     string[] file = Directory.GetFiles(currPath);
                     foreach (string f in file)
                     {
                         FileInfo info = new FileInfo(f);
                         //复制DLL文件
                         if (info.Extension.ToLower() == ".dll")
                         {
                             //移动到站点目录下
                             string newFile = Utils.GetMapPath(siteConfig.webpath + @"bin\" + info.Name);
                             File.Copy(info.FullName, newFile, true);
                         }
                     }
                 }
                 //执行SQL语句
                 bll.ExeSqlStr(pluginPath + currDirName + @"\", @"plugin/install");
                 //添加URL映射
                 bll.AppendNodes(pluginPath + currDirName + @"\", @"plugin/urls");
                 //添加后台导航记录
                 bll.AppendMenuNodes(string.Format("{0}plugins/{1}/", siteConfig.webpath, currDirName), pluginPath + currDirName + @"\", @"plugin/menu", "sys_plugins");
                 //生成模板
                 bll.MarkTemplet(siteConfig.webpath, "plugins/" + currDirName, "templet", pluginPath + currDirName + @"\", @"plugin/urls");
                 //修改plugins节点
                 bll.UpdateNodeValue(pluginPath + currDirName + @"\", @"plugin/isload", "1");
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Instal.ToString(), "安装插件"); //记录日志
     JscriptMsg("插件安装成功!", "plugin_list.aspx", "Success", "parent.loadMenuTree");
 }
示例#4
0
        //生成模板
        protected void lbtnRemark_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("sys_plugin_config", DTEnums.ActionEnum.Build.ToString()); //检查权限
            //插件目录
            string pluginPath = Utils.GetMapPath("../../plugins/");

            BLL.plugin bll = new BLL.plugin();
            //查找列表
            for (int i = 0; i < rptList.Items.Count; i++)
            {
                string   currDirName = ((HiddenField)rptList.Items[i].FindControl("hidDirName")).Value;
                CheckBox cb          = (CheckBox)rptList.Items[i].FindControl("chkId");
                if (cb.Checked)
                {
                    //是否安装
                    Model.plugin model = bll.GetInfo(pluginPath + currDirName + @"\");
                    if (model.isload == 1)
                    {
                        //遍历插件模板目录下的站点目录
                        DirectoryInfo tempPath = new DirectoryInfo(Utils.GetMapPath("../../plugins/" + currDirName + "/templet/")); //插件模板目录实例
                        if (tempPath.Exists)
                        {
                            foreach (DirectoryInfo dirInfo in tempPath.GetDirectories())
                            {
                                //如果该站点目录存在则生成模板
                                if (Directory.Exists(Utils.GetMapPath(sysConfig.webpath + DTKeys.DIRECTORY_REWRITE_ASPX + "/" + dirInfo.Name + "/")))
                                {
                                    bll.MarkTemplet(sysConfig.webpath, "plugins/" + currDirName + "/templet", dirInfo.Name, pluginPath + currDirName + @"\", @"plugin/urls");
                                }
                            }
                        }
                    }
                    else
                    {
                        JscriptMsg("该插件尚未安装!", "plugin_list.aspx");
                    }
                }
            }
            AddAdminLog(DTEnums.ActionEnum.Build.ToString(), "生成插件模板"); //记录日志
            JscriptMsg("生成模板成功!", "plugin_list.aspx");
        }
示例#5
0
 //生成模板
 protected void lbtnRemark_Click(object sender, EventArgs e)
 {
     ChkAdminLevel("app_plugin_list", DTEnums.ActionEnum.Build.ToString()); //检查权限
     //插件目录
     string pluginPath = Utils.GetMapPath("../../plugins/");
     BLL.plugin bll = new BLL.plugin();
     //查找列表
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         string currDirName = ((HiddenField)rptList.Items[i].FindControl("hidDirName")).Value;
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             //是否安装
             Model.plugin model = bll.GetInfo(pluginPath + currDirName + @"\");
             if (model.isload == 1)
             {
                 //生成模板
                 bll.MarkTemplet(siteConfig.webpath, "plugins/" + currDirName, "templet", pluginPath + currDirName + @"\", @"plugin/urls");
             }
             else
             {
                 JscriptMsg("该插件尚未安装!", "plugin_list.aspx", "Error");
             }
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Build.ToString(), "生成插件模板"); //记录日志
     JscriptMsg("生成模板成功!", "plugin_list.aspx", "Success");
 }