WIP installer refactor, adds new skinning task type, ModifyPageProperty
[TFS Changeset #78647]
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using umbraco.interfaces.skinning;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using System.Web;
|
||||
|
||||
namespace umbraco.cms.businesslogic.skinning.tasks
|
||||
{
|
||||
public class ModifyPageProperty : TaskType
|
||||
{
|
||||
public string PropertyAlias { get; set; }
|
||||
public string ClientSideContainerID { get; set; }
|
||||
|
||||
public ModifyPageProperty()
|
||||
{
|
||||
this.Name = " Modify page property";
|
||||
this.Description = "Will modify a property on the current page";
|
||||
}
|
||||
|
||||
public override TaskExecutionDetails Execute(string Value)
|
||||
{
|
||||
TaskExecutionDetails d = new TaskExecutionDetails();
|
||||
|
||||
string id = HttpContext.Current.Items["pageID"].ToString();
|
||||
|
||||
Document doc = new Document(Convert.ToInt32(id));
|
||||
|
||||
if (doc.getProperty(PropertyAlias) != null)
|
||||
{
|
||||
d.OriginalValue = doc.getProperty(PropertyAlias).Value.ToString();
|
||||
|
||||
doc.getProperty(PropertyAlias).Value = Value;
|
||||
doc.Publish(new BusinessLogic.User(0));
|
||||
|
||||
d.NewValue = Value;
|
||||
d.TaskExecutionStatus = TaskExecutionStatus.Completed;
|
||||
}
|
||||
else
|
||||
d.TaskExecutionStatus = TaskExecutionStatus.Cancelled;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
public override string PreviewClientScript(string ControlClientId, string ClientSidePreviewEventType, string ClientSideGetValueScript)
|
||||
{
|
||||
|
||||
|
||||
return string.Format(
|
||||
@"jQuery('#{0}').bind('{3}', function() {{
|
||||
jQuery('#{1}').html({2});
|
||||
}});
|
||||
|
||||
//cancel support
|
||||
var init{4} = jQuery('#{1}').html();
|
||||
jQuery('#cancelSkinCustomization').click(function () {{
|
||||
jQuery('#{1}').html(init{4});
|
||||
}});
|
||||
",
|
||||
ControlClientId,
|
||||
ClientSideContainerID,
|
||||
ClientSideGetValueScript,
|
||||
ClientSidePreviewEventType,
|
||||
Guid.NewGuid().ToString().Replace("-", ""));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -230,6 +230,7 @@
|
||||
<Compile Include="businesslogic\skinning\Task.cs" />
|
||||
<Compile Include="businesslogic\skinning\tasks\AddStyleSheetToTemplate.cs" />
|
||||
<Compile Include="businesslogic\skinning\tasks\ModifyCss.cs" />
|
||||
<Compile Include="businesslogic\skinning\tasks\ModifyPageProperty.cs" />
|
||||
<Compile Include="businesslogic\skinning\tasks\ModifyTemplate.cs" />
|
||||
<Compile Include="businesslogic\skinning\TaskType.cs" />
|
||||
<Compile Include="businesslogic\Tags\Tag.cs" />
|
||||
|
||||
@@ -53,6 +53,8 @@ namespace umbraco.presentation.LiveEditing.Modules.SkinModule
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
library.RefreshContent();
|
||||
}
|
||||
|
||||
protected void LoadDependencies()
|
||||
|
||||
Reference in New Issue
Block a user