Merge remote-tracking branch 'origin/6.2.0' into 7.0.2

Conflicts:
	src/Umbraco.Web.UI/umbraco/controls/Tree/TreeControl.ascx
	src/Umbraco.Web/Umbraco.Web.csproj
	src/Umbraco.Web/umbraco.presentation/umbraco/controls/Tree/TreeControl.ascx.cs
	src/umbraco.controls/TreePicker/SimpleContentPicker.cs
This commit is contained in:
Shannon
2013-12-19 11:41:03 +11:00
9 changed files with 183 additions and 232 deletions

View File

@@ -1,4 +1,4 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TreeControl.ascx.cs" Inherits="umbraco.controls.Tree.TreeControl" %>
<%@ Control Language="C#" AutoEventWireup="true" Inherits="umbraco.controls.Tree.TreeControl" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="Tree/treeIcons.css" PathNameAlias="UmbracoClient" Priority="10" />
@@ -47,6 +47,13 @@ jQuery(document).ready(function() {
dataUrl: "<%#global::Umbraco.Core.IO.IOHelper.ResolveUrl(global::Umbraco.Core.IO.SystemDirectories.Umbraco)%>/webservices/TreeDataService.ashx",
serviceUrl: "<%#global::Umbraco.Core.IO.IOHelper.ResolveUrl(global::Umbraco.Core.IO.SystemDirectories.Umbraco)%>/webservices/TreeClientService.asmx/GetInitAppTreeData"});
<%if(string.IsNullOrEmpty(SelectedNodePath) == false) {%>
setTimeout(function() {
treeApi = jQuery("#<%=ClientID%>").UmbracoTreeAPI();
treeApi.syncTree('<%=SelectedNodePath%>', true, true);
}, 500);
<% } %>
<%#GetLegacyIActionJavascript()%>
});

View File

@@ -1866,6 +1866,7 @@
<SubType>ASPXCodeBehind</SubType>
</Content>
<Content Include="umbraco.presentation\umbraco\dialogs\insertTable.aspx" />
<Content Include="umbraco.presentation\umbraco\dialogs\moveOrCopy.aspx" />
<Content Include="umbraco.presentation\umbraco\dialogs\notifications.aspx">
<SubType>ASPXCodeBehind</SubType>
</Content>
@@ -2090,4 +2091,4 @@
<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.10\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
</Target>
</Project>
</Project>

View File

@@ -1,70 +0,0 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TreeControl.ascx.cs" Inherits="umbraco.controls.Tree.TreeControl" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<umb:CssInclude ID="CssInclude2" runat="server" FilePath="Tree/treeIcons.css" PathNameAlias="UmbracoClient" Priority="10" />
<umb:CssInclude ID="CssInclude3" runat="server" FilePath="Tree/menuIcons.css" PathNameAlias="UmbracoClient" Priority="11" />
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="Tree/Themes/umbraco/style.css" PathNameAlias="UmbracoClient" Priority="12" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="Application/NamespaceManager.js" PathNameAlias="UmbracoClient" Priority="0" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="Application/UmbracoClientManager.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="Application/UmbracoApplicationActions.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude4" runat="server" FilePath="Application/UmbracoUtils.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude5" runat="server" FilePath="ui/jquery.js" PathNameAlias="UmbracoClient" Priority="0" />
<umb:JsInclude ID="JsInclude6" runat="server" FilePath="Application/JQuery/jquery.metadata.min.js" PathNameAlias="UmbracoClient" Priority="10" />
<umb:JsInclude ID="JsInclude8" runat="server" FilePath="Tree/jquery.tree.js" PathNameAlias="UmbracoClient" Priority="11" />
<umb:JsInclude ID="JsInclude11" runat="server" FilePath="Tree/UmbracoContext.js" PathNameAlias="UmbracoClient" Priority="12" />
<umb:JsInclude ID="JsInclude7" runat="server" FilePath="Tree/jquery.tree.contextmenu.js" PathNameAlias="UmbracoClient" Priority="12" />
<umb:JsInclude ID="JsInclude12" runat="server" FilePath="Tree/jquery.tree.checkbox.js" PathNameAlias="UmbracoClient" Priority="12" />
<umb:JsInclude ID="JsInclude9" runat="server" FilePath="Tree/NodeDefinition.js" PathNameAlias="UmbracoClient" Priority="12" />
<umb:JsInclude ID="JsInclude10" runat="server" FilePath="Tree/UmbracoTree.js" PathNameAlias="UmbracoClient" Priority="13" />
<script type="text/javascript">
jQuery(document).ready(function() {
var ctxMenu = <%#GetJSONContextMenu() %>;
var app = "<%#App%>";
var showContext = <%#ShowContextMenu.ToString().ToLower()%>;
var isDialog = <%#IsDialog.ToString().ToLower()%>;
var dialogMode = "<%#DialogMode.ToString()%>";
var treeType = "<%#TreeType%>";
var functionToCall = "<%#FunctionToCall%>";
var nodeKey = "<%#NodeKey%>";
//create the javascript tree
jQuery("#<%=ClientID%>").UmbracoTree({
doNotInit: <%#ManualInitialization.ToString().ToLower()%>,
jsonFullMenu: ctxMenu,
appActions: UmbClientMgr.appActions(),
deletingText: '<%=umbraco.ui.GetText("deleting")%>',
app: app,
showContext: showContext,
isDialog: isDialog,
dialogMode: dialogMode,
treeType: treeType,
functionToCall : functionToCall,
nodeKey : nodeKey,
treeMode: "<%#Mode.ToString().ToLower()%>",
dataUrl: "<%#Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco)%>/webservices/TreeDataService.ashx",
serviceUrl: "<%#Umbraco.Core.IO.IOHelper.ResolveUrl(Umbraco.Core.IO.SystemDirectories.Umbraco)%>/webservices/TreeClientService.asmx/GetInitAppTreeData"});
//add event handler for ajax errors, this will refresh the whole application
var mainTree = UmbClientMgr.mainTree();
if (mainTree != null) {
mainTree.addEventHandler("ajaxError", function(e) {
if (e.msg == "rebuildTree") {
UmbClientMgr.mainWindow("umbraco.aspx");
}
});
}
<%#GetLegacyIActionJavascript()%>
});
</script>
<div runat="server" id="TreeContainer">
<div id="<%=ClientID%>" class="<%#Mode.ToString().ToLower()%>">
</div>
</div>

View File

@@ -64,6 +64,7 @@ namespace umbraco.controls.Tree
private TreeMode m_TreeType = TreeMode.Standard;
private bool m_IsInit = false;
private TreeService m_TreeService = new TreeService();
private string m_SelectedNodePath;
#region Public Properties
@@ -102,6 +103,15 @@ namespace umbraco.controls.Tree
}
}
public string SelectedNodePath
{
get { return m_SelectedNodePath; }
set
{
m_SelectedNodePath = value;
}
}
public string TreeType
{
get { return m_TreeService.TreeType; }
@@ -418,5 +428,149 @@ namespace umbraco.controls.Tree
//if everything is null then return the default app
return DEFAULT_APP;
}
/// <summary>
/// CssInclude2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude2;
/// <summary>
/// CssInclude3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude3;
/// <summary>
/// CssInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
/// <summary>
/// JsInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
/// <summary>
/// JsInclude2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude2;
/// <summary>
/// JsInclude3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude3;
/// <summary>
/// JsInclude4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude4;
/// <summary>
/// JsInclude5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude5;
/// <summary>
/// JsInclude6 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude6;
/// <summary>
/// JsInclude8 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude8;
/// <summary>
/// JsInclude11 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude11;
/// <summary>
/// JsInclude7 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude7;
/// <summary>
/// JsInclude12 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude12;
/// <summary>
/// JsInclude9 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude9;
/// <summary>
/// JsInclude10 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude10;
/// <summary>
/// TreeContainer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl TreeContainer;
}
}

View File

@@ -1,159 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace umbraco.controls.Tree {
public partial class TreeControl {
/// <summary>
/// CssInclude2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude2;
/// <summary>
/// CssInclude3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude3;
/// <summary>
/// CssInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
/// <summary>
/// JsInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude1;
/// <summary>
/// JsInclude2 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude2;
/// <summary>
/// JsInclude3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude3;
/// <summary>
/// JsInclude4 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude4;
/// <summary>
/// JsInclude5 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude5;
/// <summary>
/// JsInclude6 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude6;
/// <summary>
/// JsInclude8 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude8;
/// <summary>
/// JsInclude11 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude11;
/// <summary>
/// JsInclude7 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude7;
/// <summary>
/// JsInclude12 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude12;
/// <summary>
/// JsInclude9 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude9;
/// <summary>
/// JsInclude10 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude10;
/// <summary>
/// TreeContainer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl TreeContainer;
}
}

View File

@@ -88,6 +88,10 @@ namespace umbraco.dialogs
currContent = Services.MediaService.GetById(Request.GetItemAs<int>("id"));
}
// Preselect the parent of the seslected item.
if (currContent.ParentId > 0)
JTree.SelectedNodePath = currContent.Path.Substring(0, currContent.Path.LastIndexOf(','));
var validAction = true;
if (CurrentApp == Constants.Applications.Content && Umbraco.Core.Models.ContentExtensions.HasChildren(currContent, Services))
{

View File

@@ -20,6 +20,12 @@ namespace umbraco.dialogs
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.ParentId > 0)
DialogTree.SelectedNodePath = currContent.Path;
}
}
protected TreeService TreeParams { get; private set; }

View File

@@ -1,4 +1,5 @@
using System;
using System.Web;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@@ -1,4 +1,5 @@
using System;
using System.Web;
using System.Web.UI;
using umbraco.cms.presentation.Trees;
@@ -9,6 +10,7 @@ using umbraco.interfaces;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using umbraco.editorControls.pagepicker;
using umbraco.uicontrols;
using umbraco.uicontrols.TreePicker;
namespace umbraco.editorControls
{
@@ -27,7 +29,12 @@ namespace umbraco.editorControls
{
get
{
return TreeService.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content");
if (HttpContext.Current != null && HttpContext.Current.Request.QueryString["id"] != null)
{
return TreeUrlGenerator.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content") + "&selected=" + HttpContext.Current.Request.QueryString["id"];
}
return TreeUrlGenerator.GetPickerUrl(Umbraco.Core.Constants.Applications.Content, "content");
}
}