Gets macro editor working with new db changes and using new MacroService data layer
This commit is contained in:
@@ -8,7 +8,7 @@ using System.Web;
|
||||
using System.Web.UI.WebControls;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core;
|
||||
using umbraco.cms.businesslogic.macro;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Web.UI.Umbraco.Developer.Macros
|
||||
{
|
||||
@@ -29,16 +29,16 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros
|
||||
/// <param name="macro"> </param>
|
||||
/// <param name="macroAssemblyValue"></param>
|
||||
/// <param name="macroTypeValue"></param>
|
||||
protected override void PopulateFieldsOnLoad(Macro macro, string macroAssemblyValue, string macroTypeValue)
|
||||
protected override void PopulateFieldsOnLoad(IMacro macro, string macroAssemblyValue, string macroTypeValue)
|
||||
{
|
||||
base.PopulateFieldsOnLoad(macro, macroAssemblyValue, macroTypeValue);
|
||||
//check if the ScriptingFile property contains the MacroPartials path
|
||||
if (macro.ScriptingFile.IsNullOrWhiteSpace() == false &&
|
||||
(macro.ScriptingFile.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/")
|
||||
|| (Regex.IsMatch(macro.ScriptingFile, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled))))
|
||||
if (macro.ScriptPath.IsNullOrWhiteSpace() == false &&
|
||||
(macro.ScriptPath.StartsWith(SystemDirectories.MvcViews + "/MacroPartials/")
|
||||
|| (Regex.IsMatch(macro.ScriptPath, "~/App_Plugins/.+?/Views/MacroPartials", RegexOptions.Compiled))))
|
||||
{
|
||||
macroPython.Text = "";
|
||||
SelectedPartialView.Text = macro.ScriptingFile;
|
||||
SelectedPartialView.Text = macro.ScriptPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ namespace Umbraco.Web.UI.Umbraco.Developer.Macros
|
||||
/// <param name="macroCachePeriod"></param>
|
||||
/// <param name="macroAssemblyValue"></param>
|
||||
/// <param name="macroTypeValue"></param>
|
||||
protected override void SetMacroValuesFromPostBack(Macro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue)
|
||||
protected override void SetMacroValuesFromPostBack(IMacro macro, int macroCachePeriod, string macroAssemblyValue, string macroTypeValue)
|
||||
{
|
||||
base.SetMacroValuesFromPostBack(macro, macroCachePeriod, macroAssemblyValue, macroTypeValue);
|
||||
if (!SelectedPartialView.Text.IsNullOrWhiteSpace())
|
||||
{
|
||||
macro.ScriptingFile = SelectedPartialView.Text;
|
||||
macro.ScriptPath = SelectedPartialView.Text;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,13 +112,13 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<%=umbraco.ui.Text("general", "alias",this.getUser())%>
|
||||
<%=umbraco.ui.Text("general", "alias",UmbracoUser)%>
|
||||
</th>
|
||||
<th>
|
||||
<%=umbraco.ui.Text("general", "name",this.getUser())%>
|
||||
<%=umbraco.ui.Text("general", "name",UmbracoUser)%>
|
||||
</th>
|
||||
<th>
|
||||
<%=umbraco.ui.Text("general", "type",this.getUser())%>
|
||||
<%=umbraco.ui.Text("general", "type",UmbracoUser)%>
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -128,18 +128,18 @@
|
||||
<ItemTemplate>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="hidden" id="macroPropertyID" runat="server" value='<%#DataBinder.Eval(Container.DataItem, "id")%>'
|
||||
<input type="hidden" id="macroPropertyID" runat="server" value='<%#Eval("Id")%>'
|
||||
name="macroPropertyID" />
|
||||
<asp:TextBox runat="server" ID="macroPropertyAlias" Text='<%#DataBinder.Eval(Container.DataItem, "Alias")%>' />
|
||||
<asp:TextBox runat="server" ID="macroPropertyAlias" Text='<%#Eval("Alias")%>' />
|
||||
</td>
|
||||
<td>
|
||||
<asp:TextBox runat="server" ID="macroPropertyName" Text='<%#DataBinder.Eval(Container.DataItem, "Name")%>' />
|
||||
<asp:TextBox runat="server" ID="macroPropertyName" Text='<%#Eval("Name")%>' />
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList OnPreRender="AddChooseList" runat="server" ID="macroPropertyType"
|
||||
DataTextFormatString="" DataTextField='Name' DataValueField="Alias"
|
||||
DataSource='<%# GetMacroParameterEditors()%>'
|
||||
SelectedValue='<%# Eval("Alias") %>'>
|
||||
SelectedValue='<%# Eval("EditorAlias") %>'>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td>
|
||||
@@ -157,7 +157,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<asp:DropDownList OnPreRender="AddChooseList" runat="server" ID="macroPropertyTypeNew"
|
||||
DataTextField="macroPropertyTypeAlias" DataValueField="id" DataSource='<%# GetMacroPropertyTypes()%>'>
|
||||
DataTextField="Name"
|
||||
DataValueField="Alias"
|
||||
DataSource='<%# GetMacroParameterEditors()%>'>
|
||||
</asp:DropDownList>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user