forked from sachatrauwaen/OpenContent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AlpacaFormBuilder.ascx.cs
69 lines (58 loc) · 2.87 KB
/
AlpacaFormBuilder.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#region Copyright
//
// Copyright (c) 2015-2016
// by Satrabel
//
#endregion
#region Using Statements
using System;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Common;
using Satrabel.OpenContent.Components;
using Satrabel.OpenContent.Components.Alpaca;
using DotNetNuke.Web.Client.ClientResourceManagement;
using DotNetNuke.Web.Client;
using System.Web.UI.WebControls;
#endregion
namespace Satrabel.OpenContent
{
public partial class AlpacaFormBuilder : PortalModuleBase
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
hlCancel.NavigateUrl = Globals.NavigateURL();
cmdSave.NavigateUrl = Globals.NavigateURL();
OpenContentSettings settings = this.OpenContentSettings();
AlpacaEngine alpaca = new AlpacaEngine(Page, ModuleContext, "" /*settings.Template.Uri().FolderPath*/, "builder");
alpaca.RegisterAll(false);
//string ItemId = Request.QueryString["id"];
//AlpacaContext = new AlpacaContext(PortalId, ModuleId, ItemId, ScopeWrapper.ClientID, null, cmdSave.ClientID, null, null);
ClientResourceManager.RegisterScript(Page, "~/DesktopModules/OpenContent/js/builder/formbuilder.js", FileOrder.Js.DefaultPriority);
ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/OpenContent/js/builder/formbuilder.css", FileOrder.Css.DefaultPriority);
//ClientResourceManager.RegisterScript(Page, "~/DesktopModules/OpenContent/js/bootstrap/js/bootstrap.min.js", FileOrder.Js.DefaultPriority);
//ClientResourceManager.RegisterStyleSheet(Page, "~/DesktopModules/OpenContent/js/bootstrap/css/bootstrap.min.css", FileOrder.Css.DefaultPriority);
if (OpenContentUtils.BuilderExist(settings.Template.ManifestFolderUri))
{
string title = string.IsNullOrEmpty(settings.Template.Manifest.Title) ? "Data" : settings.Template.Manifest.Title + " ";
ddlForms.Items.Add(new ListItem(title, ""));
}
if (OpenContentUtils.BuilderExist(settings.Template.ManifestFolderUri, settings.Template.Key.ShortKey))
{
ddlForms.Items.Add(new ListItem("Settings", settings.Template.Key.ShortKey));
}
if (settings.Template.Manifest.AdditionalDataExists())
{
foreach (var addData in settings.Template.Manifest.AdditionalData)
{
if (OpenContentUtils.BuilderExist(settings.Template.ManifestFolderUri, addData.Key))
{
string title = string.IsNullOrEmpty(addData.Value.Title) ? addData.Key : addData.Value.Title;
ddlForms.Items.Add(new ListItem(title, addData.Key));
}
}
}
}
//public AlpacaContext AlpacaContext { get; private set ; }
}
}