Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for folder providers config in new file manager. #4061

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DNN Platform/Modules/DigitalAssets/EditFolderMapping.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected override void OnInit(EventArgs e)
}

this.UpdateButton.Text = (this.FolderMappingID == Null.NullInteger) ? Localization.GetString("Add") : Localization.GetString("Update", this.LocalResourceFile);
this.CancelHyperLink.NavigateUrl = this.EditUrl("FolderMappings");
this.CancelHyperLink.NavigateUrl = this._navigationManager.NavigateURL(this.TabId);

var controlTitle = Localization.GetString("ControlTitle", this.LocalResourceFile);
var controlTitlePrefix = (this.FolderMappingID == Null.NullInteger) ? Localization.GetString("New") : Localization.GetString("Edit");
Expand Down Expand Up @@ -194,7 +194,7 @@ private void cmdUpdate_Click(object sender, EventArgs e)

if (!this.Response.IsRequestBeingRedirected)
{
this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId, "FolderMappings", "mid=" + this.ModuleId, "popUp=true"));
this.Response.Redirect(this._navigationManager.NavigateURL(this.TabId));
}
}
catch (Exception exc)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
<?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="ControlTitle.Text" xml:space="preserve">
<value>{0} Folder Type</value>
</data>
<data name="ControlTitle_editfoldermapping.Text" xml:space="preserve">
<value>Edit Folder Mapping</value>
</data>
<data name="Description.Text" xml:space="preserve">
<value>Use this dialog to define a new folder type.</value>
</data>
<data name="DuplicateMappingName.Text" xml:space="preserve">
<value>A mapping with the same name already exists. The changes have not been saved.</value>
</data>
<data name="FolderProviderSettings.Text" xml:space="preserve">
<value>Folder Provider Settings</value>
</data>
<data name="GeneralSettings.Text" xml:space="preserve">
<value>General Settings</value>
</data>
<data name="FolderProviderLabel.Help" xml:space="preserve">
<value>Select the folder provider to use.</value>
</data>
<data name="FolderProviderLabel.Text" xml:space="preserve">
<value>Folder Provider</value>
</data>
<data name="NameLabel.Help" xml:space="preserve">
<value>Enter the name of this folder mapping.</value>
</data>
<data name="NameLabel.Text" xml:space="preserve">
<value>Name</value>
</data>
<data name="RequiredFields.Text" xml:space="preserve">
<value>Indicates required fields.</value>
</data>
<data name="SelectFolderProvider.Text" xml:space="preserve">
<value>- Select a Folder Provider -</value>
david-poindexter marked this conversation as resolved.
Show resolved Hide resolved
</data>
<data name="SyncWarning.Text" xml:space="preserve">
<value>After updating the folder type, a synchronization will be performed on the folders using this type. This may take some time, depending on the number of folders that match the criteria.</value>
</data>
<data name="Update.Text" xml:space="preserve">
<value>Update</value>
</data>
<data name="FolderProviderValidator.ErrorMessage" xml:space="preserve">
<value>Folder provider is required.</value>
</data>
<data name="NameValidator.ErrorMessage" xml:space="preserve">
<value>Name is required.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,28 @@
<data name="InvalidExtensionMessage.Text" xml:space="preserve">
<value> is not of a type that is allowed to be uploaded</value>
</data>
</root>
<data name="ManageFolderTypes.Text" xml:space="preserve">
<value>Manage Folder Types</value>
</data>
<data name="AddFolderType.Text" xml:space="preserve">
<value>Add Folder Type</value>
</data>
<data name="FolderProvider.Text" xml:space="preserve">
<value>Folder Provider</value>
</data>
<data name="FolderTypeDefinitions.Text" xml:space="preserve">
<value>Folder Type Definitions</value>
</data>
<data name="EditFolderType.Text" xml:space="preserve">
<value>Edit Folder Type</value>
</data>
<data name="RemoveFolderType.Text" xml:space="preserve">
<value>Remove Folder Type</value>
</data>
<data name="RemoveFolderTypeDialogBody.Text" xml:space="preserve">
<value>Are you sure you want to remove this folder type?</value>
</data>
<data name="RemoveFolderTypeDialogHeader.Text" xml:space="preserve">
<value>Remove Folder Type</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
<LangVersion>7</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Packages\Microsoft.Extensions.DependencyInjection.2.1.1\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Drawing" />
Expand Down Expand Up @@ -97,6 +105,13 @@
<Compile Include="Components\SearchController.cs" />
<Compile Include="Components\SettingsManager.cs" />
<Compile Include="Components\ThumbnailsManager.cs" />
<Compile Include="EditFolderMapping.ascx.cs">
<DependentUpon>EditFolderMapping.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="EditFolderMapping.ascx.designer.cs">
<DependentUpon>EditFolderMapping.ascx</DependentUpon>
</Compile>
<Compile Include="Exceptions\FolderPermissionNotMetException.cs" />
<Compile Include="Exceptions\ModeValidationException.cs" />
<Compile Include="Exceptions\NotFoundException.cs" />
Expand Down Expand Up @@ -133,6 +148,7 @@
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="EditFolderMapping.ascx" />
<Content Include="Images\arrow_forward.svg" />
<Content Include="Images\checkmark.svg" />
<Content Include="Images\clipboard.svg" />
Expand Down Expand Up @@ -190,10 +206,18 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DotNetNuke.Abstractions\DotNetNuke.Abstractions.csproj">
<Project>{6928A9B1-F88A-4581-A132-D3EB38669BB0}</Project>
<Name>DotNetNuke.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj">
<Project>{3cd5f6b8-8360-4862-80b6-f402892db7dd}</Project>
<Name>DotNetNuke.Instrumentation</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.ModulePipeline\DotNetNuke.ModulePipeline.csproj">
<Project>{c4823821-cfb3-4394-851f-e39d0974efbd}</Project>
<Name>DotNetNuke.ModulePipeline</Name>
</ProjectReference>
<ProjectReference Include="..\..\DotNetNuke.Web.Client\DotNetNuke.Web.Client.csproj">
<Project>{03e3afa5-ddc9-48fb-a839-ad4282ce237e}</Project>
<Name>DotNetNuke.Web.Client</Name>
Expand All @@ -217,6 +241,9 @@
<ItemGroup>
<Content Include="Module.build" />
</ItemGroup>
<ItemGroup>
<Content Include="App_LocalResources\EditFolderMapping.ascx.resx" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
40 changes: 40 additions & 0 deletions DNN Platform/Modules/ResourceManager/EditFolderMapping.ascx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EditFolderMapping.ascx.cs" Inherits="Dnn.Modules.ResourceManager.EditFolderMapping" %>
<%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.UI.WebControls" Assembly="DotNetNuke" %>
<%@ Register TagPrefix="dnn" Namespace="DotNetNuke.Web.UI.WebControls" Assembly="DotNetNuke.Web" %>
<div class="dnnForm dnnEditFolderMapping dnnClear" id="dnnEditFolderMapping">
<div class="dnnFormMessage dnnFormInfo"><asp:Label ID="DescriptionLabel" runat="server" resourcekey="Description"></asp:Label></div>
<asp:PlaceHolder id="SyncWarningPlaceHolder" runat="server">
<div class="dnnFormMessage dnnFormInfo"><asp:Label ID="SyncLabel" runat="server" Visible="true" ResourceKey="SyncWarning" /></div>
</asp:PlaceHolder>
<div class="EditFolderMappingContent dnnClear">
<div class="dnnFormItem dnnFormHelp dnnClear"><p class="dnnFormRequired"><span><%=LocalizeString("RequiredFields")%></span></p></div>
<div id="exFolderMappingSettings" class="exFolderMappingSettings dnnClear">
<div class="exfmsContent dnnClear">
<h2 id="Panel-GeneralSettings" class="dnnFormSectionHead"><%=LocalizeString("GeneralSettings")%></h2>
<fieldset>
<div class="dnnFormItem">
<dnn:label id="NameLabel" runat="server" controlname="txtName" CssClass="dnnFormRequired" />
<asp:TextBox ID="NameTextbox" runat="server" MaxLength="50"></asp:TextBox>
<asp:RequiredFieldValidator ID="NameValidator" runat="server" ControlToValidate="NameTextbox" Display="Dynamic" CssClass="dnnFormMessage dnnFormError" resourcekey="NameValidator.ErrorMessage" ValidationGroup="vgEditFolderMapping"></asp:RequiredFieldValidator>
</div>
<div class="dnnFormItem">
<dnn:label id="FolderProviderLabel" runat="server" controlname="cboFolderProviders" />
<asp:DropDownList ID="FolderProvidersComboBox" runat="server" AutoPostBack="true" CausesValidation="false" OnSelectedIndexChanged="CboFolderProviders_SelectedIndexChanged" />
<asp:RequiredFieldValidator ID="FolderProviderValidator" runat="server" ControlToValidate="FolderProvidersComboBox" InitialValue="" Display="Dynamic" CssClass="dnnFormMessage dnnFormError" resourcekey="FolderProviderValidator.ErrorMessage" EnableClientScript="false" ValidationGroup="vgEditFolderMapping"></asp:RequiredFieldValidator>
</div>
</fieldset>
<h2 id="Panel-FolderProviderSettings" class="dnnFormSectionHead"><%=LocalizeString("FolderProviderSettings")%></h2>
<fieldset>
<asp:PlaceHolder ID="ProviderSettingsPlaceHolder" runat="server"></asp:PlaceHolder>
</fieldset>
</div>
</div>
</div>
<ul class="dnnActions dnnClear">
<li>
<asp:LinkButton ID="UpdateButton" runat="server" CssClass="dnnPrimaryAction" ResourceKey="cmdUpdate" IconKey="Add" ValidationGroup="vgEditFolderMapping" />
</li>
<li><asp:HyperLink ID="CancelHyperLink" runat="server" CssClass="dnnSecondaryAction" resourcekey="cmdCancel" /></li>
</ul>
</div>
Loading