protected void Page_Load(Object sender, EventArgs e) { // set page title string strTitle = PortalSettings.PortalName + " > Insert Link"; // show copyright credits? if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") == "Y") { strTitle += " ( DNN " + PortalSettings.Version + " )"; } Title = strTitle; HtmlInputHidden htmlhidden = new HtmlInputHidden(); PortalSettings _portalSettings = PortalController.GetCurrentPortalSettings(); htmlhidden.ID = "TargetFreeTextBox"; htmlhidden.Value = Request.Params["ftb"]; phHidden.Controls.Add(htmlhidden); htmlhidden = new HtmlInputHidden(); htmlhidden.ID = "DNNDomainNameTabid"; htmlhidden.Value = "http://" + Globals.GetDomainName(Request) + "/" + Globals.glbDefaultPage + "?tabid="; phHidden.Controls.Add(htmlhidden); htmlhidden = new HtmlInputHidden(); htmlhidden.ID = "DNNDomainNameFilePath"; htmlhidden.Value = "http://" + Globals.GetDomainName(Request) + _portalSettings.HomeDirectory.Replace(Request.ApplicationPath, ""); phHidden.Controls.Add(htmlhidden); }
protected void Page_Load(Object sender, EventArgs e) { // public attributes if (!String.IsNullOrEmpty(CssClass)) { hypDotNetNuke.CssClass = CssClass; } // get Product Name and Legal Copyright from constants (Medium Trust) hypDotNetNuke.Text = Globals.glbLegalCopyright.Replace("YYYY", DateTime.Now.Year.ToString()); hypDotNetNuke.NavigateUrl = Globals.glbAppUrl; // show copyright credits? if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") != "Y") { this.Visible = false; } }
/// <remarks> /// - Obtain PortalSettings from Current Context /// - redirect to a specific tab based on name /// - if first time loading this page then reload to avoid caching /// - set page title and stylesheet /// - check to see if we should show the Assembly Version in Page Title /// - set the background image if there is one selected /// - set META tags, copyright, keywords and description /// </remarks> /// <history> /// [sun1] 1/19/2004 Created /// </history> private void InitializePage() { TabController objTabs = new TabController(); TabInfo objTab; // redirect to a specific tab based on name if (Request.QueryString["tabname"] != "") { string strURL = ""; objTab = objTabs.GetTabByName(Request.QueryString["TabName"], ((PortalSettings)HttpContext.Current.Items["PortalSettings"]).PortalId); if (objTab != null) { int actualParamCount = 0; string[] elements = new string[Request.QueryString.Count - 1 + 1]; //maximum number of elements for (int intParam = 0; intParam <= Request.QueryString.Count - 1; intParam++) { switch (Request.QueryString.Keys[intParam].ToLower()) { case "tabid": break; case "tabname": break; default: elements[actualParamCount] = Request.QueryString.Keys[intParam] + "=" + Request.QueryString[intParam]; actualParamCount++; break; } } string[] copiedTo = new string[actualParamCount - 1 + 1]; elements.CopyTo(copiedTo, 0); //redim to remove blank elements elements = copiedTo; //elements = (string[])Microsoft.VisualBasic.CompilerServices.Utils.CopyArray( (Array)elements, new string[actualParamCount - 1 + 1] ); //redim to remove blank elements Response.Redirect(Globals.NavigateURL(objTab.TabID, Null.NullString, elements), true); } } if (Request.IsAuthenticated) { // set client side page caching for authenticated users if (Convert.ToString(PortalSettings.HostSettings["AuthenticatedCacheability"]) != "") { switch (Convert.ToString(PortalSettings.HostSettings["AuthenticatedCacheability"])) { case "0": Response.Cache.SetCacheability(HttpCacheability.NoCache); break; case "1": Response.Cache.SetCacheability(HttpCacheability.Private); break; case "2": Response.Cache.SetCacheability(HttpCacheability.Public); break; case "3": Response.Cache.SetCacheability(HttpCacheability.Server); break; case "4": Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); break; case "5": Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate); break; } } else { Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); } } // page comment if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") == "Y") { Comment += "\r\n" + "<!--*********************************************-->" + "\r\n" + "<!-- DotNetNuke - http://www.dotnetnuke.com -->" + "\r\n" + "<!-- Copyright (c) 2002-2007 -->" + "\r\n" + "<!-- by DotNetNuke Corporation -->" + "\r\n" + "<!--*********************************************-->" + "\r\n"; } Page.Header.Controls.AddAt(0, new LiteralControl(Comment)); if (PortalSettings.ActiveTab.PageHeadText != Null.NullString) { Page.Header.Controls.Add(new LiteralControl(PortalSettings.ActiveTab.PageHeadText)); } if (PortalSettings.ActiveTab.PageHeadText != Null.NullString) { Page.Header.Controls.Add(new LiteralControl(PortalSettings.ActiveTab.PageHeadText)); } // set page title string strTitle = PortalSettings.PortalName; foreach (TabInfo tempLoopVar_objTab in PortalSettings.ActiveTab.BreadCrumbs) { objTab = tempLoopVar_objTab; strTitle += " > " + objTab.TabName; } // show copyright credits? if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") == "Y") { strTitle += " ( DNN " + PortalSettings.Version + " )"; } // tab title override if (!String.IsNullOrEmpty(PortalSettings.ActiveTab.Title)) { strTitle = PortalSettings.ActiveTab.Title; } this.Title = strTitle; //set the background image if there is one selected if (this.FindControl("Body") != null) { if (!String.IsNullOrEmpty(PortalSettings.BackgroundFile)) { ((HtmlGenericControl)this.FindControl("Body")).Attributes["background"] = PortalSettings.HomeDirectory + PortalSettings.BackgroundFile; } } // META Refresh if (PortalSettings.ActiveTab.RefreshInterval > 0 && Request.QueryString["ctl"] == null) { MetaRefresh.Content = PortalSettings.ActiveTab.RefreshInterval.ToString(); } else { MetaRefresh.Visible = false; } // META description if (!String.IsNullOrEmpty(PortalSettings.ActiveTab.Description)) { Description = PortalSettings.ActiveTab.Description; } else { Description = PortalSettings.Description; } // META keywords if (!String.IsNullOrEmpty(PortalSettings.ActiveTab.KeyWords)) { KeyWords = PortalSettings.ActiveTab.KeyWords; } else { KeyWords = PortalSettings.KeyWords; } if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") == "Y") { KeyWords += ",DotNetNuke,DNN"; } // META copyright if (!String.IsNullOrEmpty(PortalSettings.FooterText)) { Copyright = PortalSettings.FooterText; } else { Copyright = "Copyright (c) " + DateTime.Now.ToString("yyyy") + " by " + PortalSettings.PortalName; } // META generator if (Globals.GetHashValue(Globals.HostSettings["Copyright"], "Y") == "Y") { Generator = "DotNetNuke " + PortalSettings.Version; } else { Generator = ""; } Page.ClientScript.RegisterClientScriptInclude("dnncore", ResolveUrl("~/js/dnncore.js")); }