Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (30 sloc) 1 KB
using EPiServer;
using EPiServer.Core;
using EPiServer.Forms.Implementation.Elements;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
namespace Toders.Forms.Business.Forms
{
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class AllowAnonymousSubmissionDefault : IInitializableModule
{
public void Initialize(InitializationEngine context)
{
ServiceLocator.Current.GetInstance<IContentEvents>().CreatingContent += SetAllowAnonymousSubmission;
}
private void SetAllowAnonymousSubmission(object sender, ContentEventArgs e)
{
var formContainerBlock = e.Content as FormContainerBlock;
if (formContainerBlock == null)
{
return;
}
formContainerBlock.AllowAnonymousSubmission = true;
}
public void Uninitialize(InitializationEngine context)
{
}
}
}