Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgraded the CMS in the core solution to match the current CMS version #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Website/DesktopModules/Admin/ModuleCreator/Templates/01.00.00.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
SQL Database Install Script
for _MODULE_ Module
Copyright (c) _YEAR_
by _OWNER_
*/

CREATE TABLE [dbo]._OWNER___MODULE_s
(
_MODULE_ID int IDENTITY(1,1) NOT NULL,
ModuleID int NOT NULL,
Title nvarchar(50) NOT NULL,
Description nvarchar(max) NOT NULL,
IsActive [bit] NOT NULL,
CreatedOnDate [datetime] NOT NULL,
CreatedByUserID [int] NOT NULL,
CONSTRAINT [PK__OWNER___MODULE_s]
PRIMARY KEY CLUSTERED ( [_MODULE_ID] ASC )
)


GO

ALTER TABLE [dbo]._OWNER___MODULE_s
ADD CONSTRAINT
FK__OWNER___MODULE_s_Modules FOREIGN KEY
(
ModuleID
) REFERENCES dbo.Modules
(
ModuleID
) ON UPDATE NO ACTION
ON DELETE CASCADE
NOT FOR REPLICATION
GO
Empty file.
20 changes: 20 additions & 0 deletions Website/DesktopModules/Admin/ModuleCreator/Templates/Settings.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<%@ Control Language="VB" AutoEventWireup="false" Inherits="_OWNER_._MODULE_.Settings" CodeFile="Settings.ascx.vb" %>

<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>

<div class="dnnForm dnnSettings dnnClear" id="dnnSettings">

<fieldset>

<div class="dnnFormItem">

<dnn:label id="plField" runat="server" text="Field" helptext="Enter a value" controlname="txtField" />

<asp:textbox id="txtField" runat="server" maxlength="255" />

</div>

</fieldset>

</div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="plField.Text" xml:space="preserve">
<value>Field:</value>
</data>
<data name="plField.Help" xml:space="preserve">
<value>Field level help.</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#Region "Copyright"

'
' Copyright (c) _YEAR_
' by _OWNER_
'

#End Region

#Region "Using Statements"

Imports System
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Exceptions

#End Region

Namespace _OWNER_._MODULE_

Partial Public Class Settings
Inherits ModuleSettingsBase

#Region "Base Method Implementations"

Public Overrides Sub LoadSettings()
Try
If Not Page.IsPostBack Then
txtField.Text = DirectCast(TabModuleSettings("field"), String)
End If
Catch exc As Exception
' Module failed to load
Exceptions.ProcessModuleLoadException(Me, exc)
End Try
End Sub

Public Overrides Sub UpdateSettings()
Try
ModuleController.Instance.UpdateTabModuleSetting(TabModuleId, "field", txtField.Text)
Catch exc As Exception
' Module failed to load
Exceptions.ProcessModuleLoadException(Me, exc)
End Try
End Sub

#End Region

End Class

End Namespace
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#Region "Copyright"

'
' Copyright (c) _YEAR_
' by _OWNER_
'

#End Region

#Region "Using Statements"

Imports System
Imports DotNetNuke.Entities.Modules

#End Region

Namespace _OWNER_._MODULE_

Partial Public Class _CONTROL_
Inherits PortalModuleBase

#Region "Event Handlers"

Protected Overrides Sub OnInit(e As EventArgs)
MyBase.OnInit(e)
End Sub

Protected Overrides Sub OnLoad(e As EventArgs)
MyBase.OnLoad(e)

If Not Page.IsPostBack Then
txtField.Text = DirectCast(Settings("field"), String)
End If
End Sub

Protected Sub cmdSave_Click(sender As Object, e As EventArgs) Handles cmdSave.Click
ModuleController.Instance.UpdateModuleSetting(ModuleId, "field", txtField.Text)
Skins.Skin.AddModuleMessage(Me, "Update Successful", Skins.Controls.ModuleMessage.ModuleMessageType.GreenSuccess)
End Sub

Protected Sub cmdCancel_Click(sender As Object, e As EventArgs) Handles cmdCancel.Click

End Sub

#End Region

End Class

End Namespace
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@using DotNetNuke.Common;

@*Copyright (c) _YEAR_ by _OWNER_ *@

<div class="dnnForm dnnEdit dnnClear" id="dnnEdit">

<fieldset>

<div class="dnnFormItem">

<div><label class="dnnLabel" id="lblField" for="txtField">Field:</label></div>
<input type="text" name="txtField" maxlength="255" value="" />

</div>

</fieldset>

<ul class="dnnActions dnnClear">
<li><a id="cmdSave" class="dnnPrimaryAction" href="" title="Save">Save</a></li>
<li><a id="cmdCancel" class="dnnSecondaryAction" href="" title="Cancel">Cancel</a></li>
</ul>
</div>


Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@Imports DotNetNuke.Common

@*Copyright (c) _YEAR_ by _OWNER_ *@

<div class="dnnForm dnnEdit dnnClear" id="dnnEdit">

<fieldset>

<div class="dnnFormItem">

<div><label id="lblField" for="txtField">Field:</label></div>
<input type="text" name="txtField" maxlength="255" value="" />

</div>

</fieldset>

<ul class="dnnActions dnnClear">
<li><a id="cmdSave" class="dnnPrimaryAction" href="" title="Save">Save</a></li>
<li><a id="cmdCancel" class="dnnSecondaryAction" href="" title="Cancel">Cancel</a></li>
</ul>
</div>


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Template Name : XML Document
Compatible With: DNN 6.x, 7.x

An XML file

template.xml

(Include any special instructions for this Module Template in this area)
56 changes: 56 additions & 0 deletions Website/DesktopModules/Admin/ModuleCreator/Templates/template.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// *NOTE: Please manage your content in the associated _CONTROL_.html file in this folder
//

<%@ Control Language="C#" ClassName="_OWNER_._MODULE_._CONTROL_" Inherits="DotNetNuke.Entities.Modules.PortalModuleBase" %>

<%@ Import Namespace="System.IO" %>

<script runat="server">


#region Copyright

//
// Copyright (c) _YEAR_
// by _OWNER_
//

#endregion

#region Event Handlers

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

//Only required if the HTML content uses jQuery or the Services Framework
jQuery.RequestRegistration();
ServicesFramework.Instance.RequestAjaxScriptSupport();
}

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);

if (!Page.IsPostBack)
{
//Load the HTML file
var path = Server.MapPath(ModulePath) + "_CONTROL_.html";
if (File.Exists(path))
{
var content = Null.NullString;
TextReader tr = new StreamReader(path);
content = tr.ReadToEnd();
tr.Close();
ctlContent.Text = content;
}
}
}

#endregion

</script>


<asp:Localize id="ctlContent" runat="server" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<data name="plField.Text" xml:space="preserve">
<value>Field:</value>
</data>
<data name="plField.Help" xml:space="preserve">
<value>Field level help.</value>
</data>
</root>
20 changes: 20 additions & 0 deletions Website/DesktopModules/Admin/ModuleCreator/Templates/template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div id="content">
Just a placeholder
</div>
<input type="button" value="Go" id="goButton"/>
<script type="text/javascript">
$(document).ready(function() {
var sf = $.ServicesFramework(-1);

$("#goButton").click(function() {
$.ajax({
type: "GET",
url: sf.getServiceRoot('_OWNER_._MODULE_') + "_MODULE_API/MyResponse"
}).done(function(data) {
if (data != undefined && data != null) {
$("#content").text(data);
}
});
});
});
</script>
Empty file.
20 changes: 20 additions & 0 deletions Website/DesktopModules/Admin/ModuleCreator/Templates/template.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#Region "Copyright"

'
' Copyright (c) _YEAR_
' by _OWNER_
'

#End Region

#Region "Using Statements"

#End Region

Namespace _OWNER_._MODULE_

Public Class _MODULE_Controller

End Class

End Namespace
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#Region "Copyright"

'
' Copyright (c) _YEAR_
' by _OWNER_
'

#End Region

#Region "Using Statements"

Imports System
Imports System.Net
Imports System.Net.Http
Imports System.Web.Http
Imports DotNetNuke.Web.Api

#End Region

Namespace _OWNER_._MODULE_
<AllowAnonymous> _
Public Class _MODULE_Controller
Inherits DnnApiController
<HttpGet> _
Public Function MyResponse() As HttpResponseMessage
Return Request.CreateResponse(HttpStatusCode.OK, "Hello World!")
End Function
End Class
End Namespace
Loading