diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_content.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_content.ico new file mode 100644 index 0000000000..06aed6d45d Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_content.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_default.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_default.ico new file mode 100644 index 0000000000..8ccffe0794 Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_default.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_developer.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_developer.ico new file mode 100644 index 0000000000..07bbf289e9 Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_developer.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_media.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_media.ico new file mode 100644 index 0000000000..50e357ca8b Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_media.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_member.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_member.ico new file mode 100644 index 0000000000..7d68fa3c81 Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_member.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_settings.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_settings.ico new file mode 100644 index 0000000000..619bdf265d Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_settings.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/task_users.ico b/umbraco/presentation/umbraco/images/pinnedIcons/task_users.ico new file mode 100644 index 0000000000..925f0f60d3 Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/task_users.ico differ diff --git a/umbraco/presentation/umbraco/images/pinnedIcons/umb.ico b/umbraco/presentation/umbraco/images/pinnedIcons/umb.ico new file mode 100644 index 0000000000..b1baa5b622 Binary files /dev/null and b/umbraco/presentation/umbraco/images/pinnedIcons/umb.ico differ diff --git a/umbraco/presentation/umbraco/scripting/templates/cshtml/UsingRelatedLinks.cshtml b/umbraco/presentation/umbraco/scripting/templates/cshtml/UsingRelatedLinks.cshtml new file mode 100644 index 0000000000..628dcfb51b --- /dev/null +++ b/umbraco/presentation/umbraco/scripting/templates/cshtml/UsingRelatedLinks.cshtml @@ -0,0 +1,37 @@ +@* +USING RELATED LINKS (AND OTHER XML BASED TYPES +============================================== +This snippet shows how to work with properties that stores multiple values in XML such as the "Related Links" data type. +When the Razor (or in fact the 'DynamicNode') detected XML, it automatically makes it possible to navigate the xml by +using the name of the XML elements as properties. Be aware that the first xml element (the container) is always skipped +and that the properties are case sensitive! + +How it works: +- First we check if there's a property on the current page (Model) named 'relatedLinks' +- Then we loop through the XML elements of the property 'RelatedLinks' (ie. all the links) +- For each link we check if it should be opened in a new window (stored in an XML attribute called 'newwindow' which is + automatically translated into a property '.newwindow' by DynamicNode +- Then we test if the link type is a internal or external link, and if it's an internal link we use the NiceUrl helper + method to convert the id of the page to a SEO friendly url + +NOTE: It is safe to remove this comment (anything between @ * * @), the code that generates the list is only the below! +*@ + +@inherits umbraco.MacroEngines.DynamicNodeContext + +@{ + if (Model.HasProperty("relatedLinks")) { + + } +} diff --git a/umbraco/presentation/umbraco/umbraco.aspx.cs b/umbraco/presentation/umbraco/umbraco.aspx.cs index 3bdbb9f9f3..c4517b3e5b 100644 --- a/umbraco/presentation/umbraco/umbraco.aspx.cs +++ b/umbraco/presentation/umbraco/umbraco.aspx.cs @@ -3,6 +3,7 @@ using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Web; using System.Web.SessionState; using System.Web.UI; @@ -21,13 +22,13 @@ using System.Text.RegularExpressions; namespace umbraco.cms.presentation { - /// - /// Summary description for _default. - /// - public partial class _umbraco : UmbracoEnsuredPage - { - protected umbWindow UmbWindow1; - protected System.Web.UI.WebControls.PlaceHolder bubbleText; + /// + /// Summary description for _default. + /// + public partial class _umbraco : UmbracoEnsuredPage + { + protected umbWindow UmbWindow1; + protected System.Web.UI.WebControls.PlaceHolder bubbleText; public string DefaultApp { get; private set; } @@ -48,7 +49,7 @@ namespace umbraco.cms.presentation { string appClass = a.icon.StartsWith(".") ? a.icon.Substring(1, a.icon.Length - 1) : a.alias; - + //adds client side event handlers to the icon buttons JSEvents.Append(@"jQuery('." + appClass + "').click(function() { appClick.call(this, '" + a.alias + "'); } );"); JSEvents.Append(@"jQuery('." + appClass + "').dblclick(function() { appDblClick.call(this, '" + a.alias + "'); } );"); @@ -91,8 +92,8 @@ namespace umbraco.cms.presentation // Version check goes here! - // zb-00004 #29956 : refactor cookies names & handling - var updChkCookie = new umbraco.BusinessLogic.StateHelper.Cookies.Cookie("UMB_UPDCHK", GlobalSettings.VersionCheckPeriod); // was "updateCheck" + // zb-00004 #29956 : refactor cookies names & handling + var updChkCookie = new umbraco.BusinessLogic.StateHelper.Cookies.Cookie("UMB_UPDCHK", GlobalSettings.VersionCheckPeriod); // was "updateCheck" string updateCheckCookie = updChkCookie.HasValue ? updChkCookie.GetValue() : ""; if (GlobalSettings.VersionCheckPeriod > 0 && String.IsNullOrEmpty(updateCheckCookie) && base.getUser().UserType.Alias == "admin") @@ -105,16 +106,55 @@ namespace umbraco.cms.presentation Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "upgradeChecker", "jQuery(document).ready(function() {umbraco.presentation.webservices.CheckForUpgrade.CallUpgradeService(umbracoCheckUpgrade);});", true); - updChkCookie.SetValue("1"); + updChkCookie.SetValue("1"); } DataBind(); + + AddIe9Meta(); + } + + private void AddIe9Meta() + { + if (Request.Browser.Browser == "IE" && Request.Browser.MajorVersion == 9) + { + StringBuilder metadata = new StringBuilder(); + metadata.AppendFormat( + @" + + + + + ", + IOHelper.ResolveUrl(SystemDirectories.Umbraco + "/images/pinnedIcons/umb.ico"), + HttpContext.Current.Request.Url.Host.ToLower().Replace("www.", "")); + + var user = base.getUser(); + if (user != null && user.Applications != null && user.Applications.Length > 0) + { + foreach (var app in user.Applications) + { + metadata.AppendFormat( + @"", + ui.Text("sections", app.alias, user), + IOHelper.ResolveUrl(string.Format("{0}/umbraco.aspx#{1}", SystemDirectories.Umbraco, app.alias)), + File.Exists( + IOHelper.MapPath( + IOHelper.ResolveUrl( + string.Format("{0}/images/pinnedIcons/task_{1}.ico", SystemDirectories.Umbraco, app.alias)))) + ? "/umbraco/images/pinnedIcons/task_" + app.alias + ".ico" + : "/umbraco/images/pinnedIcons/task_default.ico"); + } + } + + this.Header.Controls.Add(new LiteralControl(metadata.ToString())); + } } /// /// Renders out all JavaScript references that have bee declared in IActions /// private void RenderActionJS() - { + { var item = 0; foreach (var jsFile in umbraco.BusinessLogic.Actions.Action.GetJavaScriptFileReferences()) { @@ -125,7 +165,7 @@ namespace umbraco.cms.presentation { var jsUrl = new Uri(jsFile, UriKind.RelativeOrAbsolute); //ok it validates, but so does alert('hello'); ! so we need to do more checks - + //here are the valid chars in a url without escaping if (Regex.IsMatch(jsFile, @"[^a-zA-Z0-9-._~:/?#\[\]@!$&'\(\)*\+,%;=]")) isValid = false; @@ -145,7 +185,7 @@ namespace umbraco.cms.presentation { //add to page Page.ClientScript.RegisterClientScriptInclude(this.GetType(), item.ToString(), jsFile); - } + } } catch (UriFormatException) { @@ -163,5 +203,5 @@ namespace umbraco.cms.presentation } } - } + } }