diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 2fc8cfc8bc..de52021220 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -198,13 +198,6 @@ umbracoPage.Master - - treeInit.aspx - ASPXCodeBehind - - - treeInit.aspx - @@ -325,7 +318,6 @@ - @@ -340,7 +332,6 @@ - Designer @@ -352,16 +343,13 @@ - - - Designer @@ -445,7 +433,6 @@ Form - diff --git a/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.cs b/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.cs deleted file mode 100644 index f82be2b80f..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using umbraco.cms.presentation.Trees; - -namespace Umbraco.Web.UI.Umbraco -{ - [Obsolete("Used the TreeControl control instead. This does however get used by the TreeService when requesting the tree init url.")] - public partial class TreeInit : Pages.UmbracoEnsuredPage - { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService(); - DataBind(); - } - - protected TreeService TreeParams { get; private set; } - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.designer.cs b/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.designer.cs deleted file mode 100644 index 7009fe3289..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/TreeInit.aspx.designer.cs +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Umbraco { - - - public partial class TreeInit { - - /// - /// Head1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlHead Head1; - - /// - /// ClientLoader control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web.UI.JavaScript.UmbracoClientDependencyLoader ClientLoader; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// ScriptManager1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.ScriptManager ScriptManager1; - - /// - /// JTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl JTree; - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.cs b/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.cs deleted file mode 100644 index a15ebbf2c7..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration.Provider; -using System.Linq; -using System.Web; -using System.Web.Security; - -namespace Umbraco.Web.UI.Umbraco.Controls -{ - public partial class PasswordChanger : global::umbraco.controls.passwordChanger - { - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - //always reset the control vals - ResetPasswordCheckBox.Checked = false; - umbPasswordChanger_passwordCurrent.Text = null; - umbPasswordChanger_passwordNew.Text = null; - umbPasswordChanger_passwordNewConfirm.Text = null; - //reset the flag always - IsChangingPasswordField.Value = "false"; - this.DataBind(); - } - - - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.designer.cs b/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.designer.cs deleted file mode 100644 index 94193a1450..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/controls/PasswordChanger.ascx.designer.cs +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Umbraco.Controls { - - - public partial class PasswordChanger { - - /// - /// ResetPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder ResetPlaceHolder; - - /// - /// CurrentPasswordPlaceHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder CurrentPasswordPlaceHolder; - - /// - /// CurrentPasswordValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator CurrentPasswordValidator; - - /// - /// NewPasswordRequiredValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator NewPasswordRequiredValidator; - - /// - /// NewPasswordLengthValidator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RegularExpressionValidator NewPasswordLengthValidator; - - /// - /// Div1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl Div1; - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/controls/Tree/CustomTreeService.asmx b/src/Umbraco.Web.UI/Umbraco/controls/Tree/CustomTreeService.asmx deleted file mode 100644 index 2ddab055f6..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/controls/Tree/CustomTreeService.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService language="C#" class="umbraco.controls.Tree.CustomTreeService" %> \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/controls/Tree/TreeControl.ascx b/src/Umbraco.Web.UI/Umbraco/controls/Tree/TreeControl.ascx deleted file mode 100644 index 9488fb0643..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/controls/Tree/TreeControl.ascx +++ /dev/null @@ -1,57 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" Inherits="umbraco.controls.Tree.TreeControl" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="umbClient" Namespace="Umbraco.Web.UI.Bundles" Assembly="Umbraco.Web" %> - - - - - - - - - - - -
-
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco/controls/passwordChanger.ascx b/src/Umbraco.Web.UI/Umbraco/controls/passwordChanger.ascx deleted file mode 100644 index 9f94a70c45..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/controls/passwordChanger.ascx +++ /dev/null @@ -1,133 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="passwordChanger.ascx.cs" Inherits="Umbraco.Web.UI.Umbraco.Controls.PasswordChanger" %> - - - -<%= Services.TextService.Localize("user/changePassword") %>
- - - -
-

- Password has been reset to
-
- <%# ChangingPasswordModel.GeneratedPassword %> -

-
diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/create.aspx b/src/Umbraco.Web.UI/Umbraco/dialogs/create.aspx deleted file mode 100644 index e67b5b0b32..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/create.aspx +++ /dev/null @@ -1,67 +0,0 @@ -<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" - AutoEventWireup="True" Inherits="umbraco.dialogs.create" %> - -<%@ Import Namespace="Umbraco.Web" %> -<%@ Register Src="../controls/Tree/TreeControl.ascx" TagName="TreeControl" TagPrefix="umbraco" %> -<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %> - - - - - - - " /> - - - - - - -
- " onclick="onNodeSelectionConfirmed();" - disabled="true" style="width: 100px" /> -   - <%= Services.TextService.Localize("or") %>  - <%=Services.TextService.Localize("cancel")%> -
-
- - - - - -
diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/empty.htm b/src/Umbraco.Web.UI/Umbraco/dialogs/empty.htm deleted file mode 100644 index 4df7696ed6..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/empty.htm +++ /dev/null @@ -1,9 +0,0 @@ - - - - Umbraco - empty document - - - - - diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/treePicker.aspx b/src/Umbraco.Web.UI/Umbraco/dialogs/treePicker.aspx deleted file mode 100644 index 9add7d07f2..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/treePicker.aspx +++ /dev/null @@ -1,22 +0,0 @@ -<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="treePicker.aspx.cs" - AutoEventWireup="True" Inherits="umbraco.dialogs.treePicker" %> - -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="umb2" TagName="Tree" Src="../controls/Tree/TreeControl.ascx" %> - - - - - - - - - - diff --git a/src/Umbraco.Web.UI/Umbraco/treeInit.aspx b/src/Umbraco.Web.UI/Umbraco/treeInit.aspx deleted file mode 100644 index aca6ecc07a..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/treeInit.aspx +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Page Language="c#" CodeBehind="TreeInit.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.TreeInit" %> -<%@ Register Src="controls/Tree/TreeControl.ascx" TagName="TreeControl" TagPrefix="umbraco" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web.UI.JavaScript" Assembly="Umbraco.Web" %> - - - - - - - - - - - - - - - - - -
- - -
- -
-
- - diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 65be911ced..37f4868bc1 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1034,18 +1034,12 @@ - - ASPXCodeBehind - ASPXCodeBehind ASPXCodeBehind - - ASPXCodeBehind - @@ -1205,9 +1199,6 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind @@ -1265,17 +1256,6 @@ - - ASPXCodeBehind - - - Component - - - - - Code - @@ -1421,7 +1401,6 @@ - ASPXCodeBehind @@ -1430,7 +1409,6 @@ - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs deleted file mode 100644 index 12b056fedd..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeControl.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.IO; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using ClientDependency.Core; -using umbraco.controls.Tree; -using Umbraco.Core.IO; -using Umbraco.Core.Services; - -namespace umbraco.controls.Tree -{ - /// - /// A custom tree control that uses a custom web service to return the initial node, this is required - /// due to a bug that exists in Umbraco 4.5.1 tree control/web service. - /// - /// - /// Since we're inheriting from a UserControl and all of the ClientDependency registrations are done inline, we need - /// to re-register the ClientDependencies. - /// - [ClientDependency(11, ClientDependencyType.Javascript, "Tree/jquery.tree.js", "UmbracoClient")] - [ClientDependency(12, ClientDependencyType.Javascript, "Tree/UmbracoContext.js", "UmbracoClient")] - [ClientDependency(12, ClientDependencyType.Javascript, "Tree/jquery.tree.contextmenu.js", "UmbracoClient")] - [ClientDependency(12, ClientDependencyType.Javascript, "Tree/jquery.tree.checkbox.js", "UmbracoClient")] - [ClientDependency(12, ClientDependencyType.Javascript, "Tree/NodeDefinition.js", "UmbracoClient")] - [ClientDependency(13, ClientDependencyType.Javascript, "Tree/UmbracoTree.js", "UmbracoClient")] - public class CustomTreeControl : TreeControl - { - /// - /// Ensure child controls are created on init - /// - /// - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - this.EnsureChildControls(); - } - - /// - /// Create the child controls - /// - protected override void CreateChildControls() - { - base.CreateChildControls(); - - TreeContainer = new HtmlGenericControl(); - TreeContainer.TagName = "div"; - TreeContainer.ID = "TreeContainer"; - - this.Controls.Add(TreeContainer); - } - - /// - /// Adds the internal markup to the TreeContainer control - /// - /// - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - //add the internal markup to the TreeContainer - /*
*/ - TreeContainer.Controls.Add(new LiteralControl(@"
")); - } - - /// - /// Render out the correct markup for the tree - /// - /// - /// Since we're inheriting from a UserControl, we need to render out the markup manually - /// - /// - protected override void Render(System.Web.UI.HtmlTextWriter writer) - { - //You'll notice that we're replacing the 'serviceUrl' parameter with our own custom web service! - - writer.Write(@" -"); - - //render the controls - TreeContainer.RenderControl(writer); - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.asmx b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.asmx deleted file mode 100644 index 2ddab055f6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService language="C#" class="umbraco.controls.Tree.CustomTreeService" %> \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs deleted file mode 100644 index 6d91847888..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/CustomTreeService.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using Umbraco.Core.Security; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Script.Services; -using System.Web.Services; -using System.Web.UI; -using umbraco; -using umbraco.cms.businesslogic; -using umbraco.cms.presentation.Trees; -using umbraco.controls.Tree; -using Umbraco.Core.Services; -using Umbraco.Web; -using Umbraco.Web.Security; -using Umbraco.Web.WebServices; - -namespace umbraco.controls.Tree -{ - /// - /// Client side ajax utlities for the tree - /// - [ScriptService] - [WebService] - public class CustomTreeService : UmbracoWebService - { - /// - /// Returns some info about the node such as path and id - /// - /// - /// - [WebMethod] - [ScriptMethod(ResponseFormat = ResponseFormat.Json)] - public NodeInfo GetNodeInfo(int id) - { - Authorize(); - - //var node = new CMSNode(id); - var node = Services.EntityService.Get(id); - return new NodeInfo() - { - Id = node.Id, - Path = node.Path, - PathAsNames = string.Join("->", - GetPathNames(node.Path.Split(',') - .Select(x => int.Parse(x)) - .ToArray())) - }; - } - - /// - /// returns the node names for each id passed in - /// - /// - /// - private string[] GetPathNames(int[] ids) - { - return ids - .Where(x => x != -1) - //.Select(x => new CMSNode(x).Text).ToArray(); - .Select(x => Services.EntityService.Get(x).Name).ToArray(); - } - - /// - /// Returns a key/value object with: json, app, js as the keys - /// - /// - [WebMethod] - [ScriptMethod(ResponseFormat = ResponseFormat.Json)] - public Dictionary GetInitAppTreeData(string app, string treeType, bool showContextMenu, bool isDialog, TreeDialogModes dialogMode, string functionToCall, string nodeKey) - { - Authorize(); - - var treeCtl = new TreeControl() - { - ShowContextMenu = showContextMenu, - IsDialog = isDialog, - DialogMode = dialogMode, - App = app, - TreeType = string.IsNullOrEmpty(treeType) ? "" : treeType, //don't set the tree type unless explicitly set - NodeKey = string.IsNullOrEmpty(nodeKey) ? "" : nodeKey, - //StartNodeID = -1, //TODO: set this based on parameters! - FunctionToCall = string.IsNullOrEmpty(functionToCall) ? "" : functionToCall - }; - - var returnVal = new Dictionary(); - - if (string.IsNullOrEmpty(treeType)) - { - //if there's not tree type specified, then render out the tree as per normal with the normal - //way of doing things - returnVal.Add("json", treeCtl.GetJSONInitNode()); - } - else - { - //since 4.5.1 has a bug in it, it ignores if the treeType is specified and will always only render - //the whole APP not just a specific tree. - //this is a work around for this bug until it is fixed (which should be fixed in 4.5.2 - - //get the tree that we need to render - var tree = TreeDefinitionCollection.Instance.FindTree(treeType).CreateInstance(); - tree.ShowContextMenu = showContextMenu; - tree.IsDialog = isDialog; - tree.DialogMode = dialogMode; - tree.NodeKey = string.IsNullOrEmpty(nodeKey) ? "" : nodeKey; - tree.FunctionToCall = string.IsNullOrEmpty(functionToCall) ? "" : functionToCall; - - //now render it's start node - var xTree = new XmlTree(); - - //we're going to hijack the node name here to make it say content/media - var node = tree.RootNode; - if (node.Text.Equals("[FilteredContentTree]")) node.Text = Services.TextService.Localize("content"); - else if (node.Text.Equals("[FilteredMediaTree]")) node.Text = Services.TextService.Localize("media"); - xTree.Add(node); - - returnVal.Add("json", xTree.ToString()); - } - - returnVal.Add("app", app); - returnVal.Add("js", treeCtl.JSCurrApp); - - return returnVal; - } - - internal void Authorize() - { - if (ValidateCurrentUser() == false) - throw new Exception("Client authorization failed. User is not logged in"); - } - - - /// - /// Validates the currently logged in user and ensures they are not timed out - /// - /// - private bool ValidateCurrentUser() - { - var identity = Context.GetCurrentIdentity( - //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! - // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is - // a back office user logged in. This can cause problems becaues the identity is changing mid - // request. For example: http://issues.umbraco.org/issue/U4-4010 - HttpContext.Current.CurrentHandler is Page); - - if (identity != null) - { - return true; - } - return false; - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs deleted file mode 100644 index 726936f570..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenu.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Script.Serialization; -using Umbraco.Core.Logging; -using Umbraco.Core; -using Umbraco.Web; -using Umbraco.Web.Composing; -using Umbraco.Web._Legacy.Actions; -using Action = Umbraco.Web._Legacy.Actions.Action; - -namespace umbraco.controls.Tree -{ - internal class JTreeContextMenu - { - public string RenderJSONMenu() - { - - JavaScriptSerializer jSSerializer = new JavaScriptSerializer(); - - jSSerializer.RegisterConverters(new List() - { - new JTreeContextMenuItem() - }); - - List allActions = new List(); - foreach (var a in Current.Actions) - { - // NH: Added a try/catch block to this as an error in a 3rd party action can crash the whole menu initialization - try - { - if (!string.IsNullOrEmpty(a.Alias) && (!string.IsNullOrEmpty(a.JsFunctionName) || !string.IsNullOrEmpty(a.JsSource))) - { - // if the action is using invalid javascript we need to do something about this - if (!Action.ValidateActionJs(a)) - { - // Make new Iaction - PlaceboAction pa = new PlaceboAction(a); - pa.JsFunctionName = "IActionProxy_" + pa.Alias.ToSafeAlias() + "()"; - allActions.Add(pa); - - } - else - { - allActions.Add(a); - } - } - } - catch (Exception ex) - { - Current.Logger.Error(ex, "Error initializing tree action"); - } - - } - - - return jSSerializer.Serialize(allActions); - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs deleted file mode 100644 index ec59037775..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/JTreeContextMenuItem.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web.Script.Serialization; -using System.Text; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web; -using Umbraco.Web.Composing; -using Umbraco.Web._Legacy.Actions; - -namespace umbraco.controls.Tree -{ - internal class JTreeContextMenuItem : JavaScriptConverter - { - - /// - /// Not implemented as we never need to Deserialize - /// - /// - /// - /// - /// - public override object Deserialize(IDictionary dictionary, Type type, JavaScriptSerializer serializer) - { - throw new NotImplementedException(); - } - - public override IDictionary Serialize(object obj, JavaScriptSerializer serializer) - { - //{ - // "id": "L", - // "label": "Create", - // "icon": "create.png", - // "visible": function(NODE, TREE_OBJ) { if (NODE.length != 1) return false; return TREE_OBJ.check("creatable", NODE); }, - // "action": function(NODE, TREE_OBJ) { TREE_OBJ.create(false, NODE); }, - //} - - - IAction a = (IAction)obj; - Dictionary data = new Dictionary(); - - data.Add("id", a.Letter); - data.Add("label", Current.Services.TextService.Localize(a.Alias)); - - if (a.Icon.StartsWith(".")) - { - StringBuilder sb = new StringBuilder(); - sb.Append(string.Format(""); - sb.Append(""); - data["label"] = sb.ToString(); - } - else - { - data.Add("icon", a.Icon); - } - - return data; - - } - - /// - /// TODO: Find out why we can't just return IAction as one type (JavaScriptSerializer doesn't seem to pick up on it) - /// - public override IEnumerable SupportedTypes - { - get - { - List types = new List(); - foreach (var a in Current.Actions) - { - types.Add(a.GetType()); - } - return types; - } - - - } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs deleted file mode 100644 index 2d51a00e64..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/NodeInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace umbraco.controls.Tree -{ - /// - /// Simple data object to hold information about a node - /// - public class NodeInfo - { - /// - /// Gets or sets the id. - /// - /// The id. - public int Id { get; set; } - - /// - /// Gets or sets the path. - /// - /// The path. - public string Path { get; set; } - - /// - /// Gets or sets the path as names. - /// - /// The path as names. - public string PathAsNames { get; set; } - - /// - /// Gets or sets the type of the node. - /// - /// The type of the node. - public string NodeType { get; set; } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs deleted file mode 100644 index 7ec76bc6eb..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs +++ /dev/null @@ -1,593 +0,0 @@ -using System; -using Umbraco.Core.Security; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using Umbraco.Core.Models; -using Umbraco.Web.Trees; -using Umbraco.Web.UI.Controls; -using System.Text; -using umbraco.cms.presentation.Trees; -using System.Drawing; -using System.Linq; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web.Security; - -namespace umbraco.controls.Tree -{ - - /// - /// The Umbraco tree control. - /// If this control doesn't exist on an UmbracoEnsuredPage it will not work. - /// - public partial class TreeControl : UmbracoUserControl, ITreeService - { - - /// - /// Set the defaults - /// - public TreeControl() - { - Width = Unit.Empty; - Height = Unit.Empty; - BackColor = Color.Empty; - CssClass = ""; - ManualInitialization = false; - } - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - EnableViewState = false; - } - - public enum TreeMode - { - Standard, Checkbox, InheritedCheckBox - } - - /// - /// If there is not application or tree specified in a query string then this is the application to load. - /// - private const string DEFAULT_APP = Constants.Applications.Content; - - private List m_ActiveTrees = new List(); - private List m_AllAppTrees = new List(); - private List m_ActiveTreeDefs = null; - private TreeMode m_TreeType = TreeMode.Standard; - private bool m_IsInit = false; - private TreeService m_TreeService = new TreeService(); - private string m_SelectedNodePath; - - #region Public Properties - - #region Style Properties - public string CssClass { get; set; } - public Unit Height { get; set; } - public Unit Width { get; set; } - public Color BackColor { get; set; } - #endregion - - #region TreeService parameters. - public string FunctionToCall - { - get { return m_TreeService.FunctionToCall; } - set - { - m_TreeService.FunctionToCall = value; - } - } - - public string NodeKey - { - get { return m_TreeService.NodeKey; } - set - { - m_TreeService.NodeKey = value; - } - } - - public int StartNodeID - { - get { return m_TreeService.StartNodeID; } - set - { - m_TreeService.StartNodeID = value; - } - } - - public string SelectedNodePath - { - get { return m_SelectedNodePath; } - set - { - m_SelectedNodePath = value; - } - } - - public string TreeType - { - get { return m_TreeService.TreeType; } - set - { - m_TreeService.TreeType = value; - } - } - - public bool ShowContextMenu - { - get { return m_TreeService.ShowContextMenu; } - set - { - m_TreeService.ShowContextMenu = value; - } - } - - public bool IsDialog - { - get { return m_TreeService.IsDialog; } - set - { - m_TreeService.IsDialog = value; - } - } - - public TreeDialogModes DialogMode - { - get { return m_TreeService.DialogMode; } - set - { - m_TreeService.DialogMode = value; - } - } - - - public string App - { - get - { - return GetCurrentApp(); - } - set - { - m_TreeService.App = value; - } - } - #endregion - - /// - /// Allows for checkboxes to be used with the tree. Default is standard. - /// - public TreeMode Mode - { - get - { - return m_TreeType; - } - set - { - m_TreeType = value; - } - } - - /// - /// Returns the required JavaScript as a string for the current application - /// - public string JSCurrApp - { - get - { - StringBuilder javascript = new StringBuilder(); - foreach (BaseTree bTree in m_AllAppTrees) - bTree.RenderJS(ref javascript); - return javascript.ToString(); - } - } - - /// - /// By default this is false. If set to true, then the code in the client side of the tree will force calling rebuildTree - /// to be called explicitly for the tree to render - /// - public bool ManualInitialization { get; set; } - - #endregion - - /// - /// Can be set explicitly which will override what is in query strings or what has been set by properties. - /// Useful for rendering out a tree dynamically with an instance of anoterh TreeService. - /// By using this method, it will undo any of the tree service public properties that may be set - /// on this object. - /// - public void SetTreeService(TreeService srv) - { - m_TreeService = srv; - Initialize(); - } - - /// - /// Initializes the control and looks up the tree structures that are required to be rendered. - /// Properties of the control (or SetTreeService) need to be set before pre render or calling - /// GetJSONContextMenu or GetJSONNode - /// - protected void Initialize() - { - //use the query strings if the TreeParams isn't explicitly set - if (m_TreeService == null) - { - m_TreeService = TreeRequestParams.FromQueryStrings().CreateTreeService(); - } - m_TreeService.App = GetCurrentApp(); - - // Validate permissions - if (ValidateCurrentUser() == false) - return; - - if (!Security.ValidateUserApp(GetCurrentApp())) - throw new ArgumentException("The current user doesn't have access to this application. Please contact the system administrator."); - - //find all tree definitions that have the current application alias that are ACTIVE. - //if an explicit tree has been requested, then only load that tree in. - //m_ActiveTreeDefs = TreeDefinitionCollection.Instance.FindActiveTrees(GetCurrentApp()); - - m_ActiveTreeDefs = Services.ApplicationTreeService.GetApplicationTrees(GetCurrentApp(), true).ToList(); - - if (!string.IsNullOrEmpty(this.TreeType)) - { - m_ActiveTreeDefs = m_ActiveTreeDefs - .Where(x => x.Alias == this.TreeType) - .ToList(); //this will only return 1 - } - - //find all tree defs that exists for the current application regardless of if they are active - var appTreeDefs = Services.ApplicationTreeService.GetApplicationTrees(GetCurrentApp()).ToList(); - - //Create the BaseTree's based on the tree definitions found - foreach (var treeDef in appTreeDefs) - { - //create the tree and initialize it - var bTree = LegacyTreeDataConverter.GetLegacyTreeForLegacyServices(treeDef); - //BaseTree bTree = treeDef.CreateInstance(); - bTree.SetTreeParameters(m_TreeService); - - //store the created tree - m_AllAppTrees.Add(bTree); - if (treeDef.Initialize) - m_ActiveTrees.Add(bTree); - } - - m_IsInit = true; - } - - /// - /// Validates the currently logged in user and ensures they are not timed out - /// - /// - private bool ValidateCurrentUser() - { - var identity = Context.GetCurrentIdentity( - //DO NOT AUTO-AUTH UNLESS THE CURRENT HANDLER IS WEBFORMS! - // Without this check, anything that is using this legacy API, like ui.Text will - // automatically log the back office user in even if it is a front-end request (if there is - // a back office user logged in. This can cause problems becaues the identity is changing mid - // request. For example: http://issues.umbraco.org/issue/U4-4010 - HttpContext.Current.CurrentHandler is Page); - - if (identity != null) - { - return true; - } - return false; - } - - - /// - /// This calls the databind method to bind the data binding syntax on the front-end. - /// - /// Databinding was used instead of inline tags in case the tree properties needed to be set - /// by other classes at runtime - /// - /// - /// - /// - /// This will initialize the control so all TreeService properties need to be set before hand - /// - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - if (!m_IsInit) - Initialize(); - - //Render out the JavaScript associated with all of the trees for the application - RenderTreeJS(); - - //apply the styles - if (Width != Unit.Empty) - TreeContainer.Style.Add(HtmlTextWriterStyle.Width, Width.ToString()); - if (Height != Unit.Empty) - TreeContainer.Style.Add(HtmlTextWriterStyle.Height, Height.ToString()); - if (BackColor != Color.Empty) - TreeContainer.Style.Add(HtmlTextWriterStyle.BackgroundColor, ColorTranslator.ToHtml(BackColor)); - if (CssClass != "") - { - TreeContainer.Attributes.Add("class", CssClass); - } - else - { - //add the default class - TreeContainer.Attributes.Add("class", "treeContainer"); - } - - - DataBind(); - } - - /// - /// Returns the JSON markup for the full context menu - /// - public string GetJSONContextMenu() - { - if (ShowContextMenu) - { - JTreeContextMenu menu = new JTreeContextMenu(); - return menu.RenderJSONMenu(); - } - else - { - return "{}"; - } - - } - - /// - /// Returns a string with javascript proxy methods for IActions that are using old javascript - /// - /// - public string GetLegacyIActionJavascript() - { - return LegacyTreeJavascript.GetLegacyIActionJavascript(); - } - - /// - /// Returns the JSON markup for one node - /// - /// - /// - /// - /// - /// This will initialize the control so all TreeService properties need to be set before hand - /// - public string GetJSONNode(string nodeId) - { - if (!m_IsInit) - Initialize(); - - if (string.IsNullOrEmpty(m_TreeService.TreeType)) - { - throw new ArgumentException("The TreeType is not set on the tree service"); - } - - BaseTree tree = m_ActiveTrees.Find( - delegate(BaseTree t) - { - return (t.TreeAlias == m_TreeService.TreeType); - } - ); - return tree.GetSerializedNodeData(nodeId); - } - - /// - /// Returns the JSON markup for the first node in the tree - /// - - public string GetJSONInitNode() - { - if (!m_IsInit) - Initialize(); - - //if there is only one tree to render, we don't want to have a node to hold sub trees, we just want the - //stand alone tree, so we'll just add a TreeType to the TreeService and ensure that the right method gets loaded in tree.aspx - if (m_ActiveTrees.Count == 1) - { - m_TreeService.TreeType = m_ActiveTreeDefs[0].Alias; - - //convert the menu to a string - //string initActions = (TreeSvc.ShowContextMenu ? Action.ToString(m_ActiveTrees[0].RootNodeActions) : ""); - - //Since there's only 1 tree, render out the tree's RootNode properties - XmlTree xTree = new XmlTree(); - xTree.Add(m_ActiveTrees[0].RootNode); - return xTree.ToString(); - } - else - { - - //If there is more than 1 tree for the application than render out a - //container node labelled with the current application. - XmlTree xTree = new XmlTree(); - XmlTreeNode xNode = XmlTreeNode.CreateRoot(new NullTree(GetCurrentApp())); - xNode.Text = Services.TextService.Localize("sections", GetCurrentApp()); - xNode.Source = m_TreeService.GetServiceUrl(); - xNode.Action = "javascript:" + global::Umbraco.Web.UI.Pages.ClientTools.Scripts.OpenDashboard(GetCurrentApp()); - xNode.NodeType = m_TreeService.App.ToLower(); - xNode.NodeID = "-1"; - xNode.Icon = ".sprTreeFolder"; - xTree.Add(xNode); - return xTree.ToString(); - } - } - - private void RenderTreeJS() - { - Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Trees_" + GetCurrentApp(), JSCurrApp, true); - } - - /// - /// Return the current application alias. If neither the TreeType of Application is specified - /// than return the default application. If the Application is null but there is a TreeType then - /// find the application that the tree type is associated with. - /// - private string GetCurrentApp() - { - //if theres an treetype specified but no application - if (string.IsNullOrEmpty(m_TreeService.App) && - !string.IsNullOrEmpty(m_TreeService.TreeType)) - { - TreeDefinition treeDef = TreeDefinitionCollection.Instance.FindTree(m_TreeService.TreeType); - if (treeDef != null) - return treeDef.App.Alias; - } - else if (!string.IsNullOrEmpty(m_TreeService.App)) - return m_TreeService.App; - - //if everything is null then return the default app - return DEFAULT_APP; - } - - /// - /// CssInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude2; - - /// - /// CssInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude3; - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - - /// - /// JsInclude4 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude4; - - /// - /// JsInclude5 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude5; - - /// - /// JsInclude6 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude6; - - /// - /// JsInclude8 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude8; - - /// - /// JsInclude11 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude11; - - /// - /// JsInclude7 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude7; - - /// - /// JsInclude12 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude12; - - /// - /// JsInclude9 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude9; - - /// - /// JsInclude10 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude10; - - /// - /// TreeContainer control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl TreeContainer; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs deleted file mode 100644 index f35f9d93b6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/create.aspx.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Linq; -using System.Globalization; -using System.Web.UI; -using System.Xml; -using Umbraco.Core.IO; -using Umbraco.Web; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web.UI.Pages; -using Umbraco.Web._Legacy.Actions; -using Button = System.Web.UI.WebControls.Button; -using UserControl = System.Web.UI.UserControl; - -namespace umbraco.dialogs -{ - /// - /// Summary description for create. - /// - public partial class create : UmbracoEnsuredPage - { - protected Button ok; - - private string _app; - protected string App - { - get - { - if (_app == null) - { - _app = Request.CleanForXss("app"); - //validate the app - if (Services.SectionService.GetSections().Any(x => x.Alias.InvariantEquals(_app)) == false) - { - throw new InvalidOperationException("A requested app: " + Request.GetItemAsString("app") + " was not found"); - } - } - return _app; - } - } - - protected void Page_Load(object sender, EventArgs e) - { - // Put user code to initialize the page here - if (Request.GetItemAsString("nodeId") == "") - { - var appType = Services.TextService.Localize("sections", App).ToLower(); - pane_chooseNode.Text = Services.TextService.Localize("create/chooseNode", new[] { appType }) + "?"; - - DataBind(); - } - else - { - int nodeId = Request.GetItemAs("nodeId"); - //ensure they have access to create under this node!! - if (App.InvariantEquals(Constants.Applications.Media) || CheckCreatePermissions(nodeId)) - { - //var c = new CMSNode(nodeId); - var c = Services.EntityService.Get(nodeId); - path.Value = c.Path; - pane_chooseNode.Visible = false; - panel_buttons.Visible = false; - pane_chooseName.Visible = true; - var createDef = new XmlDocument(); - var defReader = new XmlTextReader(Server.MapPath(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + "/config/create/UI.xml")); - createDef.Load(defReader); - defReader.Close(); - - // Find definition for current nodeType - XmlNode def = createDef.SelectSingleNode("//nodeType [@alias = '" + App + "']"); - phCreate.Controls.Add(new UserControl().LoadControl(IOHelper.ResolveUrl(SystemDirectories.Umbraco) + def.SelectSingleNode("./usercontrol").FirstChild.Value)); - } - else - { - PageNameHolder.type = Umbraco.Web._Legacy.Controls.Feedback.feedbacktype.error; - PageNameHolder.Text = Services.TextService.Localize("rights") + " " + Services.TextService.Localize("error"); - JTree.DataBind(); - } - } - } - - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference(IOHelper.ResolveUrl(SystemDirectories.WebServices) + "/legacyAjaxCalls.asmx")); - } - - private bool CheckCreatePermissions(int nodeId) - { - var c = Services.EntityService.Get(nodeId); - var permission = Services.UserService.GetPermissions(Security.CurrentUser, c.Path); - return permission.AssignedPermissions.Contains(ActionNew.Instance.Letter.ToString(CultureInfo.InvariantCulture), StringComparer.Ordinal); - } - - - /// - /// path control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlInputHidden path; - - /// - /// pane_chooseNode control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_chooseNode; - - /// - /// JTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl JTree; - - /// - /// panel_buttons control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel panel_buttons; - - /// - /// PageNameHolder control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Feedback PageNameHolder; - - /// - /// pane_chooseName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane pane_chooseName; - - /// - /// phCreate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder phCreate; - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/empty.htm b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/empty.htm deleted file mode 100644 index 4df7696ed6..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/empty.htm +++ /dev/null @@ -1,9 +0,0 @@ - - - - Umbraco - empty document - - - - - diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs deleted file mode 100644 index 23cc004e61..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/treePicker.aspx.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; -using umbraco.cms.presentation.Trees; - -namespace umbraco.dialogs -{ - [Obsolete("Use the TreeControl instead. This does however get used by the TreeService when requesting the tree init url.")] - public partial class treePicker : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - protected override void OnLoad(EventArgs e) - { - base.OnLoad(e); - TreeParams = TreeRequestParams.FromQueryStrings().CreateTreeService(); - DataBind(); - - if(Request.QueryString["selected"] != null && TreeParams.TreeType == "content") - { - var currContent = Services.ContentService.GetById(int.Parse(Request.QueryString["selected"])); - if (currContent != null) - { - if (currContent.ParentId > 0) - DialogTree.SelectedNodePath = currContent.Path; - } - } - } - - protected TreeService TreeParams { get; private set; } - - /// - /// DialogTree control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::umbraco.controls.Tree.TreeControl DialogTree; - - } -}