modules = ModuleController.Instance.GetTabModulesByModule(moduleID);
+
+ foreach (ModuleInfo module in modules)
+ {
+ TabInfo tab = TabController.Instance.GetTab(module.TabID, portalID);
+ if (url.StartsWith(tab.FullUrl))
+ {
+ getTabIDFromUrl = tab.TabID;
+ break;
+ }
+ }
+ }
+ return getTabIDFromUrl;
+ }
+
+ public static bool IsProfilePage(int tabID, int userTabID, int portalID)
+ {
+ TabInfo tab = TabController.Instance.GetTab(tabID, portalID);
+ bool isProfilePage = (tab.TabID == userTabID);
+
+ while (!(isProfilePage))
+ {
+ if (tab.ParentId <= 0)
+ break;
+ tab = TabController.Instance.GetTab(tab.ParentId, tab.PortalID);
+ isProfilePage = (tab.TabID == userTabID);
+ }
+ return isProfilePage;
+ }
+
+ public static bool IsAdminPage(int tabID, int adminTabID, int portalID)
+ {
+ TabInfo tab = TabController.Instance.GetTab(tabID, portalID);
+ bool isAdminPage = (tab.TabID == adminTabID);
+
+ while (!(isAdminPage))
+ {
+ if (tab.ParentId <= 0)
+ break;
+ tab = TabController.Instance.GetTab(tab.ParentId, tab.PortalID);
+ isAdminPage = (tab.TabID == adminTabID);
+ }
+ return isAdminPage;
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/Documentation/DNN-Connect-SiteNews.License.txt b/Documentation/DNN-Connect-SiteNews.License.txt
new file mode 100644
index 0000000..6d3ca5a
--- /dev/null
+++ b/Documentation/DNN-Connect-SiteNews.License.txt
@@ -0,0 +1,24 @@
+
+
License
+
+ © 2017 dnnWerk.at ( dnnwerk.at )
+ Written by Michael Tobisch
+
+
+ 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.
+
+
diff --git a/Documentation/DNN-Connect-SiteNews.ReleaseNotes.txt b/Documentation/DNN-Connect-SiteNews.ReleaseNotes.txt
new file mode 100644
index 0000000..fe28914
--- /dev/null
+++ b/Documentation/DNN-Connect-SiteNews.ReleaseNotes.txt
@@ -0,0 +1,25 @@
+DNN-Connect SiteNews
+
+ dnnWerk.at for DNN-Connect
+ noreply@dnnwerk.at
+ dnnwerk.at
+ dnn-connect.org
+
+
+
+
About DNN-Connect SiteNews
+
+ Module to display new or changed content from the site.
+
+
Requirements:
+
+ - DNN Platform 07.04.02 or later
+
+
Version History:
+
+ -
+ Version 01.00.00
+ Initial Release
+
+
+
diff --git a/Documentation/License.de-AT.txt b/Documentation/License.de-AT.txt
new file mode 100644
index 0000000..e1ce53f
--- /dev/null
+++ b/Documentation/License.de-AT.txt
@@ -0,0 +1,23 @@
+
+
License
+
+ © 2017 helferlein.com ( helferlein.com )
+ Autor: Michael Tobisch
+
+
+ Hiermit wird unentgeltlich jeder Person, die eine Kopie der Software und der zugehörigen Dokumentationen
+ (die "Software") erhält, die Erlaubnis erteilt, sie uneingeschränkt zu benutzen, inklusive und ohne Ausnahme
+ dem Recht, sie zu verwenden, kopieren, ändern, fusionieren, verlegen, verbreiten, unterlizenzieren und/oder
+ zu verkaufen, und Personen, die diese Software erhalten, diese Rechte zu geben, unter den folgenden Bedingungen:
+
+
+ Der obige Urheberrechtsvermerk und dieser Erlaubnisvermerk sind in allen Kopien oder Teilkopien der Software beizulegen.
+
+
+ DIE SOFTWARE WIRD OHNE JEDE AUSDRÜCKLICHE ODER IMPLIZIERTE GARANTIE BEREITGESTELLT, EINSCHLIESSLICH DER GARANTIE ZUR
+ BENUTZUNG FÜR DEN VORGESEHENEN ODER EINEM BESTIMMTEN ZWECK SOWIE JEGLICHER RECHTSVERLETZUNG, JEDOCH NICHT DARAUF
+ BESCHRÄNKT. IN KEINEM FALL SIND DIE AUTOREN ODER COPYRIGHTINHABER FÜR JEGLICHEN SCHADEN ODER SONSTIGE ANSPRÜCHE
+ HAFTBAR ZU MACHEN, OB INFOLGE DER ERFÜLLUNG EINES VERTRAGES, EINES DELIKTES ODER ANDERS IM ZUSAMMENHANG MIT DER
+ SOFTWARE ODER SONSTIGER VERWENDUNG DER SOFTWARE ENTSTANDEN.
+
+
diff --git a/Documentation/ReleaseNotes.de-AT.txt b/Documentation/ReleaseNotes.de-AT.txt
new file mode 100644
index 0000000..c27fda5
--- /dev/null
+++ b/Documentation/ReleaseNotes.de-AT.txt
@@ -0,0 +1,25 @@
+DNN-Connect SiteNews Sprachpaket Deutsch (Österreich)
+
+ helferlein.com for DNN-Connect
+ mt@helferlein.com
+ helferlein.com
+ dnn-connect.org
+
+
+
+
Über DNN-Connect SiteNews
+
+ Deutsch (Österreichisches) Sprachpaket für DNN-Connect SiteNews.
+
+
Systemvoraussetzungen:
+
+ - DNN Platform 07.04.02 oder höher
+
+
Versionsgeschichte:
+
+ -
+ Version 01.00.00
+ Ursprüngliche Veröffentlichung
+
+
+
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3689bb1
--- /dev/null
+++ b/Properties/AssemblyInfo.cs
@@ -0,0 +1,34 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("DNN-Connect SiteNews")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Dnn-Connect")]
+[assembly: AssemblyProduct("SiteNews")]
+[assembly: AssemblyCopyright("Copyright © 2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5ef01dd5-84a1-49f3-9232-067440288455")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("01.00.00")]
+[assembly: AssemblyFileVersion("01.00.00")]
diff --git a/Settings.ascx b/Settings.ascx
new file mode 100644
index 0000000..5ad9809
--- /dev/null
+++ b/Settings.ascx
@@ -0,0 +1,108 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Settings.ascx.cs" Inherits="Connect.Modules.SiteNews.Settings" %>
+<%@ Register TagName="label" TagPrefix="dnn" Src="~/controls/labelcontrol.ascx" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Settings.ascx.cs b/Settings.ascx.cs
new file mode 100644
index 0000000..bba355e
--- /dev/null
+++ b/Settings.ascx.cs
@@ -0,0 +1,282 @@
+/*
+DNN-Connect - http://dnn-connect.org
+Copyright (c) 2017
+by DNN-Connect
+Written by Michael Tobisch
+
+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.
+*/
+
+using DotNetNuke.Entities.Modules;
+using DotNetNuke.Services.Exceptions;
+using DotNetNuke.Services.Localization;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+
+namespace Connect.Modules.SiteNews
+{
+ public partial class Settings : ModuleSettingsBase
+ {
+ private ModuleController _controller = null;
+
+ protected ModuleController Controller
+ {
+ get
+ {
+ if (_controller == null)
+ _controller = new ModuleController();
+ return _controller;
+ }
+ }
+
+ protected int NumberOfDays
+ {
+ get
+ {
+ object o = Settings["NumberOfDays"];
+ int numberOfDays;
+ try
+ {
+ if (!(Int32.TryParse(o.ToString(), out numberOfDays)))
+ numberOfDays = 5;
+ }
+ catch (Exception)
+ {
+ numberOfDays = 5;
+ }
+ return numberOfDays;
+ }
+ set
+ {
+ UpdateIntegerSetting("NumberOfDays", (value == 5 ? (int?)null : value));
+ }
+ }
+
+ protected string SearchTypes
+ {
+ get
+ {
+ object o = Settings["SearchTypes"];
+ if (o == null)
+ return SiteNewsHelpers.AllSearchTypes.Select(x => x.SearchTypeId.ToString()).Aggregate((current, next) => current + "," + next);
+ else
+ return o.ToString();
+ }
+ set
+ {
+ UpdateTextSetting("SearchTypes", value);
+ }
+ }
+
+ protected int NumberOfResults
+ {
+ get
+ {
+ object o = Settings["NumberOfResults"];
+ int numberOfResults;
+ try
+ {
+ if (!(Int32.TryParse(o.ToString(), out numberOfResults)))
+ numberOfResults = 25;
+ }
+ catch (Exception)
+ {
+ numberOfResults = 25;
+ }
+ return numberOfResults;
+ }
+ set
+ {
+ UpdateIntegerSetting("NumberOfResults", (value == 25 ? (int?)null : value));
+ }
+ }
+
+ protected int PageSize
+ {
+ get
+ {
+ int pageSize = 5;
+ object o = Settings["PageSize"];
+ if (o != null)
+ pageSize = Convert.ToInt32(o);
+ return pageSize;
+ }
+ set
+ {
+ UpdateIntegerSetting("PageSize", (value == 5 ? (int?)null : value));
+ }
+ }
+
+ protected bool IncludeSearchType
+ {
+ get { return Convert.ToBoolean(Settings["IncludeSearchType"]); }
+ set { UpdateBooleanSetting("IncludeSearchType", value); }
+ }
+
+ protected bool IncludeInfo
+ {
+ get { return Convert.ToBoolean(Settings["IncludeInfo"]); }
+ set { UpdateBooleanSetting("IncludeInfo", value); }
+ }
+
+ protected bool IncludeDescription
+ {
+ get { return Convert.ToBoolean(Settings["IncludeDescription"]); }
+ set { UpdateBooleanSetting("IncludeDescription", value); }
+ }
+
+ protected bool IncludeBody
+ {
+ get { return Convert.ToBoolean(Settings["IncludeBody"]); }
+ set { UpdateBooleanSetting("IncludeBody", value); }
+ }
+
+ protected bool IncludeAuthor
+ {
+ get { return Convert.ToBoolean(Settings["IncludeAuthor"]); }
+ set { UpdateBooleanSetting("IncludeAuthor", value); }
+ }
+
+ protected bool IncludeSnippet
+ {
+ get { return Convert.ToBoolean(Settings["IncludeSnippet"]); }
+ set { UpdateBooleanSetting("IncludeSnippet", value); }
+ }
+
+ public override void LoadSettings()
+ {
+ try
+ {
+ if (!(Page.IsPostBack))
+ {
+ NumberOfDaysRadioButtons.SelectedValue = NumberOfDays.ToString();
+ NumberOfResultsRadioButtons.SelectedValue = NumberOfResults.ToString();
+ PageSizeRadioButtons.SelectedValue = PageSize.ToString();
+ IncludeSearchTypeCheckBox.Checked = IncludeSearchType;
+ IncludeInfoCheckBox.Checked = IncludeInfo;
+ IncludeDescriptionCheckBox.Checked = IncludeDescription;
+ IncludeBodyCheckBox.Checked = IncludeBody;
+ IncludeAuthorCheckBox.Checked = IncludeAuthor;
+ IncludeSnippetCheckBox.Checked = IncludeSnippet;
+ }
+ }
+ catch (Exception exc) //Module failed to load
+ {
+ Exceptions.ProcessModuleLoadException(this, exc);
+ }
+ }
+
+ public override void UpdateSettings()
+ {
+ try
+ {
+ NumberOfDays = Convert.ToInt32(NumberOfDaysRadioButtons.SelectedValue);
+ List selectedItems = new List();
+ foreach (ListItem li in SearchTypeCheckBoxes.Items)
+ {
+ if (li.Selected) selectedItems.Add(li.Value);
+ }
+ SearchTypes = selectedItems.Aggregate((current, next) => current + "," + next);
+ NumberOfResults = Convert.ToInt32(NumberOfResultsRadioButtons.SelectedValue);
+ PageSize = Convert.ToInt32(PageSizeRadioButtons.SelectedValue);
+ IncludeSearchType = IncludeSearchTypeCheckBox.Checked;
+ IncludeInfo = IncludeInfoCheckBox.Checked;
+ IncludeDescription = IncludeDescriptionCheckBox.Checked;
+ IncludeBody = IncludeBodyCheckBox.Checked;
+ IncludeAuthor = IncludeAuthorCheckBox.Checked;
+ IncludeSnippet = IncludeSnippetCheckBox.Checked;
+ }
+ catch (Exception ex) //Module failed to load
+ {
+ Exceptions.ProcessModuleLoadException(this, ex);
+ }
+ }
+
+ protected void SearchTypeCheckBoxes_Load(object sender, EventArgs e)
+ {
+ if (!(Page.IsPostBack))
+ {
+ CheckBoxList searchTypeCheckBoxes = (CheckBoxList)sender;
+ searchTypeCheckBoxes.DataSource = SiteNewsHelpers.AllSearchTypes;
+ searchTypeCheckBoxes.DataTextField = "SearchTypeName";
+ searchTypeCheckBoxes.DataValueField = "SearchTypeId";
+ searchTypeCheckBoxes.DataBind();
+
+ foreach (ListItem li in searchTypeCheckBoxes.Items)
+ {
+ string caption = Localization.GetString(string.Format("Crawler_{0}.Text", li.Text), SiteNewsHelpers.SearchableModulesResourceFile);
+ if (!(string.IsNullOrEmpty(caption)))
+ li.Text = caption;
+ }
+
+ foreach (string s in SearchTypes.Split(new char[] { ',' }))
+ SearchTypeCheckBoxes.Items.FindByValue(s).Selected = true;
+ }
+ }
+
+ private void UpdateBooleanSetting(string setting, bool settingValue)
+ {
+ if (Settings[setting] == null)
+ {
+ if (settingValue)
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue.ToString());
+ }
+ else
+ {
+ if (settingValue)
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue.ToString());
+ else
+ Controller.DeleteModuleSetting(ModuleId, setting);
+ }
+ }
+
+ private void UpdateTextSetting(string setting, string settingValue)
+ {
+ if (Settings[setting] == null)
+ {
+ if (!(string.IsNullOrEmpty(settingValue)))
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue);
+ }
+ else
+ {
+ if (!(string.IsNullOrEmpty(settingValue)))
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue);
+ else
+ Controller.DeleteModuleSetting(ModuleId, setting);
+ }
+ }
+
+ private void UpdateIntegerSetting(string setting, int? settingValue)
+ {
+ if (Settings[setting] == null)
+ {
+ if (settingValue != null)
+ {
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue.ToString());
+ }
+ }
+ else
+ {
+ if (settingValue != null)
+ Controller.UpdateModuleSetting(ModuleId, setting, settingValue.ToString());
+ else
+ Controller.DeleteModuleSetting(ModuleId, setting);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Settings.ascx.designer.cs b/Settings.ascx.designer.cs
new file mode 100644
index 0000000..8d39cae
--- /dev/null
+++ b/Settings.ascx.designer.cs
@@ -0,0 +1,204 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Connect.Modules.SiteNews {
+
+
+ public partial class Settings {
+
+ ///
+ /// NumberOfDaysLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl NumberOfDaysLabel;
+
+ ///
+ /// NumberOfDaysRadioButtons control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RadioButtonList NumberOfDaysRadioButtons;
+
+ ///
+ /// SearchTypesLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl SearchTypesLabel;
+
+ ///
+ /// SearchTypeCheckBoxes control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBoxList SearchTypeCheckBoxes;
+
+ ///
+ /// NumberOfResultsLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl NumberOfResultsLabel;
+
+ ///
+ /// NumberOfResultsRadioButtons control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RadioButtonList NumberOfResultsRadioButtons;
+
+ ///
+ /// PageSizeLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl PageSizeLabel;
+
+ ///
+ /// PageSizeRadioButtons control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.RadioButtonList PageSizeRadioButtons;
+
+ ///
+ /// RenderingLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label RenderingLabel;
+
+ ///
+ /// IncludeSearchTypeLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeSearchTypeLabel;
+
+ ///
+ /// IncludeSearchTypeCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeSearchTypeCheckBox;
+
+ ///
+ /// IncludeInfoLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeInfoLabel;
+
+ ///
+ /// IncludeInfoCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeInfoCheckBox;
+
+ ///
+ /// IncludeDescriptionLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeDescriptionLabel;
+
+ ///
+ /// IncludeDescriptionCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeDescriptionCheckBox;
+
+ ///
+ /// IncludeBodyLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeBodyLabel;
+
+ ///
+ /// IncludeBodyCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeBodyCheckBox;
+
+ ///
+ /// IncludeAuthorLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeAuthorLabel;
+
+ ///
+ /// IncludeAuthorCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeAuthorCheckBox;
+
+ ///
+ /// IncludeSnippetLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::DotNetNuke.UI.UserControls.LabelControl IncludeSnippetLabel;
+
+ ///
+ /// IncludeSnippetCheckBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox IncludeSnippetCheckBox;
+ }
+}
diff --git a/SiteNews.csproj b/SiteNews.csproj
new file mode 100644
index 0000000..f75d46e
--- /dev/null
+++ b/SiteNews.csproj
@@ -0,0 +1,129 @@
+
+
+
+
+ Debug
+ AnyCPU
+
+
+ 2.0
+ {7D61A32C-0F21-453F-A981-BD8E5A3A5304}
+ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
+ Library
+ Properties
+ Connect.Modules.SiteNews
+ DnnCSiteNews
+ v4.6.1
+ false
+
+
+
+
+
+
+
+
+
+ true
+ full
+ false
+ ..\..\..\bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ pdbonly
+ true
+ obj\Release\
+ TRACE
+ prompt
+ 4
+ false
+
+
+
+ False
+ ..\..\..\bin\DotNetNuke.dll
+
+
+
+
+
+
+
+
+
+
+
+ Settings.ascx
+ ASPXCodeBehind
+
+
+ Settings.ascx
+
+
+ View.ascx
+ ASPXCodeBehind
+
+
+ View.ascx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 10.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+
+
+
+
+
+
+ True
+ False
+ 54045
+
+
+ http://nine.local/DesktopModules/Connect/SiteNews
+ True
+ http://nine.local
+ False
+ False
+
+
+ False
+
+
+
+
+
\ No newline at end of file
diff --git a/SiteNews.dnn b/SiteNews.dnn
new file mode 100644
index 0000000..68823b1
--- /dev/null
+++ b/SiteNews.dnn
@@ -0,0 +1,138 @@
+
+
+
+ DNN-Connect SiteNews
+
+
+
+ DesktopModules/Connect/images/dnn-connect-logo-32x32.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 07.04.02
+
+
+
+
+ bin
+
+ bin
+ DnnCSiteNews.dll
+ 01.00.00
+
+
+
+
+
+ DNN-Connect-SiteNews
+ Connect/SiteNews
+ Connect.Modules.SiteNews.BusinessController
+
+
+
+
+
+ DNN-Connect SiteNews
+ 0
+
+
+
+ DesktopModules/Connect/SiteNews/View.ascx
+ False
+
+ View
+
+
+ 0
+
+
+ Settings
+ DesktopModules/Connect/SiteNews/Settings.ascx
+ False
+ DNN-Connect SiteNews Settings
+ Edit
+
+
+ 0
+
+
+
+
+
+
+ DotNetNuke.Entities.Modules.EventMessageProcessor, DotNetNuke
+ UpgradeModule
+
+ Connect.Modules.SiteNews.BusinessController
+ [DESKTOPMODULEID]
+ 01.00.00
+
+
+
+
+
+ DesktopModules\Connect\SiteNews
+
+ App_LocalResources
+ View.ascx.resx
+
+
+ App_LocalResources
+ Settings.ascx.resx
+
+
+ View.ascx
+
+
+ SiteNews.dnn
+
+
+ Settings.ascx
+
+
+
+
+
+ DesktopModules\Connect
+
+ Documentation
+ DNN-Connect-SiteNews.License.txt
+
+
+ Documentation
+ DNN-Connect-SiteNews.ReleaseNotes.txt
+
+
+ images
+ dnn-connect-logo-32x32.png
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SiteNews.sln b/SiteNews.sln
new file mode 100644
index 0000000..cb8a59f
--- /dev/null
+++ b/SiteNews.sln
@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiteNews", "SiteNews.csproj", "{7D61A32C-0F21-453F-A981-BD8E5A3A5304}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7D61A32C-0F21-453F-A981-BD8E5A3A5304}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/View.ascx b/View.ascx
new file mode 100644
index 0000000..88cccda
--- /dev/null
+++ b/View.ascx
@@ -0,0 +1,46 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="View.ascx.cs" Inherits="Connect.Modules.SiteNews.View" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/View.ascx.cs b/View.ascx.cs
new file mode 100644
index 0000000..1fa0e13
--- /dev/null
+++ b/View.ascx.cs
@@ -0,0 +1,191 @@
+/*
+DNN-Connect - http://dnn-connect.org
+Copyright (c) 2017
+by DNN-Connect
+Written by Michael Tobisch
+
+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.
+*/
+
+using DotNetNuke.Entities.Modules;
+using DotNetNuke.Services.Exceptions;
+using DotNetNuke.Services.Localization;
+using DotNetNuke.Services.Search.Entities;
+using DotNetNuke.Services.Search.Internals;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web.UI.WebControls;
+
+namespace Connect.Modules.SiteNews
+{
+ public partial class View : PortalModuleBase
+ {
+ private SearchDataProvider _provider = null;
+ protected SearchDataProvider Provider
+ {
+ get
+ {
+ if (_provider == null)
+ _provider = new SearchDataProvider(ModuleConfiguration, UserInfo, PortalSettings);
+ return _provider;
+ }
+ }
+
+ protected int FoundItems { get; set; }
+
+#region Settings
+ protected int NumberOfDays
+ {
+ get
+ {
+ object o = Settings["NumberOfDays"];
+ int numberOfDays;
+ try
+ {
+ if (!(Int32.TryParse(o.ToString(), out numberOfDays)))
+ numberOfDays = 5;
+ }
+ catch (Exception)
+ {
+ numberOfDays = 5;
+ }
+ return numberOfDays;
+ }
+ }
+
+ protected int PageSize
+ {
+ get
+ {
+ int pageSize = 5;
+ object o = Settings["PageSize"];
+ if (o != null)
+ pageSize = Convert.ToInt32(o);
+ return pageSize;
+ }
+ }
+
+ protected bool IncludeSearchType
+ {
+ get { return Convert.ToBoolean(Settings["IncludeSearchType"]); }
+ }
+
+ protected bool IncludeInfo
+ {
+ get { return Convert.ToBoolean(Settings["IncludeInfo"]); }
+ }
+
+ protected bool IncludeDescription
+ {
+ get { return Convert.ToBoolean(Settings["IncludeDescription"]); }
+ }
+
+ protected bool IncludeBody
+ {
+ get { return Convert.ToBoolean(Settings["IncludeBody"]); }
+ }
+
+ protected bool IncludeAuthor
+ {
+ get { return Convert.ToBoolean(Settings["IncludeAuthor"]); }
+ }
+
+ protected bool IncludeSnippet
+ {
+ get { return Convert.ToBoolean(Settings["IncludeSnippet"]); }
+ }
+#endregion
+
+ protected void Page_PreRender(object sender, EventArgs e)
+ {
+ BindData();
+ }
+
+ protected void ResultsList_ItemDataBound(object sender, ListViewItemEventArgs e)
+ {
+ switch (e.Item.ItemType)
+ {
+ case ListViewItemType.DataItem:
+ SearchResult result = (SearchResult)e.Item.DataItem;
+
+ // The Type Label is not really interesting... only for Admins/Debugging purposes
+ Label typeLabel = (Label)e.Item.FindControl("TypeLabel");
+ typeLabel.Visible = ((IncludeSearchType) && (!(string.IsNullOrEmpty(GetSearchTypeName(result.SearchTypeId)))));
+
+ Label descriptionLabel = (Label)e.Item.FindControl("DescriptionLabel");
+ descriptionLabel.Visible = ((IncludeDescription) && (!(string.IsNullOrEmpty(result.Description))));
+
+ Label bodyLabel = (Label)e.Item.FindControl("BodyLabel");
+ bodyLabel.Visible = ((IncludeBody) && (!(string.IsNullOrEmpty(result.Body))));
+
+ Label authorNameLabel = (Label)e.Item.FindControl("AuthorNameLabel");
+ authorNameLabel.Visible = ((IncludeAuthor && (!string.IsNullOrEmpty(result.AuthorName))));
+
+ Label displayModifiedTimeLabel = (Label)e.Item.FindControl("DisplayModifiedTimeLabel");
+ displayModifiedTimeLabel.Visible = (!(string.IsNullOrEmpty(result.DisplayModifiedTime)));
+
+ Label snippetLabel = (Label)e.Item.FindControl("SnippetLabel");
+ snippetLabel.Visible = ((IncludeSnippet) && (!(string.IsNullOrEmpty(result.Snippet))));
+
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected string GetSearchTypeName(object searchType)
+ {
+ List searchTypes = SearchHelper.Instance.GetSearchTypes().ToList();
+ string searchTypeName = searchTypes.Find(s => s.SearchTypeId == (int)searchType).SearchTypeName;
+ string result = Localization.GetString(string.Format("Crawler_{0}.Text", searchTypeName.ToString()), SiteNewsHelpers.SearchableModulesResourceFile);
+ if (string.IsNullOrEmpty(result))
+ result = searchTypeName;
+ return result;
+ }
+
+ private void BindData()
+ {
+ try
+ {
+ IList searchResult = Provider.GetNewItems();
+ ResultsList.DataSource = searchResult;
+ FoundItems = searchResult.Count;
+ ResultsList.DataBind();
+ if (IncludeInfo)
+ {
+ ((Panel)ResultsList.FindControl("InfoPanel")).Visible = true;
+ ((Label)ResultsList.FindControl("FoundItems")).Text = string.Format(Localization.GetString("FoundItems.Text", LocalResourceFile), FoundItems, NumberOfDays);
+ }
+ else
+ {
+ ((Panel)ResultsList.FindControl("InfoPanel")).Visible = false;
+ }
+ ResultsPager.Visible = (FoundItems > PageSize);
+ }
+ catch (Exception exc)
+ {
+ NoNewsFoundMessagePanel.Visible = true;
+ Exceptions.LogException(exc);
+ }
+ }
+
+ protected void ResultsPager_Load(object sender, EventArgs e)
+ {
+ DataPager resultsPager = (DataPager)sender;
+ resultsPager.PageSize = PageSize;
+ }
+ }
+}
\ No newline at end of file
diff --git a/View.ascx.designer.cs b/View.ascx.designer.cs
new file mode 100644
index 0000000..62dd190
--- /dev/null
+++ b/View.ascx.designer.cs
@@ -0,0 +1,60 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Connect.Modules.SiteNews {
+
+
+ public partial class View {
+
+ ///
+ /// SiteSearchPanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel SiteSearchPanel;
+
+ ///
+ /// NoNewsFoundMessagePanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel NoNewsFoundMessagePanel;
+
+ ///
+ /// NoNewsFoundMessage control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label NoNewsFoundMessage;
+
+ ///
+ /// ResultsList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ListView ResultsList;
+
+ ///
+ /// ResultsPager control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DataPager ResultsPager;
+ }
+}
diff --git a/images/dnn-connect-logo-32x32.png b/images/dnn-connect-logo-32x32.png
new file mode 100644
index 0000000..5e1f15b
Binary files /dev/null and b/images/dnn-connect-logo-32x32.png differ