diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 66ecaccbd0..d8ab3d5699 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -11,4 +11,9 @@ These notes will form the release notes that go out with each public release GE 11/06/2012: Fixed deep linking to Content,Media,DocumentType,MediaType,DataType,Css,Javascript,Razor,XSLT and added a umbraco.cms.helpers.DeepLink.get class to return valid links based on type and - id (or file path in the case of js/xslt/razor) \ No newline at end of file + id (or file path in the case of js/xslt/razor) +GE 11/06/2012: + Added links from Document Types to templates via an Edit > link in the checkbox list + Rewrote the databinding in DocumentType for Template selection to clean it up + Added links from the Template to the Document Type via a new drop down menu in the toolbar + Updated umbraco.cms.helpers.DeepLink.Get to be .GetUrl and .GetAnchor and support internal links without page refresh \ No newline at end of file diff --git a/components/macroRenderings/umbraco.macroRenderings.csproj b/components/macroRenderings/umbraco.macroRenderings.csproj index 1d4060b10f..32230df177 100644 --- a/components/macroRenderings/umbraco.macroRenderings.csproj +++ b/components/macroRenderings/umbraco.macroRenderings.csproj @@ -36,7 +36,7 @@ 3.5 - v3.5 + v4.0 publish\ true Disk @@ -52,6 +52,7 @@ false false true + bin\Debug\ diff --git a/components/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs b/components/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs index e21892bfff..5208deb2ad 100644 --- a/components/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs +++ b/components/umbraco.controls/TreePicker/BaseTreePickerScripts.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.544 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/components/umbraco.controls/umbraco.controls.csproj b/components/umbraco.controls/umbraco.controls.csproj index f56a5086d8..5581fb5fd1 100644 --- a/components/umbraco.controls/umbraco.controls.csproj +++ b/components/umbraco.controls/umbraco.controls.csproj @@ -23,7 +23,7 @@ 3.5 - v3.5 + v4.0 publish\ true Disk @@ -39,6 +39,7 @@ false false true + true diff --git a/foreign dlls/Examine.dll b/foreign dlls/Examine.dll index b77f6ebd8c..c238d7375c 100644 Binary files a/foreign dlls/Examine.dll and b/foreign dlls/Examine.dll differ diff --git a/foreign dlls/ICSharpCode.SharpZipLib.dll b/foreign dlls/ICSharpCode.SharpZipLib.dll index e829ebf4ba..fe643ebc63 100644 Binary files a/foreign dlls/ICSharpCode.SharpZipLib.dll and b/foreign dlls/ICSharpCode.SharpZipLib.dll differ diff --git a/foreign dlls/Lucene.Net.dll b/foreign dlls/Lucene.Net.dll index 138ec60820..28ce25acf0 100644 Binary files a/foreign dlls/Lucene.Net.dll and b/foreign dlls/Lucene.Net.dll differ diff --git a/foreign dlls/UmbracoExamine.dll b/foreign dlls/UmbracoExamine.dll index 3881e2d62c..05be41df51 100644 Binary files a/foreign dlls/UmbracoExamine.dll and b/foreign dlls/UmbracoExamine.dll differ diff --git a/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj b/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj index 79299b2705..88f8c449d7 100644 --- a/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj +++ b/umbraco.MacroEngines.Juno/umbraco.MacroEngines.csproj @@ -41,11 +41,12 @@ ..\foreign dlls\Examine.dll + False ..\foreign dlls\HtmlAgilityPack.dll - + ..\foreign dlls\Lucene.Net.dll @@ -70,6 +71,7 @@ ..\foreign dlls\UmbracoExamine.dll + False diff --git a/umbraco/businesslogic/umbraco.businesslogic.csproj b/umbraco/businesslogic/umbraco.businesslogic.csproj index e51a7ae406..ff3e038ab9 100644 --- a/umbraco/businesslogic/umbraco.businesslogic.csproj +++ b/umbraco/businesslogic/umbraco.businesslogic.csproj @@ -37,7 +37,7 @@ 3.5 true - v3.5 + v4.0 http://localhost/businesslogic/ true Web @@ -52,6 +52,7 @@ 1.0.0.%2a false true + bin\Debug\ @@ -101,9 +102,7 @@ AllRules.ruleset - - System - + 3.5 diff --git a/umbraco/cms/businesslogic/ContentType.cs b/umbraco/cms/businesslogic/ContentType.cs index 70532eed4c..8b43a48edd 100644 --- a/umbraco/cms/businesslogic/ContentType.cs +++ b/umbraco/cms/businesslogic/ContentType.cs @@ -12,7 +12,9 @@ using umbraco.cms.businesslogic.language; using umbraco.cms.businesslogic.propertytype; using umbraco.cms.businesslogic.web; using umbraco.DataLayer; +using Tuple = System.Tuple; using umbraco.BusinessLogic; +using umbraco.DataLayer.SqlHelpers.MySql; [assembly: InternalsVisibleTo("Umbraco.Test")] @@ -851,6 +853,30 @@ namespace umbraco.cms.businesslogic base.delete(); } + public IEnumerable> GetContent() + { + List> list = new List>(); + bool mySQL = (SqlHelper.GetType() == typeof(MySqlHelper)); + string sql = string.Empty; + if (!mySQL) + { + sql = "Select top (100) cmsContent.nodeid, cmsDocument.text from cmsContent join cmsDocument on cmsDocument.nodeId = cmsContent.nodeid where cmsdocument.published = 1 and cmscontent.contentType = " + this.Id; + } + else + { + sql = "Select cmsContent.nodeid, cmsDocument.text from cmsContent join cmsDocument on cmsDocument.nodeId = cmsContent.nodeid where cmsdocument.published = 1 and cmscontent.contentType = " + this.Id + " limit 0,100"; + } + using (IRecordsReader dr = SqlHelper.ExecuteReader(sql)) + { + while (dr.Read()) + { + list.Add(new System.Tuple(dr.GetInt("nodeid"), dr.GetString("text"))); + } + dr.Close(); + } + return list; + } + #endregion #region Protected Methods diff --git a/umbraco/cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs b/umbraco/cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs index e8648a47f0..e7eb18304c 100644 --- a/umbraco/cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs +++ b/umbraco/cms/businesslogic/Packager/FileResources/PackageFiles.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.544 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/umbraco/cms/businesslogic/Tuple.cs b/umbraco/cms/businesslogic/Tuple.cs index 6cf5fd404e..6034f187b4 100644 --- a/umbraco/cms/businesslogic/Tuple.cs +++ b/umbraco/cms/businesslogic/Tuple.cs @@ -6,6 +6,7 @@ using System.Collections; namespace umbraco.cms.businesslogic { + [Obsolete("umbraco.cms.businesslogic.Tuple is Obsolete, use System.Tuple instead")] public class Tuple : IEquatable> { public T first { get; set; } diff --git a/umbraco/cms/businesslogic/macro/MacroEngineFactory.cs b/umbraco/cms/businesslogic/macro/MacroEngineFactory.cs index 245c6a4cb2..e738664bf5 100644 --- a/umbraco/cms/businesslogic/macro/MacroEngineFactory.cs +++ b/umbraco/cms/businesslogic/macro/MacroEngineFactory.cs @@ -11,6 +11,8 @@ namespace umbraco.cms.businesslogic.macro { private static readonly Dictionary m_engines = new Dictionary(); private static readonly List m_allEngines = new List(); + private static object locker = new object(); + public MacroEngineFactory() { Initialize(); @@ -39,7 +41,11 @@ namespace umbraco.cms.businesslogic.macro { try { - m_engines.Add(typeInstance.Name, t); + lock (locker) + { + if (!m_engines.ContainsKey(typeInstance.Name)) + m_engines.Add(typeInstance.Name, t); + } } catch (Exception ee) { diff --git a/umbraco/cms/businesslogic/template/Template.cs b/umbraco/cms/businesslogic/template/Template.cs index f5c6585d80..4053f87894 100644 --- a/umbraco/cms/businesslogic/template/Template.cs +++ b/umbraco/cms/businesslogic/template/Template.cs @@ -12,6 +12,8 @@ using umbraco.BusinessLogic; using umbraco.IO; using System.Web; using umbraco.cms.businesslogic.web; +using Tuple = System.Tuple; +using umbraco.DataLayer.SqlHelpers.MySql; namespace umbraco.cms.businesslogic.template { @@ -326,8 +328,39 @@ namespace umbraco.cms.businesslogic.template } } - - + public IEnumerable GetDocumentTypes() + { + return DocumentType.GetAllAsList().Where(x => x.allowedTemplates.Select(t => t.Id).Contains(this.Id)); + } + public IEnumerable> GetContent() + { + List> list = new List>(); + bool mySQL = (SqlHelper.GetType() == typeof(MySqlHelper)); + string sql = string.Empty; + if (!mySQL) + { + sql = "Select top (100) nodeid, text from cmsDocument where published = 1 and templateId = " + this.Id; + } + else + { + sql = "Select nodeid, text from cmsDocument where published = 1 and templateId = " + this.Id + " limit 0,100"; + } + using (IRecordsReader dr = SqlHelper.ExecuteReader(sql)) + { + int i = 0; + while (dr.Read()) + { + list.Add(new System.Tuple(dr.GetInt("nodeid"), dr.GetString("text"))); + i++; + if (i >= 100) + { + break; + } + } + dr.Close(); + } + return list; + } public static Template MakeNew(string Name, BusinessLogic.User u, Template master) { diff --git a/umbraco/cms/businesslogic/workflow/Notification.cs b/umbraco/cms/businesslogic/workflow/Notification.cs index 71faa2b6ed..7722fd03ba 100644 --- a/umbraco/cms/businesslogic/workflow/Notification.cs +++ b/umbraco/cms/businesslogic/workflow/Notification.cs @@ -124,7 +124,7 @@ namespace umbraco.cms.businesslogic.workflow summary.Append(""); summary.Append("" + p.PropertyType.Name + ""); - summary.Append("" + p.Value + ""); + summary.Append("" + p.Value.ToString() + ""); summary.Append(""); } summary.Append( diff --git a/umbraco/cms/helpers/DeepLink.cs b/umbraco/cms/helpers/DeepLink.cs index f5ed0c6f82..1ab9c50820 100644 --- a/umbraco/cms/helpers/DeepLink.cs +++ b/umbraco/cms/helpers/DeepLink.cs @@ -23,7 +23,23 @@ namespace umbraco.cms.helpers string sPath = string.Join(",", treePath.ToArray()); return sPath; } - public static string Get(DeepLinkType type, string idOrFilePath) + public static string GetAnchor(DeepLinkType type, string idOrFilePath, bool useJavascript) + { + string url = GetUrl(type, idOrFilePath, useJavascript); + if (!string.IsNullOrEmpty(url)) + { + if (!useJavascript) + { + return string.Format("{1} >", url, ui.GetText("general", "edit")); + } + else + { + return string.Format("{1} >", url, ui.GetText("general", "edit")); + } + } + return null; + } + public static string GetUrl(DeepLinkType type, string idOrFilePath, bool useJavascript) { string basePath = "/umbraco/umbraco.aspx"; @@ -98,7 +114,15 @@ namespace umbraco.cms.helpers if (currentUser.Applications.Any(app => app.alias == section)) { string rightAction = string.Format("{0}?{1}={2}", editorUrl, idKey, idOrFilePath); - return string.Format("{0}?app={1}&rightAction={2}#{1}", basePath, section, HttpContext.Current.Server.UrlEncode(rightAction)); + if (!useJavascript) + { + string rightActionEncoded = HttpContext.Current.Server.UrlEncode(rightAction); + return string.Format("{0}?app={1}&rightAction={2}#{1}", basePath, section, rightActionEncoded); + } + else + { + return string.Format("javascript:UmbClientMgr.contentFrameAndSection('{0}','{1}');", section, rightAction); + } } } } diff --git a/umbraco/cms/umbraco.cms.csproj b/umbraco/cms/umbraco.cms.csproj index db1a99cda0..2a69a6f7a1 100644 --- a/umbraco/cms/umbraco.cms.csproj +++ b/umbraco/cms/umbraco.cms.csproj @@ -36,7 +36,7 @@ 3.5 - v3.5 + v4.0 publish\ true Disk @@ -52,6 +52,7 @@ false false true + bin\Debug\ @@ -129,6 +130,7 @@ System.Web + 3.5 diff --git a/umbraco/presentation/App_Data/Umbraco.sdf b/umbraco/presentation/App_Data/Umbraco.sdf index a4ad7651d4..90935a7f0b 100644 Binary files a/umbraco/presentation/App_Data/Umbraco.sdf and b/umbraco/presentation/App_Data/Umbraco.sdf differ diff --git a/umbraco/presentation/umbraco.presentation.csproj b/umbraco/presentation/umbraco.presentation.csproj index f905943e1d..4be5521784 100644 --- a/umbraco/presentation/umbraco.presentation.csproj +++ b/umbraco/presentation/umbraco.presentation.csproj @@ -107,8 +107,9 @@ False ..\..\foreign dlls\ICSharpCode.SharpZipLib.dll - - C:\Users\Shannon\Documents\Visual Studio 2008\Projects\Umbraco\Branch-4.1\foreign dlls\Lucene.Net.dll + + False + ..\..\foreign dlls\Lucene.Net.dll ..\..\foreign dlls\Our.Umbraco.uGoLive.dll @@ -1721,10 +1722,13 @@ True Reference.map + + + @@ -3315,7 +3319,6 @@ - diff --git a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx index 740afbbed2..90ca8ab241 100644 --- a/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx +++ b/umbraco/presentation/umbraco/controls/ContentTypeControlNew.ascx @@ -94,7 +94,29 @@ - + +
+
+ Content that Uses this Document Type +
+
+ None +
+ + +
+ +   + +
+
+
+
+ diff --git a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.cs b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.cs index d113683502..075b6a82ee 100644 --- a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.cs +++ b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.cs @@ -10,6 +10,8 @@ using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using umbraco.cms.presentation.Trees; using umbraco.cms.businesslogic.web; +using System.Linq; +using umbraco.cms.helpers; namespace umbraco.settings { @@ -49,59 +51,54 @@ namespace umbraco.settings } + private void bindTemplates() { - cms.businesslogic.template.Template[] selectedTemplates = dt.allowedTemplates; - - DataTable dtAllowedTemplates = new DataTable(); - dtTemplates.Columns.Add("name"); - dtTemplates.Columns.Add("id"); - dtTemplates.Columns.Add("selected"); - - - ddlTemplates.Items.Add(new ListItem("Ingen template", "0")); - foreach (cms.businesslogic.template.Template t in cms.businesslogic.template.Template.GetAllAsList()) - { - DataRow dr = dtTemplates.NewRow(); - dr["name"] = t.Text; - dr["id"] = t.Id; - dr["selected"] = false; - foreach (cms.businesslogic.template.Template t1 in selectedTemplates) - if (t1 != null && t1.Id == t.Id) - dr["selected"] = true; - - dtTemplates.Rows.Add(dr); - - } + var templates = (from t in cms.businesslogic.template.Template.GetAllAsList() + join at in dt.allowedTemplates on t.Id equals at.Id into at_l + from at in at_l.DefaultIfEmpty() + select new + { + Id = t.Id, + Name = t.Text, + Selected = at != null + }).ToList(); templateList.Items.Clear(); - - foreach (DataRow dr in dtTemplates.Rows) + templateList.Items.AddRange(templates.ConvertAll(item => { - ListItem li = new ListItem(dr["name"].ToString(), dr["id"].ToString()); - if (bool.Parse(dr["selected"].ToString())) - li.Selected = true; - templateList.Items.Add(li); - } + string anchor = DeepLink.GetAnchor(DeepLinkType.Template, item.Id.ToString(), true); + ListItem li = new ListItem(); + if (!string.IsNullOrEmpty(anchor)) + { + li.Text = string.Format("{0} {1}", item.Name, anchor); + } + else + { + li.Text = item.Name; + } + li.Value = item.Id.ToString(); + li.Selected = item.Selected; + return li; + }).ToArray()); + + ddlTemplates.Enabled = templates.Any(); ddlTemplates.Items.Clear(); - foreach (DataRow dr in dtTemplates.Rows) - { - ListItem li = new ListItem(dr["name"].ToString(), dr["id"].ToString()); - if (li.Value == dt.DefaultTemplate.ToString()) - li.Selected = true; - if (bool.Parse(dr["selected"].ToString())) - ddlTemplates.Items.Add(li); - } - if (ddlTemplates.Items.Count > 0) ddlTemplates.Enabled = true; - else ddlTemplates.Enabled = false; - - // Add choose to ddlTemplates ddlTemplates.Items.Insert(0, new ListItem(ui.Text("choose") + "...", "0")); + ddlTemplates.Items.AddRange(templates.ConvertAll(item => + { + ListItem li = new ListItem(); + li.Text = item.Name; + li.Value = item.Id.ToString(); + return li; + }).ToArray()); + + var ddlTemplatesSelect = ddlTemplates.Items.FindByValue(dt.DefaultTemplate.ToString()); + if (ddlTemplatesSelect != null) ddlTemplatesSelect.Selected = true; } - protected override bool OnBubbleEvent(object source, EventArgs args) { bool handled = false; diff --git a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs index 19f03326bd..46f4e80c35 100644 --- a/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/EditNodeTypeNew.aspx.designer.cs @@ -12,6 +12,24 @@ namespace umbraco.settings { public partial class EditContentTypeNew { + /// + /// CssInclude1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; + + /// + /// JsInclude control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::ClientDependency.Core.Controls.JsInclude JsInclude; + /// /// tmpPane control. /// diff --git a/umbraco/presentation/umbraco/settings/editTemplate.aspx b/umbraco/presentation/umbraco/settings/editTemplate.aspx index c4b4eb6f24..2e65298485 100644 --- a/umbraco/presentation/umbraco/settings/editTemplate.aspx +++ b/umbraco/presentation/umbraco/settings/editTemplate.aspx @@ -9,23 +9,13 @@ diff --git a/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs b/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs index bf7088258e..d563676b1e 100644 --- a/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs +++ b/umbraco/presentation/umbraco/settings/editTemplate.aspx.cs @@ -11,6 +11,7 @@ using umbraco.cms.presentation.Trees; using umbraco.DataLayer; using umbraco.IO; using umbraco.uicontrols; +using System.Linq; namespace umbraco.cms.presentation.settings { @@ -77,9 +78,39 @@ namespace umbraco.cms.presentation.settings LoadScriptingTemplates(); LoadMacros(); + LoadDocTypes(); + LoadContent(); } } + protected void splitButtonDocumentTypesRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) + { + Tuple item = e.Item.DataItem as Tuple; + if (item != null) + { + Literal uxName = e.Item.FindControl("uxName") as Literal; + PlaceHolder uxLink = e.Item.FindControl("uxLink") as PlaceHolder; + uxName.Text = item.Item2; + uxLink.Controls.Add(new LiteralControl(umbraco.cms.helpers.DeepLink.GetAnchor(helpers.DeepLinkType.DocumentType, item.Item1.ToString(), true))); + } + } + } + protected void splitButtonContentRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) + { + Tuple item = e.Item.DataItem as Tuple; + if (item != null) + { + Literal uxName = e.Item.FindControl("uxName") as Literal; + PlaceHolder uxLink = e.Item.FindControl("uxLink") as PlaceHolder; + uxName.Text = item.Item2; + uxLink.Controls.Add(new LiteralControl(umbraco.cms.helpers.DeepLink.GetAnchor(helpers.DeepLinkType.Content, item.Item1.ToString(), true))); + } + } + } protected override void OnInit(EventArgs e) { @@ -129,7 +160,6 @@ namespace umbraco.cms.presentation.settings Panel1.Menu.NewElement("div", "splitButtonMacroPlaceHolder", "sbPlaceHolder", 40); - if (UmbracoSettings.UseAspNetMasterPages) { Panel1.Menu.InsertSplitter(); @@ -169,6 +199,11 @@ namespace umbraco.cms.presentation.settings "','canvas')"; } + Panel1.Menu.InsertSplitter(); + Panel1.Menu.NewElement("div", "splitButtonDocTypePlaceHolder", "sbPlaceHolder", 40); + + Panel1.Menu.InsertSplitter(); + Panel1.Menu.NewElement("div", "splitButtonContentPlaceHolder", "sbPlaceHolder", 40); // Help Panel1.Menu.InsertSplitter(); @@ -220,6 +255,20 @@ namespace umbraco.cms.presentation.settings macroRenderings.Close(); } + private void LoadDocTypes() + { + var data = _template.GetDocumentTypes(); + splitButtonDocumentTypesRepeater.DataSource = data; + splitButtonDocumentTypesRepeater.DataBind(); + uxNoDocumentTypes.Visible = !data.Any(); + } + private void LoadContent() + { + var data = _template.GetContent(); + splitButtonContentRepeater.DataSource = data; + splitButtonContentRepeater.DataBind(); + uxNoContent.Visible = !data.Any(); + } public string DoesMacroHaveSettings(string macroId) { if ( diff --git a/umbraco/presentation/umbraco/settings/editTemplate.aspx.designer.cs b/umbraco/presentation/umbraco/settings/editTemplate.aspx.designer.cs index b760bc093f..f624db48c3 100644 --- a/umbraco/presentation/umbraco/settings/editTemplate.aspx.designer.cs +++ b/umbraco/presentation/umbraco/settings/editTemplate.aspx.designer.cs @@ -137,5 +137,41 @@ namespace umbraco.cms.presentation.settings { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Repeater rpt_macros; + + /// + /// uxNoDocumentTypes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl uxNoDocumentTypes; + + /// + /// splitButtonDocumentTypesRepeater control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater splitButtonDocumentTypesRepeater; + + /// + /// uxNoContent control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl uxNoContent; + + /// + /// splitButtonContentRepeater control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater splitButtonContentRepeater; } } diff --git a/umbraco/presentation/umbraco/uQuery/ContentExtensions.cs b/umbraco/presentation/umbraco/uQuery/ContentExtensions.cs index 35df33b46a..2bd5e941e8 100644 --- a/umbraco/presentation/umbraco/uQuery/ContentExtensions.cs +++ b/umbraco/presentation/umbraco/uQuery/ContentExtensions.cs @@ -53,7 +53,7 @@ namespace umbraco try { - xmlDocument.Load(item.GetPropertyAsString(propertyAlias)); + xmlDocument.LoadXml(item.GetPropertyAsString(propertyAlias)); } catch { diff --git a/umbraco/presentation/umbraco/uQuery/NodeExtensions.cs b/umbraco/presentation/umbraco/uQuery/NodeExtensions.cs index 85232ee16f..49df6d4af6 100644 --- a/umbraco/presentation/umbraco/uQuery/NodeExtensions.cs +++ b/umbraco/presentation/umbraco/uQuery/NodeExtensions.cs @@ -288,7 +288,7 @@ namespace umbraco try { - xmlDocument.Load(node.GetPropertyAsString(propertyAlias)); + xmlDocument.LoadXml(node.GetPropertyAsString(propertyAlias)); } catch { diff --git a/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js b/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js index 2f277a9c00..e3bc82b260 100644 --- a/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js +++ b/umbraco/presentation/umbraco_client/Application/UmbracoClientManager.js @@ -94,6 +94,14 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); // windowMgr: function() // return null; // }, + contentFrameAndSection: function(app, rightFrameUrl){ + //this.appActions().shiftApp(app, this.uiKeys()['sections_' + app]); + var self = this; + self.mainWindow().UmbClientMgr.historyManager().addHistory(app,true); + window.setTimeout(function(){ + self.mainWindow().UmbClientMgr.contentFrame(rightFrameUrl); + },200); + }, contentFrame: function(strLocation) { /// /// This will return the reference to the right content frame if strLocation is null or empty, @@ -101,6 +109,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); /// this._debug("contentFrame: " + strLocation); + if (strLocation == null || strLocation == "") { if (typeof this.mainWindow().right != "undefined") { return this.mainWindow().right; @@ -121,12 +130,13 @@ Umbraco.Sys.registerNamespace("Umbraco.Application"); } this._debug("contentFrame: parsed location: " + strLocation); + var self = this; window.setTimeout(function(){ - if (typeof this.mainWindow().right != "undefined") { - this.mainWindow().right.location.href = strLocation; + if (typeof self.mainWindow().right != "undefined") { + self.mainWindow().right.location.href = strLocation; } else { - this.mainWindow().location.href = strLocation; //set the current windows location if the right frame doesn't exist int he current context + self.mainWindow().location.href = strLocation; //set the current windows location if the right frame doesn't exist int he current context } },200); } diff --git a/umbraco/presentation/umbraco_client/scrollingmenu/javascript.js b/umbraco/presentation/umbraco_client/scrollingmenu/javascript.js index f78e0aa5c2..48ec85f905 100644 --- a/umbraco/presentation/umbraco_client/scrollingmenu/javascript.js +++ b/umbraco/presentation/umbraco_client/scrollingmenu/javascript.js @@ -81,9 +81,12 @@ function scrollL(elId, elHid, InnerWidth) { doScroll = true; - el = document.getElementById(elId); - FromLeftMax = (InnerWidth - document.getElementById(elHid).offsetWidth)*-1; - scrollHorisontal(0); + el = document.getElementById(elId); + var hiddenEl = document.getElementById(elHid); + if (hiddenEl) { + FromLeftMax = (InnerWidth - hiddenEl.offsetWidth) * -1; + scrollHorisontal(0); + } } function scrollStop() { diff --git a/umbraco/presentation/umbraco_client/splitbutton/jquery.splitbutton.js b/umbraco/presentation/umbraco_client/splitbutton/jquery.splitbutton.js index d024edebcb..295a1c605b 100644 --- a/umbraco/presentation/umbraco_client/splitbutton/jquery.splitbutton.js +++ b/umbraco/presentation/umbraco_client/splitbutton/jquery.splitbutton.js @@ -484,4 +484,47 @@ return $.extend({}, $.fn.linkbutton.parseOptions(_11), { menu: t.attr("menu"), duration: t.attr("duration") }); }; $.fn.splitbutton.defaults = $.extend({}, $.fn.linkbutton.defaults, { plain: true, menu: null, duration: 100 }); -})(jQuery); +})(jQuery); + +function applySplitButtonOverflow(containerId, innerId, menuId, itemCssSelector, buttonId) { + //hack for the dropdown scrill + jQuery("
").appendTo("#" + menuId); + jQuery(itemCssSelector).each(function () { + jQuery("#" + innerId).append(this); + }); + + //only needed when we need to add scroll to macro menu + var maxHeight = 500; + var menu = jQuery("#" + menuId); + var container = jQuery("#" + containerId); + var menuHeight = menu.height(); + + if (menuHeight > maxHeight) { + jQuery("").appendTo("#" + menuId); + menu.css({ + height: maxHeight, + overflow: "hidden" + }) + container.css({ + height: maxHeight - 20, + overflow: "hidden" + }); + var interval; + jQuery("#" + buttonId).hover(function (e) { + interval = setInterval(function () { + var offset = jQuery("#" + innerId).offset(); + var currentTop = jQuery("#" + innerId).css("top").replace("px", ""); + if (Number(currentTop) > -(menuHeight - 40)) { + jQuery("#" + innerId).css("top", currentTop - 20); + } + }, 125); + }, function () { + clearInterval(interval); + }); + + jQuery("#" + buttonId).hover(function (e) { + jQuery("#" + innerId).css("top", 0) + }); + } + +} \ No newline at end of file diff --git a/umbraco/providers/umbraco.providers.csproj b/umbraco/providers/umbraco.providers.csproj index d2bbb15523..006aa3ee2e 100644 --- a/umbraco/providers/umbraco.providers.csproj +++ b/umbraco/providers/umbraco.providers.csproj @@ -23,7 +23,7 @@ 3.5 - v3.5 + v4.0 publish\ true Disk @@ -39,6 +39,7 @@ false false true + true @@ -70,6 +71,7 @@ +