diff --git a/src/Umbraco.Web.UI/config/restExtensions.config b/src/Umbraco.Web.UI/config/restExtensions.config index 7c022a4267..42a64b14b1 100644 --- a/src/Umbraco.Web.UI/config/restExtensions.config +++ b/src/Umbraco.Web.UI/config/restExtensions.config @@ -2,8 +2,8 @@ - - + + @@ -11,9 +11,9 @@ - - - + + + diff --git a/src/Umbraco.Web.UI/config/xsltExtensions.config b/src/Umbraco.Web.UI/config/xsltExtensions.config index 17962f8205..354f37fd64 100644 --- a/src/Umbraco.Web.UI/config/xsltExtensions.config +++ b/src/Umbraco.Web.UI/config/xsltExtensions.config @@ -1,11 +1,15 @@ - + - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 7bca6df326..ffdd59879a 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -1419,7 +1419,15 @@ namespace umbraco Debug.Assert(pageElements != null, "pageElements cannot be null"); try { - string userControlPath = @"~/" + fileName; + string userControlPath = fileName; + + if (!userControlPath.StartsWith("~")) + { + if (userControlPath.StartsWith("/")) + userControlPath = "~" + userControlPath; + else + userControlPath = "~/" + userControlPath; + } if (!File.Exists(IOHelper.MapPath(userControlPath))) return new LiteralControl(string.Format("UserControl {0} does not exist.", fileName)); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index 41eb408161..8ef7995f36 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -308,12 +308,12 @@ namespace umbraco.cms.presentation.developer { DirectoryInfo di = new DirectoryInfo(path); - string rootDir = IOHelper.MapPath(SystemDirectories.Root); + string rootDir = IOHelper.MapPath(SystemDirectories.Usercontrols); foreach (FileInfo uc in di.GetFiles("*.ascx")) { userControlList.Items.Add( - new ListItem( + new ListItem(SystemDirectories.Usercontrols + uc.FullName.Substring(rootDir.Length).Replace(IOHelper.DirSepChar, '/'))); /* uc.FullName.IndexOf(usercontrolsDir), diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs index 8e1831ea50..fedc5465f8 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs @@ -60,6 +60,13 @@ namespace umbraco.editorControls.userControlGrapper { base.OnInit (e); + if (!_usercontrolPath.StartsWith("~")) + { + if (_usercontrolPath.StartsWith("/")) + _usercontrolPath = "~" + _usercontrolPath; + else + _usercontrolPath = "~/" + _usercontrolPath; + } Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath); if (HasSettings(oControl.GetType())) diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs index b9d99982ce..45fcd2047b 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs @@ -42,7 +42,7 @@ namespace umbraco.editorControls.userControlGrapper public override string DataTypeName { - get { return "umbraco usercontrol wrapper"; } + get { return "Umbraco Usercontrol Wrapper"; } } public override umbraco.interfaces.IDataPrevalue PrevalueEditor diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs index 5e40494258..3b2ce64443 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs @@ -76,14 +76,15 @@ namespace umbraco.editorControls.userControlGrapper private void populateUserControls(string path) { DirectoryInfo di = new DirectoryInfo(path); + foreach (FileInfo uc in di.GetFiles("*.ascx")) { - string root = IOHelper.MapPath(SystemDirectories.Root); + string ucRoot = IOHelper.MapPath(SystemDirectories.Usercontrols); _dropdownlistUserControl.Items.Add( - new ListItem( - uc.FullName.Substring(root.Length).Replace(IOHelper.DirSepChar, '/')) + new ListItem( SystemDirectories.Usercontrols + + uc.FullName.Substring(ucRoot.Length).Replace(IOHelper.DirSepChar, '/')) /* new ListItem(