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

ENH: Hyperlink to parent forum/group in Control Panel forum editor #670

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
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