Skip to content

Commit

Permalink
Main files
Browse files Browse the repository at this point in the history
  • Loading branch information
dnnconsulting committed Jun 19, 2015
1 parent 6529b33 commit ecf0e6d
Show file tree
Hide file tree
Showing 9 changed files with 391 additions and 2 deletions.
129 changes: 129 additions & 0 deletions App_LocalResources/CookieConsent.ascx.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="lblDismiss.Text" xml:space="preserve">
<value>Got it!</value>
</data>
<data name="lblLearnMore.Text" xml:space="preserve">
<value>More info</value>
</data>
<data name="lblMessage.Text" xml:space="preserve">
<value>This website uses cookies to ensure you get the best experience on our website</value>
</data>
</root>
2 changes: 2 additions & 0 deletions CookieConsent.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="CookieConsent.ascx.vb" Inherits="DnnC.Modules.CookieConsent.CookieConsent" %>
<asp:Literal ID="ltlScript" runat="server"></asp:Literal>
24 changes: 24 additions & 0 deletions CookieConsent.ascx.designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

101 changes: 101 additions & 0 deletions CookieConsent.ascx.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
' ------------------ Copyright (c) notice DnnConsulting ------------------
' Copyright (c) 2015 DnnConsulting. www.DnnConsulting.nl. BSD License.
' Author: G. M. Barlow
' ------------------------------------------------------------------------
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
' OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
' THE SOFTWARE.
' ------------------------------------------------------------------------
' This copyright notice may NOT be removed, obscured or modified without written
' consent from the author.
' ------------------------- End copyright notice -------------------------

Imports DotNetNuke
Imports DotNetNuke.Entities.Modules.Actions
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Web.Client.ClientResourceManagement

Public Class CookieConsent
Inherits DotNetNuke.UI.Skins.SkinObjectBase

#Region " Public Members"
Const MyFileName As String = "CookieConsent.ascx"
Private _cookiePolicyLink As String = "null"
Private _cookieTheme As String = "dark-top" ' dark-top, dark-floating, dark-bottom, light-floating, light-top, light-bottom


#End Region

#Region " Private Members"

Public Property CookiePolicyLink() As String
Get
Return LCase(_cookiePolicyLink)
End Get
Set(ByVal Value As String)
_cookiePolicyLink = LCase(Value)
End Set
End Property

Public Property CookieTheme() As String
Get
Return LCase(_cookieTheme)
End Get
Set(ByVal Value As String)
_cookieTheme = LCase(Value)
End Set
End Property

#End Region

#Region " Event Methods"

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Try
If Not Page.ClientScript.IsClientScriptBlockRegistered("CookieConsent") Then
Dim strCookieScript As String = BuildCookieConsentScript()
ltlScript.Text = strCookieScript
ClientResourceManager.RegisterScript(Parent.Page, "//s3.amazonaws.com/cc.silktide.com/cookieconsent.1.0.2.min.js")

End If
Catch exc As Exception
Exceptions.ProcessModuleLoadException(Me, exc)
End Try

End Sub

#End Region

#Region " Private Methods"

Private Function BuildCookieConsentScript() As String
Dim jQueryStr As StringBuilder = New StringBuilder
jQueryStr.AppendLine("<script type=""text/javascript"">")
jQueryStr.AppendLine(" window.cookieconsent_options = {")
jQueryStr.AppendLine(" message: """ & Localization.GetString("lblMessage", Localization.GetResourceFile(Me, MyFileName)) & """,")
jQueryStr.AppendLine(" dismiss: """ & Localization.GetString("lblDismiss", Localization.GetResourceFile(Me, MyFileName)) & """,")
jQueryStr.AppendLine(" learnMore: """ & Localization.GetString("lblLearnMore", Localization.GetResourceFile(Me, MyFileName)) & """,")
If _cookiePolicyLink = "null" Then
jQueryStr.AppendLine(" link: null,")
Else : jQueryStr.AppendLine(" link: """ & _cookiePolicyLink & """,")
End If
jQueryStr.AppendLine(" theme: """ & _cookieTheme & """")
jQueryStr.AppendLine(" };")
jQueryStr.AppendLine("</script>")

Return jQueryStr.ToString
End Function

#End Region





End Class
60 changes: 60 additions & 0 deletions DnnC_CookieConsent.dnn
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DnnC_CookieConsent" type="SkinObject" version="02.00.00">
<friendlyName>DnnC_CookieConsent SkinObject</friendlyName>
<description>DnnC DnnC CookieConsent Skin object for Dnn</description>
<iconFile/>
<owner>
<name>G Barlow</name>
<organization>DnnConsulting Site Solutions</organization>
<url>http://www.dnnconsulting.nl</url>
<email>[email protected]</email>
</owner>
<azureCompatible>true</azureCompatible>
<license src="License.txt"></license>
<releaseNotes src="ReleaseNotes.txt"></releaseNotes>
<dependencies>
<dependency type="CoreVersion">06.02.00</dependency>
</dependencies>
<components>
<component type="SkinObject">
<moduleControl>
<controlKey>COOKIECONSENT</controlKey>
<controlSrc>DesktopModules/DnnC_CookieConsent/CookieConsent.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
</moduleControl>
</component>
<component type="File">
<files>
<basePath>DesktopModules/DnnC_CookieConsent</basePath>
<file>
<name>CookieConsent.ascx</name>
</file>
<file>
<name>license.txt</name>
</file>
<file>
<name>releasenotes.txt</name>
</file>
</files>
</component>
<component type="ResourceFile">
<resourceFiles>
<basePath>DesktopModules/DnnC_CookieConsent</basePath>
<resourceFile>
<name>Resources.zip</name>
</resourceFile>
</resourceFiles>
</component>
<component type="Assembly">
<assemblies>
<assembly>
<name>DnnC.Modules.CookieConsent.dll</name>
<path>bin</path>
</assembly>
</assemblies>
</component>
</components>
</package>
</packages>
</dotnetnuke>
27 changes: 27 additions & 0 deletions DnnC_CookieConsent.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Web
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DnnC_CookieConsent", "DnnC_CookieConsent.vbproj", "{279C5C96-5031-407A-919C-EF50FD06454D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build", ".build", "{BE389F51-A1EF-4994-8C12-2A0D4F99D449}"
ProjectSection(SolutionItems) = preProject
Build.proj = Build.proj
.build\MSBuild.Community.Tasks.dll = .build\MSBuild.Community.Tasks.dll
.build\MSBuild.Community.Tasks.targets = .build\MSBuild.Community.Tasks.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{279C5C96-5031-407A-919C-EF50FD06454D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{279C5C96-5031-407A-919C-EF50FD06454D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{279C5C96-5031-407A-919C-EF50FD06454D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{279C5C96-5031-407A-919C-EF50FD06454D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
28 changes: 28 additions & 0 deletions License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<div class="License">
<h3>License</h3>
<p class="Owner">
DnnConsulting <a href=http://www.dnnconsulting.nl>http://www.dnnconsulting.nl</a></br>
Author : G. M. barlow</br>
Copyright (c) 2015</br>
by G M barlow DnnConsulting.nl</br>
</p>
<p>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
</p>
<p>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</p>
<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</p>
</div>
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DnnC CookieConsent
# DnnC CookieConsent

## What is DnnC CookieConsent
DnnC CookieConsent is a SkinObject and is created using the “Cookie Consent” plugin from silkTide and adapted to a skinObject for Dnn CMS Platform.
Expand Down Expand Up @@ -65,4 +65,4 @@ The builtin themes are as follows:
- dark-bottom
- light-floating
- light-top
- light-bottom
- light-bottom
Loading

0 comments on commit ecf0e6d

Please sign in to comment.