Skip to content

Commit

Permalink
Merge pull request #670 from johnhenley/dev81/2-features-control-pane…
Browse files Browse the repository at this point in the history
…l-forum-group-link

ENH: Hyperlink to parent forum/group in Control Panel forum editor
  • Loading branch information
Timo-Breumelhof committed Feb 21, 2024
2 parents 18d1446 + 47f03c8 commit d8cdb3e
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Dnn.CommunityForums/App_LocalResources/ControlPanel.ascx.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1414,4 +1414,7 @@ Your removal method is currently set to {0}. Your topics will be {1} based upon
<data name="[RESX:AllowLikes].Text" xml:space="preserve">
<value>Allow Likes</value>
</data>
<data name="[RESX:Parent].Text" xml:space="preserve">
<value>Parent: </value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ function afadmin_getProperties() {
<div class="amcpsubnav">
<div class="amcplnkbtn">&nbsp;</div>
</div>
<div class="amcpbrdnav"><span class="amcpbrdnavitem" onclick="LoadView('manageforums');">[RESX:ForumsGroups]</span> > [RESX:Details]</div>
<div class="amcpbrdnav"><span class="amcpbrdnavitem" onclick="LoadView('manageforums');">[RESX:ForumsGroups]</span> > [RESX:Details]&nbsp;<span runat="server" id="span_Parent" class="amcpbrdnavitem"></span></div>
<div class="amcpcontrolstab" id="amcpcontrolstab">
<asp:Literal ID="litTabs" runat="server" />
<div class="amtabcontent" id="amTabContent">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ protected override void OnLoad(EventArgs e)
recordId = Utilities.SafeConvertInt(Params.Split(sepChar)[0]);
}

span_Parent.Visible = false;
if (editorType == "G")
{
trGroups.Visible = false;
Expand All @@ -78,6 +79,25 @@ protected override void OnLoad(EventArgs e)
trInherit.Visible = true;
chkInheritGroup.Attributes.Add("onclick", "amaf_toggleInherit();");
btnDelete.ClientSideScript = "deleteForum();";
if (recordId != 0)
{
span_Parent.Visible = true;
string parent = DotNetNuke.Modules.ActiveForums.Utilities.GetSharedResource("[RESX:Parent]",true);
var fi = new DotNetNuke.Modules.ActiveForums.ForumController().GetForum(PortalId, ModuleId, recordId);
if (fi.ParentForumId != 0)
{
span_Parent.Attributes.Add("onclick", $"LoadView('manageforums_forumeditor','{fi.ParentForumId}|F');");
span_Parent.InnerText = "| " + parent + " " + fi.ParentForumName;
/* TODO: When updating to DAL2 ForumController, these two lines can be removed because fi.ParentForumName will be populated :) */
fi = new DotNetNuke.Modules.ActiveForums.ForumController().GetForum(PortalId, ModuleId, fi.ParentForumId);
span_Parent.InnerText = "| " + parent + " " + fi.ForumName;
}
else
{
span_Parent.InnerText = "| " + parent + " " + fi.GroupName;
span_Parent.Attributes.Add("onclick", $"LoadView('manageforums_forumeditor','{fi.ForumGroupId}|G');");
}
}
}

if (recordId == 0)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dnn.CommunityForums/controls/admin_templates_edit.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private void LoadForm(int TemplateId)
txtSubject.Text = ti.Subject;

SettingsInfo moduleSettings = SettingsBase.GetModuleSettings(ti.ModuleId);
txtFileName.Text = Server.MapPath(moduleSettings.TemplatePath + ti.FileName);
txtFileName.Text = Utilities.MapPath(moduleSettings.TemplatePath + ti.FileName);
txtEditor.Text = Server.HtmlDecode(ti.Template.Replace("[RESX:", "[TRESX:"));
drpTemplateType.SelectedIndex = drpTemplateType.Items.IndexOf(drpTemplateType.Items.FindByValue(Convert.ToString(Convert.ToInt32(Enum.Parse(typeof(Templates.TemplateTypes), ti.TemplateType.ToString())))));
hidTemplateId.Value = Convert.ToString(ti.TemplateId);
Expand Down

0 comments on commit d8cdb3e

Please sign in to comment.