Exemplo n.º 1
0
		private void btnContinue_Click(object sender, System.EventArgs e)
		{
			ForumsConfig fc = new ForumsConfig();
			bool init = false;
			init = fc.ForumsInit(PortalId, ModuleId);
			if (init == true)
			{
				DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
				objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", init.ToString());
				DataCache.ClearAllCache(ModuleId, TabId);
				Response.Redirect(EditUrl());
			}
		}
Exemplo n.º 2
0
        private void btnContinue_Click(object sender, System.EventArgs e)
        {
            ForumsConfig fc   = new ForumsConfig();
            bool         init = false;

            init = fc.ForumsInit(PortalId, ModuleId);
            if (init == true)
            {
                DotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();
                objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", init.ToString());
                DataCache.ClearAllCache(ModuleId, TabId);
                Response.Redirect(EditUrl());
            }
        }
Exemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            jQuery.RequestRegistration();
            jQuery.RequestUIRegistration();

            IsCallBack = cbShell.IsCallback;

            btnReturn.ClientSideScript = "window.location.href = '" + Common.Globals.NavigateURL(TabId) + "';";
            var objModules = new Entities.Modules.ModuleController();

            cbModal.LoadingTemplate = GetLoadingTemplateSmall();
            Hashtable Settings   = objModules.GetModuleSettings(ModuleId);
            string    upFilePath = Server.MapPath("~/desktopmodules/activeforums/upgrade4x.txt");

            if (Convert.ToBoolean(Settings["AFINSTALLED"]) == false)
            {
                try
                {
                    var  fc             = new ForumsConfig();
                    bool configComplete = fc.ForumsInit(PortalId, ModuleId);
                    objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", configComplete.ToString());
                    if (System.IO.File.Exists(upFilePath))
                    {
                        System.IO.File.Delete(upFilePath);
                    }
                }
                catch (Exception ex)
                {
                    Services.Exceptions.Exceptions.LogException(ex);
                }
            }
            bool loadDefault = true;

            if (System.IO.File.Exists(upFilePath))
            {
                var db = new Data.Common();
                if (db.SecurityUpgraded())
                {
                    if (System.IO.File.Exists(upFilePath))
                    {
                        System.IO.File.Delete(upFilePath);
                    }
                }
                else
                {
                    loadDefault = false;
                    GetControl("upgrade", string.Empty, IsCallBack);
                }
            }

            ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/ActiveForums/ControlPanel.css");
            ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/ActiveForums/themes/" + MainSettings.Theme + "/jquery-ui.min.css");


            lblProd.Visible = true;
            lblCopy.Visible = true;
            //TODO: this should be resources instead of harcoded text?
            lblProd.Text = "Active Forums " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            lblCopy.Text = "©" + DateTime.Now.Year + " DotNetNuke Corporation";

            try
            {
                if (!Page.IsPostBack)
                {
                    GetControl(CurrentView, Params, IsCallBack);
                }
            }
            catch (Exception ex)
            {
                if (Request.QueryString["cptry"] == null)
                {
                    string sURL = EditUrl("", "", "EDIT", "cptry=1");
                    Response.Redirect(sURL);
                }
                else
                {
                    Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
                }
            }


            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/json2009.min.js", 101);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/jquery.history.js", 102);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/afadmin.js", 103);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/jquery.listreorder.js", 104);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/active/amlib.js", 105);



            string lang = "en-US";

            if (Request.QueryString["language"] != null)
            {
                lang = Request.QueryString["language"];
            }
            if (string.IsNullOrEmpty(lang))
            {
                lang = PortalSettings.DefaultLanguage;
            }
            if (string.IsNullOrEmpty(lang))
            {
                lang = "en-US";
            }
            string adminHandler = VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/handlers/adminhelper.ashx") + "?TabId=" + TabId.ToString() + "&PortalId=" + PortalId.ToString() + "&moduleid=" + ModuleId + "&language=" + lang;
            var    sb           = new StringBuilder();

            sb.AppendLine("var asScriptPath = '" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/scripts/") + "';");
            sb.AppendFormat("var afAdminHandlerURL = '{0}';", adminHandler);
            sb.AppendLine("var af_imgPath = '" + VirtualPathUtility.ToAbsolute("~/DesktopModules/ActiveForums/themes/" + MainSettings.Theme) + "';");
            string sLoadImg;

            sLoadImg  = "var afSpinLg = new Image();afSpinLg.src='" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/images/spinner-lg.gif") + "';";
            sLoadImg += "var afSpin = new Image();afSpin.src='" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/images/spinner.gif") + "';";
            sb.AppendLine(sLoadImg);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "afscripts", sb.ToString(), true);

            ServicesFramework.Instance.RequestAjaxAntiForgerySupport();
        }
Exemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);

            jQuery.RequestRegistration();
            jQuery.RequestUIRegistration();

            IsCallBack = cbShell.IsCallback;

            btnReturn.ClientSideScript = "window.location.href = '" + Common.Globals.NavigateURL(TabId) + "';";
            var objModules = new Entities.Modules.ModuleController();
            cbModal.LoadingTemplate = GetLoadingTemplateSmall();
            Hashtable Settings = objModules.GetModuleSettings(ModuleId);
            string upFilePath = Server.MapPath("~/desktopmodules/activeforums/upgrade4x.txt");
            if (Convert.ToBoolean(Settings["AFINSTALLED"]) == false)
            {
                try
                {
                    var fc = new ForumsConfig();
                    bool configComplete = fc.ForumsInit(PortalId, ModuleId);
                    objModules.UpdateModuleSetting(ModuleId, "AFINSTALLED", configComplete.ToString());
                    if (System.IO.File.Exists(upFilePath))
                    {
                        System.IO.File.Delete(upFilePath);
                    }
                }
                catch (Exception ex)
                {
                    Services.Exceptions.Exceptions.LogException(ex);
                }
            }
            bool loadDefault = true;
            if (System.IO.File.Exists(upFilePath))
            {
                var db = new Data.Common();
                if (db.SecurityUpgraded())
                {
                    if (System.IO.File.Exists(upFilePath))
                    {
                        System.IO.File.Delete(upFilePath);
                    }
                }
                else
                {
                    loadDefault = false;
                    GetControl("upgrade", string.Empty, IsCallBack);
                }
            }

            ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/ActiveForums/ControlPanel.css");
            ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/ActiveForums/themes/" + MainSettings.Theme + "/jquery-ui.min.css");


            lblProd.Visible = true;
            lblCopy.Visible = true;
            //TODO: this should be resources instead of harcoded text?
            lblProd.Text = "Active Forums " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
            lblCopy.Text = "©" + DateTime.Now.Year + " DotNetNuke Corporation";

            try
            {
                if (!Page.IsPostBack)
                {
                    GetControl(CurrentView, Params, IsCallBack);
                }

            }
            catch (Exception ex)
            {

                if (Request.QueryString["cptry"] == null)
                {
                    string sURL = EditUrl("", "", "EDIT", "cptry=1");
                    Response.Redirect(sURL);
                }
                else
                {
                    Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
                }
            }


            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/json2009.min.js", 101);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/jquery.history.js", 102);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/afadmin.js", 103);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/scripts/jquery.listreorder.js", 104);
            ClientResourceManager.RegisterScript(Page, "~/desktopmodules/activeforums/active/amlib.js", 105);






            string lang = "en-US";
            if (Request.QueryString["language"] != null)
            {
                lang = Request.QueryString["language"];
            }
            if (string.IsNullOrEmpty(lang))
            {
                lang = PortalSettings.DefaultLanguage;
            }
            if (string.IsNullOrEmpty(lang))
            {
                lang = "en-US";
            }
            string adminHandler = VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/handlers/adminhelper.ashx") + "?TabId=" + TabId.ToString() + "&PortalId=" + PortalId.ToString() + "&moduleid=" + ModuleId + "&language=" + lang;
            var sb = new StringBuilder();
            sb.AppendLine("var asScriptPath = '" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/scripts/") + "';");
            sb.AppendFormat("var afAdminHandlerURL = '{0}';", adminHandler);
            sb.AppendLine("var af_imgPath = '" + VirtualPathUtility.ToAbsolute("~/DesktopModules/ActiveForums/themes/" + MainSettings.Theme) + "';");
            string sLoadImg;
            sLoadImg = "var afSpinLg = new Image();afSpinLg.src='" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/images/spinner-lg.gif") + "';";
            sLoadImg += "var afSpin = new Image();afSpin.src='" + VirtualPathUtility.ToAbsolute("~/desktopmodules/activeforums/images/spinner.gif") + "';";
            sb.AppendLine(sLoadImg);
            Page.ClientScript.RegisterStartupScript(Page.GetType(), "afscripts", sb.ToString(), true);

            ServicesFramework.Instance.RequestAjaxAntiForgerySupport();

        }