Skip to content
This repository has been archived by the owner on Aug 4, 2019. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed Oct 22, 2017
1 parent ef32341 commit 4ab0fcb
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 185 deletions.
1 change: 0 additions & 1 deletion DNN 7/Browser/Browser.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace WatchersNET.CKEditor.Browser
using DotNetNuke.Security.Permissions;
using DotNetNuke.Security.Roles;
using DotNetNuke.Services.FileSystem;
using DotNetNuke.Services.Installer.Log;
using DotNetNuke.Services.Localization;
using DotNetNuke.UI.Utilities;

Expand Down
1 change: 0 additions & 1 deletion DNN 7/Browser/FileUploader.ashx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace WatchersNET.CKEditor.Browser
using System.Web;
using System.Web.Script.Serialization;

using DotNetNuke.Entities.Portals;
using DotNetNuke.Services.FileSystem;

using WatchersNET.CKEditor.Objects;
Expand Down
2 changes: 0 additions & 2 deletions DNN 7/CKEditorOptions.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ namespace WatchersNET.CKEditor
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Xml.Serialization;

using DotNetNuke.Collections;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
Expand Down
1 change: 0 additions & 1 deletion DNN 7/Controls/HtmlGenericSelfClosing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace WatchersNET.CKEditor.Controls
#region

using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;

Expand Down
104 changes: 36 additions & 68 deletions DNN 7/Controls/UrlControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ namespace WatchersNET.CKEditor.Controls
public abstract class UrlControl : UserControl
{
/// <summary>
/// The _local resource file.
/// The local resource file.
/// </summary>
private string _localResourceFile;
private string localResourceFile;

/// <summary>
/// The with events field folders.
Expand Down Expand Up @@ -60,66 +60,46 @@ protected UrlControl()
/// </value>
public bool ReloadFiles
{
get
{
return this.ViewState["ReloadFiles"] == null || Convert.ToBoolean(this.ViewState["ReloadFiles"]);
}
get => this.ViewState["ReloadFiles"] == null || Convert.ToBoolean(this.ViewState["ReloadFiles"]);

set
{
this.ViewState["ReloadFiles"] = value;
}
set => this.ViewState["ReloadFiles"] = value;
}

/// <summary>
/// Gets or sets the file filter.
/// </summary>
public string FileFilter
{
get
{
return this.ViewState["FileFilter"] != null
? Convert.ToString(this.ViewState["FileFilter"])
: string.Empty;
}
get => this.ViewState["FileFilter"] != null
? Convert.ToString(this.ViewState["FileFilter"])
: string.Empty;

set
{
this.ViewState["FileFilter"] = value;
}
set => this.ViewState["FileFilter"] = value;
}

/// <summary>
/// Gets or sets the local resource file.
/// </summary>
public string LocalResourceFile
{
get
{
return string.IsNullOrEmpty(this._localResourceFile)
? string.Format(
"{0}/{1}/URLControl.ascx.resx",
this.TemplateSourceDirectory.Replace(
"Providers/HtmlEditorProviders/CKEditor", "controls"),
Localization.LocalResourceDirectory)
: this._localResourceFile;
}

set
{
this._localResourceFile = value;
}
get => string.IsNullOrEmpty(this.localResourceFile)
? string.Format(
"{0}/{1}/URLControl.ascx.resx",
this.TemplateSourceDirectory.Replace(
"Providers/HtmlEditorProviders/CKEditor",
"controls"),
Localization.LocalResourceDirectory)
: this.localResourceFile;

set => this.localResourceFile = value;
}

/// <summary>
/// Gets or sets the width.
/// </summary>
public string Width
{
get
{
return Convert.ToString(this.ViewState["SkinControlWidth"]);
}
get => Convert.ToString(this.ViewState["SkinControlWidth"]);

set
{
Expand All @@ -139,15 +119,9 @@ public string Width
/// </summary>
public int PortalId
{
get
{
return Convert.ToInt32(this.ViewState["PortalId"]);
}
get => Convert.ToInt32(this.ViewState["PortalId"]);

set
{
this.ViewState["PortalId"] = value;
}
set => this.ViewState["PortalId"] = value;
}

/// <summary>
Expand All @@ -170,10 +144,7 @@ public string Url
return url;
}

set
{
this.ViewState["Url"] = value;
}
set => this.ViewState["Url"] = value;
}

#endregion
Expand Down Expand Up @@ -213,22 +184,19 @@ public string Url
/// </summary>
protected DropDownList Folders
{
get
{
return this.folders;
}
get => this.folders;

set
{
if (this.folders != null)
{
this.folders.SelectedIndexChanged -= this.Folders_SelectedIndexChanged;
this.folders.SelectedIndexChanged -= this.FoldersSelectedIndexChanged;
}

this.folders = value;
if (this.folders != null)
{
this.folders.SelectedIndexChanged += this.Folders_SelectedIndexChanged;
this.folders.SelectedIndexChanged += this.FoldersSelectedIndexChanged;
}
}
}
Expand All @@ -250,27 +218,27 @@ public void BindData()

this.ReloadFiles = false;

var _url = Convert.ToString(this.ViewState["Url"]);
var url = Convert.ToString(this.ViewState["Url"]);

if (string.IsNullOrEmpty(_url))
if (string.IsNullOrEmpty(url))
{
return;
}

var _urltype = DotNetNuke.Common.Globals.GetURLType(_url).ToString("g").Substring(0, 1);
var urltype = DotNetNuke.Common.Globals.GetURLType(url).ToString("g").Substring(0, 1);

if (_urltype == "F")
if (urltype == "F")
{
if (_url.ToLower().StartsWith("fileid="))
if (url.ToLower().StartsWith("fileid="))
{
var objFile = FileManager.Instance.GetFile(int.Parse(_url.Substring(7)));
var objFile = FileManager.Instance.GetFile(int.Parse(url.Substring(7)));

if (objFile != null)
{
_url = objFile.Folder + objFile.FileName;
url = objFile.Folder + objFile.FileName;

var fileName = _url.Substring(_url.LastIndexOf("/", StringComparison.Ordinal) + 1);
var folderPath = _url.Replace(fileName, string.Empty);
var fileName = url.Substring(url.LastIndexOf("/", StringComparison.Ordinal) + 1);
var folderPath = url.Replace(fileName, string.Empty);

if (this.Folders.Items.FindByValue(folderPath) != null)
{
Expand All @@ -297,7 +265,7 @@ public void BindData()
}
}

this.ViewState["Url"] = _url;
this.ViewState["Url"] = url;
}

/// <summary>
Expand Down Expand Up @@ -366,7 +334,7 @@ private void Page_PreRender(object sender, EventArgs e)
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
private void Folders_SelectedIndexChanged(object sender, EventArgs e)
private void FoldersSelectedIndexChanged(object sender, EventArgs e)
{
this.Files.Items.Clear();
this.Files.DataSource = this.GetFileList(true);
Expand Down
Binary file modified DNN 7/Install/bin/WatchersNET.CKEditor.dll
Binary file not shown.
12 changes: 0 additions & 12 deletions DNN 7/UrlControl.ascx
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
<%@ Control Language="c#" AutoEventWireup="false" Inherits="WatchersNET.CKEditor.Controls.UrlControl" %>
<%@ Import Namespace="System.Web.DynamicData" %>
<%@ Import Namespace="System.Web.DynamicData" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls.Expressions" %>
<%@ Import Namespace="System.Web.UI.WebControls.Expressions" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>

<div>
<asp:Label ID="FolderLabel" runat="server" EnableViewState="False" resourcekey="Folder" CssClass="NormalBold" />
Expand Down
3 changes: 0 additions & 3 deletions DNN 7/Web/CKEditorControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace WatchersNET.CKEditor.Web
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Web;
Expand All @@ -46,8 +45,6 @@ namespace WatchersNET.CKEditor.Web
using WatchersNET.CKEditor.Objects;
using WatchersNET.CKEditor.Utilities;

using Assembly = System.Reflection.Assembly;

#endregion

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion DNN 8/Browser/Browser.aspx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace WatchersNET.CKEditor.Browser
using DotNetNuke.Entities.Tabs;
using DotNetNuke.Entities.Users;
using DotNetNuke.Framework.Providers;
using DotNetNuke.Security;
using DotNetNuke.Security.Permissions;
using DotNetNuke.Security.Roles;
using DotNetNuke.Services.FileSystem;
Expand Down
1 change: 0 additions & 1 deletion DNN 8/CKEditorOptions.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace WatchersNET.CKEditor
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
Expand Down
1 change: 0 additions & 1 deletion DNN 8/Controls/HtmlGenericSelfClosing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace WatchersNET.CKEditor.Controls
#region

using System;
using System.Collections;
using System.Web.UI;
using System.Web.UI.HtmlControls;

Expand Down
Loading

0 comments on commit 4ab0fcb

Please sign in to comment.