Skip to content

Commit

Permalink
Initial Version
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvb committed May 22, 2013
1 parent dba62b1 commit 8a7c966
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
Binary file added Apollo.ModuleProperties.zip
Binary file not shown.
39 changes: 39 additions & 0 deletions Apollo_ModuleProperties.dnn
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="Apollo_ModuleProperties" type="SkinObject" version="0.0.1">
<friendlyName>Apollo ModuleProperties</friendlyName>
<description>This Container SkinObject can display attributes modules. First fully supported module is the HTML module</description>
<license src="License.htm" />
<releaseNotes />
<owner>
<name>Erik van Ballegoij</name>
<organization></organization>
<url><![CDATA[<a href="erikvanballegoij.com" target="_blank">erikvanballegoij.com</a>]]></url>
<email><![CDATA[<a href="mailto:[email protected]">[email protected]</a>]]></email>
</owner>
<dependencies>
<dependency type="CoreVersion">07.00.00</dependency>
</dependencies>
<components>
<component type="SkinObject">
<moduleControl>
<controlKey>MODULEPROPERTIES</controlKey>
<controlSrc>DesktopModules/Apollo/ModuleProperties/ModuleProperties.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
</moduleControl>
</component>
<component type="File">
<files>
<basePath>DesktopModules\Apollo\ModuleProperties</basePath>
<file>
<name>ModuleProperties.ascx</name>
</file>
<file>
<name>ModuleProperties.ascx.cs</name>
</file>
</files>
</component>
</components>
</package>
</packages>
</dotnetnuke>
25 changes: 25 additions & 0 deletions License.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div style="width: 650px; height: 400px; overflow: auto">
<pre>
The MIT License (MIT)

Copyright (c) 2013, Erik van Ballegoij

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:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

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.
</pre>
</div>
2 changes: 2 additions & 0 deletions ModuleProperties.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DesktopModules.Apollo.ModuleProperties.ModuleProperties" CodeFile="ModuleProperties.ascx.cs" %>
<asp:Label runat="server" ID="lblModuleProperties"></asp:Label>
68 changes: 68 additions & 0 deletions ModuleProperties.ascx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#region Copyright
//
// Copyright (c) 2013
// by Erik van Balleogij / [email protected]
//
// 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:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions
// of the Software.
//
// 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.
#endregion
#region Usings

using System;
using System.Web.UI;

using DotNetNuke.Common.Utilities;
using DotNetNuke.Professional.HtmlPro;
using DotNetNuke.UI.Skins;

#endregion

namespace DesktopModules.Apollo.ModuleProperties
{

public partial class ModuleProperties : SkinObjectBase
{
public string CssClass { get; set; }
public string FormatString { get; set; }
public string DateFormat { get; set; }

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

lblModuleProperties.CssClass = CssClass;
if (ModuleControl != null && ModuleControl.ModuleContext.ModuleId > Null.NullInteger)
{
switch (ModuleControl.ModuleContext.Configuration.DesktopModule.ModuleName)
{
case "DNN_HTML":
var workflowId = new HtmlTextController().GetWorkflow(ModuleControl.ModuleContext.ModuleId, ModuleControl.ModuleContext.TabId, ModuleControl.ModuleContext.PortalId).Value;

var htmlTextInfo = new HtmlTextController().GetTopHtmlText(ModuleControl.ModuleContext.ModuleId, true,
workflowId);
string formatString = string.IsNullOrEmpty(FormatString) ? "{0}" : FormatString;
string dateFormat = string.IsNullOrEmpty(DateFormat) ? "F" : DateFormat;

lblModuleProperties.Text = string.Format(formatString, htmlTextInfo.LastModifiedOnDate.ToString(dateFormat));
break;
default:
// do nothing
break;
}
}


}
}
}

0 comments on commit 8a7c966

Please sign in to comment.