|
diff --git a/src/Umbraco.Web/Mvc/ControllerExtensions.cs b/src/Umbraco.Web/Mvc/ControllerExtensions.cs
index 3fa8495a72..59900e6489 100644
--- a/src/Umbraco.Web/Mvc/ControllerExtensions.cs
+++ b/src/Umbraco.Web/Mvc/ControllerExtensions.cs
@@ -92,7 +92,7 @@ namespace Umbraco.Web.Mvc
: ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName);
var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw);
viewResult.View.Render(viewContext, sw);
-
+ viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View);
return sw.GetStringBuilder().ToString();
}
}
diff --git a/src/Umbraco.Web/PublishedContentExtensions.cs b/src/Umbraco.Web/PublishedContentExtensions.cs
index abad9afdb4..8bcf54459f 100644
--- a/src/Umbraco.Web/PublishedContentExtensions.cs
+++ b/src/Umbraco.Web/PublishedContentExtensions.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Data;
using System.Linq;
using System.Web;
@@ -12,6 +13,7 @@ using umbraco;
using umbraco.cms.businesslogic;
using Umbraco.Core;
using umbraco.cms.businesslogic.template;
+using umbraco.interfaces;
namespace Umbraco.Web
{
@@ -24,6 +26,18 @@ namespace Umbraco.Web
///
public static class PublishedContentExtensions
{
+
+ ///
+ /// Converts an INode to an IPublishedContent item
+ ///
+ ///
+ ///
+ internal static IPublishedContent ConvertFromNode(this INode node)
+ {
+ var umbHelper = new UmbracoHelper(UmbracoContext.Current);
+ return umbHelper.TypedContent(node.Id);
+ }
+
///
/// Gets the NiceUrl for the content item
///
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 2037086798..1f6bc43f04 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -249,11 +249,13 @@
+
+
diff --git a/src/Umbraco.Web/umbraco.presentation/EnsureSystemPathsApplicationStartupHandler.cs b/src/Umbraco.Web/umbraco.presentation/EnsureSystemPathsApplicationStartupHandler.cs
index a6071c4432..4fa5d515a1 100644
--- a/src/Umbraco.Web/umbraco.presentation/EnsureSystemPathsApplicationStartupHandler.cs
+++ b/src/Umbraco.Web/umbraco.presentation/EnsureSystemPathsApplicationStartupHandler.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
-using umbraco.IO;
+using Umbraco.Core.IO;
using umbraco.businesslogic;
using umbraco.interfaces;
@@ -19,8 +19,11 @@ namespace umbraco.presentation
EnsurePathExists(SystemDirectories.Masterpages);
EnsurePathExists(SystemDirectories.Media);
EnsurePathExists(SystemDirectories.Scripts);
- EnsurePathExists(SystemDirectories.Usercontrols);
+ EnsurePathExists(SystemDirectories.UserControls);
EnsurePathExists(SystemDirectories.Xslt);
+ EnsurePathExists(SystemDirectories.MvcViews);
+ EnsurePathExists(SystemDirectories.MvcViews + "/Partials");
+ EnsurePathExists(SystemDirectories.MvcViews + "/MacroPartials");
}
public void EnsurePathExists(string path)
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 8ef7995f36..510264bec3 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
@@ -25,7 +25,6 @@ namespace umbraco.cms.presentation.developer
public editMacro()
{
CurrentApp = BusinessLogic.DefaultApps.developer.ToString();
-
}
protected PlaceHolder buttons;
@@ -86,17 +85,14 @@ namespace umbraco.cms.presentation.developer
macroPropertyBind();
// Load xslt files from default dir
- populateXsltFiles();
+ PopulateXsltFiles();
// Load python files from default dir
- populatePythonFiles();
+ PopulatePythonFiles();
// Load usercontrols
- populateUserControls(IOHelper.MapPath(SystemDirectories.Usercontrols));
+ PopulateUserControls(IOHelper.MapPath(SystemDirectories.Usercontrols));
userControlList.Items.Insert(0, new ListItem("Browse usercontrols on server...", string.Empty));
- userControlList.Attributes.Add("onChange",
- "document.getElementById('" + macroUserControl.ClientID + "').value = this[this.selectedIndex].value;");
-
}
else
@@ -167,14 +163,14 @@ namespace umbraco.cms.presentation.developer
}
}
- private void getXsltFilesFromDir(string orgPath, string path, ArrayList files)
+ private void GetXsltFilesFromDir(string orgPath, string path, ArrayList files)
{
DirectoryInfo dirInfo = new DirectoryInfo(path);
// Populate subdirectories
DirectoryInfo[] dirInfos = dirInfo.GetDirectories();
foreach (DirectoryInfo dir in dirInfos)
- getXsltFilesFromDir(orgPath, path + "/" + dir.Name, files);
+ GetXsltFilesFromDir(orgPath, path + "/" + dir.Name, files);
FileInfo[] fileInfo = dirInfo.GetFiles("*.xsl*");
@@ -182,19 +178,17 @@ namespace umbraco.cms.presentation.developer
files.Add((path.Replace(orgPath, string.Empty).Trim('/') + "/" + file.Name).Trim('/'));
}
- private void populateXsltFiles()
+ private void PopulateXsltFiles()
{
ArrayList xslts = new ArrayList();
string xsltDir = IOHelper.MapPath(SystemDirectories.Xslt + "/");
- getXsltFilesFromDir(xsltDir, xsltDir, xslts);
+ GetXsltFilesFromDir(xsltDir, xsltDir, xslts);
xsltFiles.DataSource = xslts;
xsltFiles.DataBind();
xsltFiles.Items.Insert(0, new ListItem("Browse xslt files on server...", string.Empty));
- xsltFiles.Attributes.Add("onChange",
- "document.getElementById('" + macroXslt.ClientID + "').value = this[this.selectedIndex].value; document.getElementById('" + macroPython.ClientID + "').value =''");
}
- private void getPythonFilesFromDir(string orgPath, string path, ArrayList files)
+ private void GetPythonFilesFromDir(string orgPath, string path, ArrayList files)
{
var dirInfo = new DirectoryInfo(path);
if (!dirInfo.Exists)
@@ -207,19 +201,17 @@ namespace umbraco.cms.presentation.developer
// Populate subdirectories
var dirInfos = dirInfo.GetDirectories();
foreach (var dir in dirInfos)
- getPythonFilesFromDir(orgPath, path + "/" + dir.Name + "/", files);
+ GetPythonFilesFromDir(orgPath, path + "/" + dir.Name + "/", files);
}
- private void populatePythonFiles()
+ private void PopulatePythonFiles()
{
ArrayList pythons = new ArrayList();
string pythonDir = IOHelper.MapPath(SystemDirectories.MacroScripts + "/");
- getPythonFilesFromDir(pythonDir, pythonDir, pythons);
+ GetPythonFilesFromDir(pythonDir, pythonDir, pythons);
pythonFiles.DataSource = pythons;
pythonFiles.DataBind();
pythonFiles.Items.Insert(0, new ListItem("Browse scripting files on server...", string.Empty));
- pythonFiles.Attributes.Add("onChange",
- "document.getElementById('" + macroPython.ClientID + "').value = this[this.selectedIndex].value; document.getElementById('" + macroXslt.ClientID + "').value = ''");
}
public void deleteMacroProperty(object sender, EventArgs e)
@@ -304,7 +296,7 @@ namespace umbraco.cms.presentation.developer
}
}
- private void populateUserControls(string path)
+ private void PopulateUserControls(string path)
{
DirectoryInfo di = new DirectoryInfo(path);
@@ -313,7 +305,7 @@ namespace umbraco.cms.presentation.developer
foreach (FileInfo uc in di.GetFiles("*.ascx"))
{
userControlList.Items.Add(
- new ListItem(SystemDirectories.Usercontrols +
+ new ListItem(SystemDirectories.Usercontrols +
uc.FullName.Substring(rootDir.Length).Replace(IOHelper.DirSepChar, '/')));
/*
uc.FullName.IndexOf(usercontrolsDir),
@@ -322,7 +314,7 @@ namespace umbraco.cms.presentation.developer
}
foreach (DirectoryInfo dir in di.GetDirectories())
- populateUserControls(dir.FullName);
+ PopulateUserControls(dir.FullName);
}
#region Web Form Designer generated code
@@ -418,15 +410,6 @@ namespace umbraco.cms.presentation.developer
///
protected global::umbraco.uicontrols.Pane Pane1_2;
- ///
- /// Table2 control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlTable Table2;
-
///
/// macroXslt control.
///
diff --git a/src/umbraco.cms/businesslogic/macro/IMacroEngine.cs b/src/umbraco.cms/businesslogic/macro/IMacroEngine.cs
index d7f025e87b..952ee11158 100644
--- a/src/umbraco.cms/businesslogic/macro/IMacroEngine.cs
+++ b/src/umbraco.cms/businesslogic/macro/IMacroEngine.cs
@@ -10,14 +10,11 @@ namespace umbraco.cms.businesslogic.macro
string Name { get; }
IEnumerable SupportedExtensions { get; }
IEnumerable SupportedUIExtensions { get; }
+
+ [Obsolete("This property is not used in the codebase")]
Dictionary SupportedProperties { get; }
+
bool Validate(string code, string tempFileName, INode currentPage, out string errorMessage);
string Execute(MacroModel macro, INode currentPage);
}
-
- public interface IMacroEngineResultStatus
- {
- bool Success { get; }
- Exception ResultException { get; }
- }
}
diff --git a/src/umbraco.cms/businesslogic/macro/Macro.cs b/src/umbraco.cms/businesslogic/macro/Macro.cs
index 8d024a32ab..8000045b6e 100644
--- a/src/umbraco.cms/businesslogic/macro/Macro.cs
+++ b/src/umbraco.cms/businesslogic/macro/Macro.cs
@@ -161,7 +161,7 @@ namespace umbraco.cms.businesslogic.macro
}
///
- /// The python file used to be executed
+ /// The razor macro file to be executed
///
/// Umbraco assumes that the python file is present in the "/python" folder
///
diff --git a/src/umbraco.cms/businesslogic/macro/MacroModel.cs b/src/umbraco.cms/businesslogic/macro/MacroModel.cs
index da394c3635..2801832c7f 100644
--- a/src/umbraco.cms/businesslogic/macro/MacroModel.cs
+++ b/src/umbraco.cms/businesslogic/macro/MacroModel.cs
@@ -80,43 +80,4 @@ namespace umbraco.cms.businesslogic.macro
MacroType = Macro.FindMacroType(Xslt, ScriptName, TypeName, TypeAssembly);
}
}
-
- [Serializable]
- public class MacroPropertyModel
- {
- public string Key { get; set; }
- public string Value { get; set; }
- public string Type { get; set; }
- public string CLRType { get; set; }
- public MacroPropertyModel()
- {
-
- }
-
- public MacroPropertyModel(string key, string value)
- {
- Key = key;
- Value = value;
- }
-
- public MacroPropertyModel(string key, string value, string type, string clrType)
- {
- Key = key;
- Value = value;
- Type = type;
- CLRType = clrType;
- }
- }
-
- public enum MacroTypes
- {
- XSLT = 1,
- CustomControl = 2,
- UserControl = 3,
- Unknown = 4,
- Python = 5,
- Script = 6
- }
-
-
}
diff --git a/src/umbraco.cms/umbraco.cms.csproj b/src/umbraco.cms/umbraco.cms.csproj
index 35d55b0343..40ee3db30d 100644
--- a/src/umbraco.cms/umbraco.cms.csproj
+++ b/src/umbraco.cms/umbraco.cms.csproj
@@ -224,8 +224,11 @@
+
+
+
|