Skip to content

Commit

Permalink
Wrap DnnUrlControl into custom control GH-117
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-yagodin committed Feb 19, 2021
1 parent 8bffc10 commit 4530f58
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
7 changes: 7 additions & 0 deletions R7.Documents.Dnn/Controls/UrlControlWrapper.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<%@ Control Language="C#" CodeBehind="UrlControlWrapper.ascx.cs" Inherits="R7.Documents.Controls.UrlControlWrapper" %>
<%@ Register TagPrefix="dnn" TagName="Url" Src="~/controls/DnnUrlControl.ascx" %>
<dnn:Url id="ctlUrl" runat="server"
UrlType="F"
ShowTabs="true" IncludeActiveTab="true"
ShowNone="True" ShowNewWindow="True"
ShowSecure="True" ShowDatabase="True" />
11 changes: 3 additions & 8 deletions R7.Documents.Dnn/EditDocuments.ascx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<%@ Control Language="C#" AutoEventWireup="false" CodeBehind="EditDocuments.ascx.cs" Inherits="R7.Documents.EditDocuments" %>
<%@ Register TagPrefix="dnn" TagName="URL" Src="~/controls/DnnUrlControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Tracking" Src="~/controls/URLTrackingControl.ascx" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="r7docs" TagName="Url" Src="~/DesktopModules/R7.Documents/R7.Documents.Dnn/Controls/UrlControlWrapper.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web.Deprecated" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.Client.ClientResourceManagement" Assembly="DotNetNuke.Web.Client" %>

Expand All @@ -26,13 +26,8 @@
</div>
<div class="dnnFormItem">
<dnn:Label id="lblUrl" runat="server" ControlName="ctlUrl" />
<div class="dnnLeft">
<dnn:Url id="ctlUrl" runat="server" UrlType="F"
ShowTabs="true" IncludeActiveTab="true"
ShowNone="True" ShowNewWindow="True"
ShowSecure="True" ShowDatabase="True" />
</div>
</div>
<r7docs:Url id="ctlUrl" runat="server" />
</div>
<div class="dnnFormItem">
<dnn:Label id="lblSortIndex" runat="server" ControlName="txtSortIndex" />
<asp:TextBox id="txtSortIndex" runat="server">10</asp:TextBox>
Expand Down
3 changes: 2 additions & 1 deletion R7.Documents.Dnn/EditDocuments.ascx.controls.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using System.Web.UI.WebControls;
using DotNetNuke.UI.UserControls;
using DotNetNuke.Web.UI.WebControls;
using R7.Documents.Controls;

namespace R7.Documents
{
public partial class EditDocuments
{
protected TextBox txtTitle;
protected RequiredFieldValidator valName;
protected DnnUrlControl ctlUrl;
protected UrlControlWrapper ctlUrl;
protected TextBox txtCategory;
protected TextBox txtDescription;
protected CheckBox chkForceDownload;
Expand Down
2 changes: 1 addition & 1 deletion R7.Documents.Dnn/EditDocuments.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void LoadNewDocument ()
txtSortIndex.Text = ((CalculateSortIndex () ?? 0) + 10).ToString ();

if (IsFirstLoad) {
SelectFolder (ctlUrl, Settings.DefaultFolder ?? FolderHistory.GetLastFolderId (Request, PortalId));
SelectFolder (ctlUrl.BaseUrlControl, Settings.DefaultFolder ?? FolderHistory.GetLastFolderId (Request, PortalId));
}

ctlUrl.NewWindow = DocumentsConfig.Instance.NewWindow;
Expand Down
5 changes: 5 additions & 0 deletions R7.Documents.Dnn/R7.Documents.Dnn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
<Folder Include="images\" />
</ItemGroup>
<ItemGroup>
<Content Include="Controls\UrlControlWrapper.ascx" />
<Content Include="module.css" />
<Content Include="SqlDataProvider\01.12.00.dnn.sql" />
<Content Include="ViewDocuments.ascx" />
Expand Down Expand Up @@ -153,6 +154,10 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Components\DocumentsController.cs" />
<Compile Include="Controls\UrlControlWrapper.ascx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>UrlControlWrapper.ascx</DependentUpon>
</Compile>
<Compile Include="ViewDocuments.ascx.cs">
<DependentUpon>ViewDocuments.ascx</DependentUpon>
</Compile>
Expand Down

0 comments on commit 4530f58

Please sign in to comment.