Skip to content

Commit

Permalink
Fix for issue #47
Browse files Browse the repository at this point in the history
  • Loading branch information
juvander committed Sep 29, 2020
1 parent 6605044 commit 66cd7b7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: System.Reflection.AssemblyVersion("04.01.00.00")]
[assembly: System.Reflection.AssemblyVersion("04.01.01.00")]


4 changes: 2 additions & 2 deletions DotNetNuke_DotNetNuke.Repository.dnn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="DotNetNuke.Repository" type="Module" version="04.01.00">
<package name="DotNetNuke.Repository" type="Module" version="04.01.01">
<friendlyName>Repository</friendlyName>
<description>A file/object repository module that includes skinning and community features like comments and user ratings.</description>
<iconFile>icon_repository_32px.gif</iconFile>
Expand Down Expand Up @@ -321,7 +321,7 @@
</components>
</package>

<package name="DotNetNuke.Repository.Dashboard" type="Module" version="04.01.00">
<package name="DotNetNuke.Repository.Dashboard" type="Module" version="04.01.01">
<friendlyName>Repository Dashboard</friendlyName>
<description></description>
<owner>
Expand Down
5 changes: 4 additions & 1 deletion ReleaseNotes.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<h2>Repository 4.0.0</h2>
<h2>Repository 4.1.1</h2>
<p>Fix for issue ¤47</p>
<hr />
<h2>Repository 4.0.0</h2>
<p>This is a total rewrite in c# and brings the module Dnn 9.2 compatible. This is a pre-release version and should not be used in a production environment.</p>
<hr />
<h2>Repository 3.5.6</h2>
Expand Down
43 changes: 13 additions & 30 deletions Repository.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ private void Page_Load(System.Object sender, System.EventArgs e)

oRepositoryBusinessController.LocalResourceFile = m_LocalResourceFile;
oRepositoryBusinessController.SetRepositoryFolders(ModuleId);

if (Request.Cookies[string.Format("_DRMCategory{0}", ModuleId)] != null) {
oRepositoryBusinessController.g_CategoryId = int.Parse(Request.Cookies[string.Format("_DRMCategory{0}", ModuleId)].Value);
if (ViewState[string.Format("_DRMCategory{0}", ModuleId)] != null) {
oRepositoryBusinessController.g_CategoryId = int.Parse(Convert.ToString(ViewState[string.Format("_DRMCategory{0}", ModuleId)]));
} else {
bool allDefault = false;
if (Settings["AllowAllFiles"] != null) {
Expand Down Expand Up @@ -372,9 +372,9 @@ private void Page_Load(System.Object sender, System.EventArgs e)

}

CreateCookie();
ViewState[string.Format("_DRMCategory{0}", ModuleId)] = oRepositoryBusinessController.g_CategoryId;

CheckItemRoles();
CheckItemRoles();

LoadRepositoryTemplates();

Expand Down Expand Up @@ -1678,8 +1678,8 @@ private void ddlCategories_SelectedIndexChanged(object sender, System.EventArgs
lstObjects.CurrentPageIndex = 0;
ViewState["mPage"] = Convert.ToString(lstObjects.CurrentPageIndex);
ViewState["mAttributes"] = oRepositoryBusinessController.g_Attributes;
CreateCookie();
BindObjectList();
ViewState[string.Format("_DRMCategory{0}", ModuleId)] = oRepositoryBusinessController.g_CategoryId;
BindObjectList();
}

public void TreeNodeClick(object source, DotNetNuke.UI.WebControls.DNNTreeNodeClickEventArgs e)
Expand All @@ -1693,8 +1693,8 @@ public void TreeNodeClick(object source, DotNetNuke.UI.WebControls.DNNTreeNodeCl
lstObjects.CurrentPageIndex = 0;
ViewState["mPage"] = Convert.ToString(lstObjects.CurrentPageIndex);
ViewState["mAttributes"] = oRepositoryBusinessController.g_Attributes;
CreateCookie();
BindObjectList();
ViewState[string.Format("_DRMCategory{0}", ModuleId)] = oRepositoryBusinessController.g_CategoryId;
BindObjectList();
}

private void ddlCategories2_SelectedIndexChanged(object sender, System.EventArgs e)
Expand Down Expand Up @@ -1740,8 +1740,8 @@ private void ddlAttribute_SelectedIndexChanged(object sender, System.EventArgs e
lstObjects.CurrentPageIndex = 0;
ViewState["mPage"] = Convert.ToString(lstObjects.CurrentPageIndex);
ViewState["mAttributes"] = oRepositoryBusinessController.g_Attributes;
CreateCookie();
BindObjectList();
ViewState[string.Format("_DRMCategory{0}", ModuleId)] = oRepositoryBusinessController.g_CategoryId;
BindObjectList();
}

#endregion
Expand Down Expand Up @@ -1939,22 +1939,6 @@ private void CheckItemRoles()

}


private void CreateCookie()
{
HttpCookie objCategory = null;

if (Request.Cookies["_DRMCategory" + ModuleId] == null) {
objCategory = new HttpCookie("_DRMCategory" + ModuleId);
Response.AppendCookie(objCategory);
}

objCategory = Request.Cookies["_DRMCategory" + ModuleId];
objCategory.Value = oRepositoryBusinessController.g_CategoryId.ToString();
Response.SetCookie(objCategory);

}

private bool CheckUserRoles(string roles)
{
if (string.IsNullOrEmpty(roles)) {
Expand Down Expand Up @@ -2935,9 +2919,8 @@ public void OnModuleCommunication(object s, DotNetNuke.Entities.Modules.Communic
mFilter = e.Value.ToString();
break;
}
CreateCookie();

ViewState["mFilter"] = mFilter;
ViewState[string.Format("_DRMCategory{0}", ModuleId)] = oRepositoryBusinessController.g_CategoryId;
ViewState["mFilter"] = mFilter;
ViewState["mSortOrder"] = mSortOrder;
ViewState["mPage"] = "0";
ViewState["mItemID"] = mItemID;
Expand Down

0 comments on commit 66cd7b7

Please sign in to comment.