diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ea4f70bf3b..5b2336a426 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -830,10 +830,8 @@ - - @@ -1244,7 +1242,6 @@ Form - diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/AssignDomain.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/AssignDomain.aspx deleted file mode 100644 index 13bf9ddc13..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dialogs/AssignDomain.aspx +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="True" Inherits="umbraco.dialogs.AssignDomain" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - - - - - - - -
<%= Services.TextService.Localize("assignDomain/domainHelp") %> -
- - - - - - - - - -
- - - - - - - -

- <%= Services.TextService.Localize("defaultdialogs/closeThisWindow")%> -

-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx deleted file mode 100644 index 31451e7a25..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dialogs/emptyTrashcan.aspx +++ /dev/null @@ -1,83 +0,0 @@ -<%@ Page Language="C#" MasterPageFile="../masterpages/umbracoDialog.Master" AutoEventWireup="true" Inherits="umbraco.presentation.dialogs.emptyTrashcan" %> -<%@ Import Namespace="System.Globalization" %> -<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> - - - - - - - - - - -
- - - - - - - -
-

<%= Services.TextService.Localize("defaultdialogs/recycleBinWarning")%>

- -
-
-
- -
-
- " class="guiInputButton" onclick="if ($get('confirmDelete').checked) {emptyRecycleBin();}" disabled="true" /> - <%= Services.TextService.Localize("or") %> - - <%=Services.TextService.Localize("cancel")%> - -
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/webservices/trashcan.asmx b/src/Umbraco.Web.UI/umbraco/webservices/trashcan.asmx deleted file mode 100644 index f075057517..0000000000 --- a/src/Umbraco.Web.UI/umbraco/webservices/trashcan.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService Language="C#" CodeBehind="trashcan.asmx.cs" Class="umbraco.presentation.webservices.trashcan" %> diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c16363d3a6..da61ca89d9 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -928,15 +928,9 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind - - ASPXCodeBehind - AssignDomain2.aspx ASPXCodeBehind @@ -1670,10 +1664,6 @@ templates.asmx Component - - trashcan.asmx - Component - ASPXCodeBehind @@ -1849,7 +1839,6 @@ Form
- diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs deleted file mode 100644 index cca816b12c..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/AssignDomain.aspx.cs +++ /dev/null @@ -1,271 +0,0 @@ -using System; -using System.Globalization; -using System.Web.UI.WebControls; -using Umbraco.Web; -using umbraco.cms.businesslogic.language; -using umbraco.cms.businesslogic.web; -using Umbraco.Core; -using Umbraco.Web.UI.Pages; -using Umbraco.Core.Services; - -namespace umbraco.dialogs -{ - /// - /// Summary description for AssignDomain. - /// - public partial class AssignDomain : UmbracoEnsuredPage - { - private int _currentId; - private int _editDomain; - - public AssignDomain() - { - CurrentApp = Constants.Applications.Content.ToString(); - } - - protected void Page_Load(object sender, EventArgs e) - { - _currentId = Request.GetItemAs("id"); - prop_domain.Text = Services.TextService.Localize("assignDomain/domain"); - prop_lang.Text = Services.TextService.Localize("general/language"); - pane_addnew.Text = Services.TextService.Localize("assignDomain/addNew"); - pane_edit.Text = Services.TextService.Localize("assignDomain/orEdit"); - - if (Request.GetItemAsString("editDomain").Trim() != "") - { - _editDomain = Request.GetItemAs("editDomain"); - } - - if (Request.GetItemAsString("delDomain").Trim() != "") - { - var d = new Domain(Request.GetItemAs("delDomain")); - FeedBackMessage.type = uicontrols.Feedback.feedbacktype.success; - FeedBackMessage.Text = Services.TextService.Localize("assignDomain/domainDeleted", new[] { d.Name }); - d.Delete(); - UpdateDomainList(); - } - - if (!IsPostBack) - { - // Add caption to button - ok.Text = Services.TextService.Localize("assignDomain/addNew"); - - var selectedLanguage = -1; - - // Maybe add editing info - not the best way this is made ;-) - if (_editDomain > 0) - { - var d = new Domain(_editDomain); - selectedLanguage = d.Language.id; - DomainName.Text = d.Name.StartsWith("*") ? "*" : d.Name; - ok.Text = Services.TextService.Localize("general/update"); - } - - // Add caption to language validator - LanguageValidator.ErrorMessage = Services.TextService.Localize("defaultdialogs/requiredField") + "
"; - DomainValidator.ErrorMessage = Services.TextService.Localize("defaultdialogs/requiredField"); - - DomainValidator2.ErrorMessage = Services.TextService.Localize("assignDomain/invalidDomain"); - //DomainValidator2.ValidationExpression = @"^(?i:http[s]?://)?([-\w]+(\.[-\w]+)*)(:\d+)?(/[-\w]*)?$"; - DomainValidator2.ValidationExpression = @"^(\*|((?i:http[s]?://)?([-\w]+(\.[-\w]+)*)(:\d+)?(/[-\w]*)?))$"; - - Languages.Items.Add(new ListItem(Services.TextService.Localize("general/choose"), "")); - foreach (var l in Language.GetAllAsList()) - { - var li = new ListItem(); - li.Text = l.FriendlyName; - li.Value = l.id.ToString(CultureInfo.InvariantCulture); - if (selectedLanguage == l.id) - li.Selected = true; - Languages.Items.Add(li); - } - } - - UpdateDomainList(); - } - - private void UpdateDomainList() - { - - var domainList = Domain.GetDomainsById(_currentId); - - if (domainList.Length > 0) - { - allDomains.Text = ""; - - foreach (var d in domainList) - { - var name = d.Name.StartsWith("*") ? "*" : d.Name; - allDomains.Text += ""; - } - - allDomains.Text += "
" + name + "(" + d.Language.CultureAlias + ")" + Services.TextService.Localize("edit") + "" + Services.TextService.Localize("delete") + "
"; - pane_edit.Visible = true; - } - else - { - pane_edit.Visible = false; - } - } - - protected void SaveDomain(object sender, EventArgs e) - { - if (Page.IsValid) - { - if (_editDomain > 0) - { - var d = new Domain(_editDomain); - d.Language = new Language(int.Parse(Languages.SelectedValue)); - d.Name = DomainName.Text.ToLower(); - FeedBackMessage.type = uicontrols.Feedback.feedbacktype.success; - FeedBackMessage.Text = Services.TextService.Localize("assignDomain/domainUpdated", new[] { DomainName.Text }); - d.Save(); - - DomainName.Text = ""; - Languages.SelectedIndex = 0; - UpdateDomainList(); - - //this is probably the worst webform I've ever seen... - Response.Redirect("AssignDomain.aspx?id=" + _currentId.ToString()); - } - else - { - // have to handle wildcard - var domainName = DomainName.Text.Trim(); - domainName = domainName == "*" ? ("*" + _currentId.ToString(CultureInfo.InvariantCulture)) : domainName; - - if (!Domain.Exists(domainName.ToLower())) - { - Domain.MakeNew(domainName, _currentId, int.Parse(Languages.SelectedValue)); - FeedBackMessage.Text = Services.TextService.Localize("assignDomain/domainCreated", new[] { domainName }); - FeedBackMessage.type = uicontrols.Feedback.feedbacktype.success; - - DomainName.Text = ""; - Languages.SelectedIndex = 0; - UpdateDomainList(); - - //this is probably the worst webform I've ever seen... - Response.Redirect("AssignDomain.aspx?id=" + _currentId.ToString()); - } - else - { - FeedBackMessage.Text = Services.TextService.Localize("assignDomain/domainExists", new[] { DomainName.Text.Trim() }); - FeedBackMessage.type = uicontrols.Feedback.feedbacktype.error; - } - } - } - } - - /// - /// FeedBackMessage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Feedback FeedBackMessage; - - /// - /// pane_addnew control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane pane_addnew; - - /// - /// prop_domain control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel prop_domain; - - /// - /// DomainName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox DomainName; - - /// - /// DomainValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainValidator; - - /// - /// DomainValidator2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RegularExpressionValidator DomainValidator2; - - /// - /// prop_lang control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.PropertyPanel prop_lang; - - /// - /// Languages control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList Languages; - - /// - /// LanguageValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator LanguageValidator; - - /// - /// ok control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button ok; - - /// - /// pane_edit control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane pane_edit; - - /// - /// allDomains control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal allDomains; - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs deleted file mode 100644 index af547e2a86..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/emptyTrashcan.aspx.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Web.UI; -using Umbraco.Core; -using Umbraco.Web; -using umbraco.cms.businesslogic; -using Umbraco.Web.UI.Pages; - -namespace umbraco.presentation.dialogs -{ - public partial class emptyTrashcan : UmbracoEnsuredPage - { - private RecycleBin.RecycleBinType? _binType; - protected RecycleBin.RecycleBinType BinType - { - get - { - if (_binType == null) - { - _binType = Enum.Parse(Request.GetItemAsString("type"), true); - } - return _binType.Value; - } - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - var recycleBinType = Request.GetItemAsString("type"); - if (Security.ValidateUserApp(recycleBinType) == false) - { - throw new InvalidOperationException("The user does not have access to the requested app"); - } - } - - protected void Page_Load(object sender, EventArgs e) - { - } - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/trashcan.asmx")); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx")); - } - - /// - /// pane_form control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.Pane pane_form; - - /// - /// progbar control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.uicontrols.ProgressBar progbar; - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx deleted file mode 100644 index f075057517..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService Language="C#" CodeBehind="trashcan.asmx.cs" Class="umbraco.presentation.webservices.trashcan" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs deleted file mode 100644 index baa692ef34..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/webservices/trashcan.asmx.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Web.Script.Services; -using System.Web.Services; -using System.ComponentModel; -using Umbraco.Web.WebServices; -using umbraco.cms.businesslogic; -using Umbraco.Core; - -namespace umbraco.presentation.webservices -{ - /// - /// Summary description for trashcan - /// - [WebService(Namespace = "http://umbraco.org/webservices")] - [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] - [ToolboxItem(false)] - [ScriptService] - public class trashcan : UmbracoAuthorizedWebService - { - [WebMethod] - public void EmptyTrashcan(RecycleBin.RecycleBinType type) - { - //validate against the app type! - switch (type) - { - case RecycleBin.RecycleBinType.Content: - if (!AuthorizeRequest(Constants.Applications.Content.ToString())) return; - break; - case RecycleBin.RecycleBinType.Media: - if (!AuthorizeRequest(Constants.Applications.Media.ToString())) return; - break; - default: - throw new ArgumentOutOfRangeException("type"); - } - - //TODO: This will never work in LB scenarios - Application["trashcanEmptyLeft"] = RecycleBin.Count(type).ToString(); - emptyTrashCanDo(type); - } - - [WebMethod] - public string GetTrashStatus() - { - //TODO: This will never work in LB scenarios - - if (AuthorizeRequest()) - { - return Application["trashcanEmptyLeft"] != null - ? Application["trashcanEmptyLeft"].ToString() - : ""; - } - - return "-"; - - } - - private void emptyTrashCanDo(RecycleBin.RecycleBinType type) - { - var trashCan = new RecycleBin(type); - - var callback = new Action(x => - { - Application.Lock(); - Application["trashcanEmptyLeft"] = x.ToString(); - Application.UnLock(); - }); - - trashCan.CallTheGarbageMan(callback); - - } - } -} diff --git a/src/umbraco.cms/businesslogic/RecycleBin.cs b/src/umbraco.cms/businesslogic/RecycleBin.cs deleted file mode 100644 index 934506b204..0000000000 --- a/src/umbraco.cms/businesslogic/RecycleBin.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System; -using System.Linq; -using Umbraco.Core; -using umbraco.DataLayer; -using umbraco.cms.businesslogic.web; -using umbraco.cms.businesslogic.media; - -namespace umbraco.cms.businesslogic -{ - - public class RecycleBin : CMSNode - { - /// - /// The types of Recycle Bins. - /// - /// - /// Each enum item represents the integer value of the node Id of the recycle bin in the database. - /// - public enum RecycleBinType - { - Content = Constants.System.RecycleBinContent, - Media = Constants.System.RecycleBinMedia - } - - private const string m_ChildCountSQL = @"select count(id) from umbracoNode where nodeObjectType = @nodeObjectType and path like '%,{0},%'"; - private const string m_ChildSQL = @"SELECT id, createDate, trashed, parentId, nodeObjectType, nodeUser, level, path, sortOrder, uniqueID, text FROM umbracoNode where ParentID = @parentId And nodeObjectType = @type order by sortOrder"; - private static object m_Locker = new object(); - - #region Private variables - - private Guid _nodeObjectType; - private RecycleBinType m_BinType; - - #endregion - - #region Constructors - /// - /// Constructor to create a new recycle bin - /// - /// - /// - [Obsolete("Use the simple constructor that has the RecycleBinType only parameter")] - public RecycleBin(Guid nodeObjectType, RecycleBinType type) - : base((int)type) - { - _nodeObjectType = nodeObjectType; - m_BinType = type; - } - - /// - /// Constructor to create a new recycle bin based on RecycleBinType - /// Will automatically update internal nodeObjectType based on the RecycleBinType enum - /// - /// - public RecycleBin(RecycleBinType type) - : base((int)type) - { - switch (type) - { - case RecycleBinType.Content: - _nodeObjectType = Document._objectType; - m_BinType = RecycleBinType.Content; - break; - case RecycleBinType.Media: - _nodeObjectType = Media._objectType; - m_BinType = RecycleBinType.Media; - break; - - } - } - - /// - /// Old constructor to create a content recycle bin - /// - /// - [Obsolete("Use the simple constructor that has the RecycleBinType only parameter")] - public RecycleBin(Guid nodeObjectType) - : this(nodeObjectType, RecycleBinType.Content) { } - #endregion - - #region Static methods - /// - /// Get the number of items in the Recycle Bin - /// - /// The number of all items in the Recycle Bin - [Obsolete("Create a RecycleBin object to get the count per recycle bin type", true)] - public static int Count() - { - return Count(RecycleBinType.Content); - } - - public static int Count(RecycleBinType type) - { - Guid objectType = Document._objectType; - - switch (type) - { - case RecycleBinType.Content: - objectType = Document._objectType; - break; - case RecycleBinType.Media: - objectType = Media._objectType; - break; - } - - string sql = String.Format(RecycleBin.m_ChildCountSQL, - (int) type); - - return SqlHelper.ExecuteScalar(sql, SqlHelper.CreateParameter("@nodeObjectType", objectType)); - } - #endregion - - #region Public methods - - /// - /// If I smell, I'm not empty - /// - public bool Smells() - { - return RecycleBin.Count(m_BinType) > 0; - } - - /// - /// Empties the trash can - /// - /// a function to call whenever an item is removed from the bin - public void CallTheGarbageMan(Action itemDeletedCallback) - { - lock (m_Locker) - { - var itemsInTheBin = Count(m_BinType); - itemDeletedCallback(itemsInTheBin); - - if (m_BinType == RecycleBinType.Media) - { - ApplicationContext.Current.Services.MediaService.EmptyRecycleBin(); - var trashedMedia = ApplicationContext.Current.Services.MediaService.GetMediaInRecycleBin(); - itemsInTheBin = trashedMedia.Count(); - } - else - { - ApplicationContext.Current.Services.ContentService.EmptyRecycleBin(); - var trashedContent = ApplicationContext.Current.Services.ContentService.GetContentInRecycleBin(); - itemsInTheBin = trashedContent.Count(); - } - - itemDeletedCallback(itemsInTheBin); - } - } - - #endregion - - #region Public properties - public override CMSNode[] Children - { - get - { - System.Collections.ArrayList tmp = new System.Collections.ArrayList(); - - using (IRecordsReader dr = SqlHelper.ExecuteReader(m_ChildSQL, - SqlHelper.CreateParameter("@parentId", this.Id), - SqlHelper.CreateParameter("@type", _nodeObjectType))) - { - while (dr.Read()) - { - tmp.Add(new CMSNode(dr)); - } - } - - CMSNode[] retval = new CMSNode[tmp.Count]; - - for (int i = 0; i < tmp.Count; i++) - { - retval[i] = (CMSNode)tmp[i]; - } - return retval; - } - } - #endregion - - } -} diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj index 0a8682dee0..f1426b73f6 100644 --- a/src/umbraco.cms/umbraco.cms.csproj +++ b/src/umbraco.cms/umbraco.cms.csproj @@ -243,7 +243,6 @@ Code - Code