U4-7600 Remove obsoleted string helpers, string extensions & umbraco.helper
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(?<attributes>[^>]*)><img[^>]*><\\/\\?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)
|
||||
{
|
||||
|
||||
@@ -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.");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
|
||||
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)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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>
|
||||
/// 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);
|
||||
|
||||
Reference in New Issue
Block a user