diff --git a/src/Umbraco.Web/umbraco.presentation/helper.cs b/src/Umbraco.Web/umbraco.presentation/helper.cs index c1c90ee7ba..2b6b777793 100644 --- a/src/Umbraco.Web/umbraco.presentation/helper.cs +++ b/src/Umbraco.Web/umbraco.presentation/helper.cs @@ -29,29 +29,18 @@ namespace umbraco return umbraco.BasePages.UmbracoEnsuredPage.CurrentUser; } - [Obsolete("This method has been superceded. Use the extension method for HttpRequest or HttpRequestBase method: GetItemAsString instead.")] - public static string Request(string text) - { - if (HttpContext.Current == null) - return string.Empty; + //[Obsolete("This method has been superceded. Use the extension method for HttpRequest or HttpRequestBase method: GetItemAsString instead.")] + // public static string Request(string text) + //{ + // if (HttpContext.Current == null) + // return string.Empty; - if (HttpContext.Current.Request[text.ToLower()] != null) - if (HttpContext.Current.Request[text] != string.Empty) - return HttpContext.Current.Request[text]; + // if (HttpContext.Current.Request[text.ToLower()] != null) + // if (HttpContext.Current.Request[text] != string.Empty) + // return HttpContext.Current.Request[text]; - return String.Empty; - } - - [Obsolete("Has been superceded by Umbraco.Core.XmlHelper.GetAttributesFromElement")] - public static Hashtable ReturnAttributes(String tag) - { - var h = new Hashtable(); - foreach(var i in Umbraco.Core.XmlHelper.GetAttributesFromElement(tag)) - { - h.Add(i.Key, i.Value); - } - return h; - } + // return String.Empty; + // } public static String FindAttribute(IDictionary attributes, String key) { @@ -188,16 +177,5 @@ namespace umbraco return attributeValue; } - [UmbracoWillObsolete("We should really obsolete that one.")] - public static string SpaceCamelCasing(string text) - { - return text.SplitPascalCasing().ToFirstUpperInvariant(); - } - - [Obsolete("Use umbraco.presentation.UmbracContext.Current.GetBaseUrl()")] - public static string GetBaseUrl(HttpContext Context) - { - return Context.Request.Url.GetLeftPart(UriPartial.Authority); - } } } \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 0b92792459..0214f43158 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -892,7 +892,7 @@ namespace umbraco // extract the tag and parse it string tag = text.Substring(tagStartPos, (tagEndPos + tagEnd.Length) - tagStartPos); - Hashtable attributes = helper.ReturnAttributes(tag); + Hashtable attributes = new Hashtable(XmlHelper.GetAttributesFromElement(tag)); // create item with the parameters specified in the tag var item = new Item(); diff --git a/src/Umbraco.Web/umbraco.presentation/page.cs b/src/Umbraco.Web/umbraco.presentation/page.cs index 5a391ed232..ad92d154a1 100644 --- a/src/Umbraco.Web/umbraco.presentation/page.cs +++ b/src/Umbraco.Web/umbraco.presentation/page.cs @@ -14,6 +14,7 @@ using Umbraco.Web.Editors; using Umbraco.Web.Routing; using umbraco.cms.businesslogic.web; using Umbraco.Core.Configuration; +using Umbraco.Web; namespace umbraco { @@ -161,11 +162,11 @@ namespace umbraco HttpContext.Current.Items[Constants.Conventions.Url.AltTemplate].ToString()); _elements.Add("template", _template.ToString()); } - else if (helper.Request(Constants.Conventions.Url.AltTemplate) != String.Empty) + else if (HttpContext.Current.Request.GetItemAsString(Constants.Conventions.Url.AltTemplate) != String.Empty) { _template = umbraco.cms.businesslogic.template.Template.GetTemplateIdFromAlias( - helper.Request(Constants.Conventions.Url.AltTemplate).ToLower()); + HttpContext.Current.Request.GetItemAsString(Constants.Conventions.Url.AltTemplate).ToLower()); _elements.Add("template", _template.ToString()); } } diff --git a/src/Umbraco.Web/umbraco.presentation/template.cs b/src/Umbraco.Web/umbraco.presentation/template.cs index 93f58aa942..5967d40b31 100644 --- a/src/Umbraco.Web/umbraco.presentation/template.cs +++ b/src/Umbraco.Web/umbraco.presentation/template.cs @@ -238,7 +238,7 @@ namespace umbraco tempOutput.Remove(0, tagIndex); String tag = tempOutput.ToString().Substring(0, tempOutput.ToString().IndexOf(">") + 1); - Hashtable attributes = helper.ReturnAttributes(tag); + Hashtable attributes = new Hashtable(XmlHelper.GetAttributesFromElement(tag)); // Check whether it's a single tag () or a tag with children (...) if (tag.Substring(tag.Length - 2, 1) != "/" && tag.IndexOf(" ") > -1) @@ -398,7 +398,7 @@ namespace umbraco foreach (Match tag in tags) { - Hashtable attributes = helper.ReturnAttributes(tag.Value.ToString()); + Hashtable attributes = new Hashtable(XmlHelper.GetAttributesFromElement(tag.Value)); if (tag.ToString().ToLower().IndexOf("umbraco_macro") > -1) @@ -420,7 +420,7 @@ namespace umbraco MatchCollection tempMacros = Regex.Matches(tempElementContent, "<\\?UMBRACO_MACRO(?[^>]*)>]*><\\/\\?UMBRACO_MACRO>", RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); foreach (Match tempMacro in tempMacros) { - Hashtable tempAttributes = helper.ReturnAttributes(tempMacro.Groups["attributes"].Value.ToString()); + Hashtable tempAttributes = new Hashtable(XmlHelper.GetAttributesFromElement(tempMacro.Groups["attributes"].Value)); String macroID = helper.FindAttribute(tempAttributes, "macroid"); if (Convert.ToInt32(macroID) > 0) { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs index ab7f2f2c4b..bf94fa8712 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/delete.aspx.cs @@ -10,6 +10,7 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using umbraco.cms.businesslogic.web; using Umbraco.Core; +using Umbraco.Web; namespace umbraco.presentation.actions { @@ -19,7 +20,7 @@ namespace umbraco.presentation.actions protected void Page_Load(object sender, EventArgs e) { - d = new Document(int.Parse(helper.Request("id"))); + d = new Document(int.Parse(Request.GetItemAsString("id"))); if (!base.ValidateUserApp(Constants.Applications.Content)) throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs index be9c133e70..81f36f5f3a 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/editContent.aspx.cs @@ -8,6 +8,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using Umbraco.Web; namespace umbraco.presentation.actions { @@ -19,7 +20,7 @@ namespace umbraco.presentation.actions { protected void Page_Load(object sender, EventArgs e) { - Response.Redirect("../umbraco.aspx?app=content&rightAction=editContent&id=" + helper.Request("id") + "#content", true); + Response.Redirect("../umbraco.aspx?app=content&rightAction=editContent&id=" + Request.GetItemAsString("id") + "#content", true); } } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs index 08d33ed969..50327bb109 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/actions/preview.aspx.cs @@ -9,6 +9,7 @@ using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using umbraco.cms.businesslogic.web; using Umbraco.Core.IO; +using Umbraco.Web; namespace umbraco.presentation.actions { @@ -27,7 +28,7 @@ namespace umbraco.presentation.actions /// The instance containing the event data. protected void Page_Load(object sender, EventArgs e) { - Document doc = new Document(int.Parse(helper.Request("id"))); + Document doc = new Document(int.Parse(Request.GetItemAsString("id"))); Response.Redirect(IOHelper.ResolveUrl(string.Format("{0}/dialogs/preview.aspx?id= {1}", SystemDirectories.Umbraco, doc.Id))); } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/content.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/content.ascx.cs index a003f210bc..589f259642 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/content.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/content.ascx.cs @@ -11,6 +11,7 @@ using umbraco.presentation.create; using Content=umbraco.cms.businesslogic.Content; using umbraco.cms.helpers; using umbraco.BasePages; +using Umbraco.Web; namespace umbraco.cms.presentation.create.controls { @@ -110,7 +111,7 @@ namespace umbraco.cms.presentation.create.controls var returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), BasePage.Current.getUser(), - helper.Request("nodeType"), + Request.GetItemAsString("nodeType"), int.Parse(Request["nodeID"]), rename.Text, int.Parse(nodeType.SelectedValue)); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs index 328e459c6c..66ea0361bc 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/language.ascx.cs @@ -6,6 +6,8 @@ using System.Web.UI; using System.Web.UI.WebControls; using Umbraco.Web.UI; using umbraco.BasePages; +using Umbraco.Web; + namespace umbraco.cms.presentation.create.controls { /// @@ -40,7 +42,7 @@ namespace umbraco.cms.presentation.create.controls LegacyDialogHandler.Create( new HttpContextWrapper(Context), BasePage.Current.getUser(), - helper.Request("nodeType"), + Request.GetItemAsString("nodeType"), -1, Cultures.SelectedValue); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/create/member.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/create/member.ascx.cs index 871c48e09d..0f3d75b53f 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/create/member.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/create/member.ascx.cs @@ -1,20 +1,22 @@ using Umbraco.Web.UI; using System.Globalization; using Umbraco.Core.Security; +using System; +using System.Data; +using System.Drawing; +using System.Web; +using System.Web.UI.WebControls; +using System.Web.UI.HtmlControls; +using Umbraco.Web; +using System.Web.Security; +using umbraco.cms.helpers; +using umbraco.BasePages; +using umbraco.cms.businesslogic.member; +using MembershipProviderExtensions = Umbraco.Core.Security.MembershipProviderExtensions; namespace umbraco.cms.presentation.create.controls { - using System; - using System.Data; - using System.Drawing; - using System.Web; - using System.Web.UI.WebControls; - using System.Web.UI.HtmlControls; - - using System.Web.Security; - using umbraco.cms.helpers; - using umbraco.BasePages; - using umbraco.cms.businesslogic.member; + /// /// Summary description for member. @@ -81,7 +83,7 @@ namespace umbraco.cms.presentation.create.controls var returnUrl = LegacyDialogHandler.Create( new HttpContextWrapper(Context), BasePage.Current.getUser(), - helper.Request("nodeType"), + Request.GetItemAsString("nodeType"), -1, rename.Text + emailAppend, memberType);