Skip to content

Commit d9afdf6

Browse files
authored
Merge pull request #1705 from DNNCommunity/dev
TASK: Sync dev to master
2 parents 0d37504 + 8baa1f7 commit d9afdf6

31 files changed

+391
-98
lines changed

Dnn.CommunityForums/App_LocalResources/ControlPanel.ascx.fr-FR.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,9 +1393,6 @@ Votre méthode de suppression est actuellement définie sur {0}. Vos sujets ser
13931393
<data name="[RESX:Tips:SecGrid:Subscribe].Text" xml:space="preserve">
13941394
<value>Vous pouvez vous inscrire pour recevoir des notifications par e-mail sur les nouveaux sujets et les réponses.</value>
13951395
</data>
1396-
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1397-
<value>Peut ajouter des balises aux sujets et aux réponses.</value>
1398-
</data>
13991396
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
14001397
<value>La sécurité des utilisateurs avec confiance contourne automatiquement la modération si elle est configurée pour un forum.</value>
14011398
</data>
@@ -1549,4 +1546,7 @@ Votre méthode de suppression est actuellement définie sur {0}. Vos sujets ser
15491546
<data name="[RESX:UserMentions].Text" xml:space="preserve">
15501547
<value>Mentions d’utilisateurs</value>
15511548
</data>
1549+
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1550+
<value>Peut ajouter/gérer des tags sur des sujets. Tous les tags entrés dans les publications (sujets et/ou réponses) sont automatiquement ajoutés au sujet ainsi que la liste des tags disponibles sur les forums.</value>
1551+
</data>
15521552
</root>

Dnn.CommunityForums/App_LocalResources/ControlPanel.ascx.it-IT.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,9 +1390,6 @@ Il metodo di rimozione è attualmente impostato su {0}. I tuoi argomenti verran
13901390
<data name="[RESX:Tips:SecGrid:Subscribe].Text" xml:space="preserve">
13911391
<value>Può iscriversi per ricevere notifiche via e-mail su nuovi argomenti e risposte.</value>
13921392
</data>
1393-
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1394-
<value>Può aggiungere tag agli argomenti e alle risposte.</value>
1395-
</data>
13961393
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
13971394
<value>L'utente con sicurezza Attendibile ignora automaticamente la moderazione se configurato per un forum.</value>
13981395
</data>
@@ -1546,4 +1543,7 @@ Il metodo di rimozione è attualmente impostato su {0}. I tuoi argomenti verran
15461543
<data name="[RESX:UserMentions].Text" xml:space="preserve">
15471544
<value>Menzioni degli utenti</value>
15481545
</data>
1546+
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1547+
<value>Può aggiungere/gestire tag su argomenti. Qualsiasi tag inserito nei post (argomenti e/o risposte) viene aggiunto automaticamente all'argomento così come la lista dei tag disponibili nei forum.</value>
1548+
</data>
15491549
</root>

Dnn.CommunityForums/App_LocalResources/ControlPanel.ascx.nl-NL.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,9 +1540,6 @@ De verwijder-methode is momenteel ingesteld op "{0}". Uw onderwerpen worden {1}
15401540
<data name="[RESX:Tips:SecGrid:Subscribe].Text" xml:space="preserve">
15411541
<value>Kan zich aanmelden om e-mailmeldingen over nieuwe onderwerpen en antwoorden te ontvangen.</value>
15421542
</data>
1543-
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1544-
<value>Kan tags toevoegen aan onderwerpen en antwoorden.</value>
1545-
</data>
15461543
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
15471544
<value>Gebruiker met Trust-beveiliging omzeilt automatisch moderatie als deze is geconfigureerd voor een forum.</value>
15481545
</data>
@@ -1696,4 +1693,7 @@ De verwijder-methode is momenteel ingesteld op "{0}". Uw onderwerpen worden {1}
16961693
<data name="[RESX:UserMentions].Text" xml:space="preserve">
16971694
<value>Gebruikersvermeldingen</value>
16981695
</data>
1696+
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1697+
<value>Kan tags toevoegen of beheren op onderwerpen. Alle tags die in berichten (onderwerpen en/of reacties) worden ingevoerd, worden automatisch toegevoegd aan het onderwerp, evenals aan de lijst van tags die beschikbaar zijn op de forums.</value>
1698+
</data>
16991699
</root>

Dnn.CommunityForums/App_LocalResources/ControlPanel.ascx.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ Your removal method is currently set to {0}. Your topics will be {1} based upon
15081508
<value>Can sign up to receive email notifications about new topics and replies.</value>
15091509
</data>
15101510
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1511-
<value>Can add tags to topics and replies.</value>
1511+
<value>Can add/manage tags on topics. Any tags entered in posts (topics and/or replies) are automatically added to the topic as well as the list of tags available across theforums.</value>
15121512
</data>
15131513
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
15141514
<value>User with Trust security automatically bypasses moderation if configured for a forum.</value>

Dnn.CommunityForums/App_LocalResources/Controlpanel.ascx.de-DE.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,9 +1495,6 @@ Ihre Entfernungsmethode ist derzeit auf {0} eingestellt. Ihre Themen werden anh
14951495
<data name="[RESX:Tips:SecGrid:Subscribe].Text" xml:space="preserve">
14961496
<value>Sie können sich anmelden, um E-Mail-Benachrichtigungen über neue Themen und Antworten zu erhalten.</value>
14971497
</data>
1498-
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1499-
<value>Kann Tags zu Themen und Antworten hinzufügen.</value>
1500-
</data>
15011498
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
15021499
<value>Benutzer mit vertrauenswürdiger Sicherheit umgehen die Moderation automatisch, wenn sie für ein Forum konfiguriert sind.</value>
15031500
</data>
@@ -1651,4 +1648,7 @@ Ihre Entfernungsmethode ist derzeit auf {0} eingestellt. Ihre Themen werden anh
16511648
<data name="[RESX:UserMentions].Text" xml:space="preserve">
16521649
<value>Benutzerhinweise</value>
16531650
</data>
1651+
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1652+
<value>Kann Tags zu Themen hinzufügen/verwalten. Alle in Beiträgen (Themen und/oder Antworten) eingetragenen Tags werden automatisch dem Thema sowie der Liste der im Forum verfügbaren Tags hinzugefügt.</value>
1653+
</data>
16541654
</root>

Dnn.CommunityForums/App_LocalResources/Controlpanel.ascx.es-ES.resx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,9 +1390,6 @@ El método de eliminación está configurado actualmente en {0}. Los temas se {
13901390
<data name="[RESX:Tips:SecGrid:Subscribe].Text" xml:space="preserve">
13911391
<value>Puede registrarse para recibir notificaciones por correo electrónico sobre nuevos temas y respuestas.</value>
13921392
</data>
1393-
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1394-
<value>Puede agregar etiquetas a los temas y respuestas.</value>
1395-
</data>
13961393
<data name="[RESX:Tips:SecGrid:Trust].Text" xml:space="preserve">
13971394
<value>El usuario con seguridad de confianza omite automáticamente la moderación si está configurado para un foro.</value>
13981395
</data>
@@ -1546,4 +1543,7 @@ El método de eliminación está configurado actualmente en {0}. Los temas se {
15461543
<data name="[RESX:UserMentions].Text" xml:space="preserve">
15471544
<value>Menciones de usuarios</value>
15481545
</data>
1546+
<data name="[RESX:Tips:SecGrid:Tag].Text" xml:space="preserve">
1547+
<value>Puede añadir/gestionar etiquetas en los temas. Cualquier etiqueta introducida en las publicaciones (temas y/o respuestas) se añade automáticamente al tema, así como a la lista de etiquetas disponibles en los foros.</value>
1548+
</data>
15491549
</root>

Dnn.CommunityForums/App_LocalResources/LegacyTokenResources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,10 @@
426426
<data name="[FORUMSUBSCRIBE].Text" xml:space="preserve">
427427
<value>&lt;input id="amaf-chk-subs" type="checkbox" checked="[FORUM:SUBSCRIBED]" class="amaf-chk-subs" onclick="{0}" /&gt;&lt;label for="amaf-chk-subs"&gt;[RESX:Subscribe]&lt;/label&gt;</value>
428428
</data>
429+
<data name="[AF:TB:SearchURL].Text" xml:space="preserve">
430+
<value>&lt;a href="{0}" class="dcf-search-option-advanced"&gt;[RESX:SearchAdvanced]&lt;/a&gt;</value>
431+
</data>
432+
<data name="[AF:TB:SearchText].Text" xml:space="preserve">
433+
<value>&lt;span class="dcf-search-link-text"&gt;{0}&lt;/span&gt;</value>
434+
</data>
429435
</root>

Dnn.CommunityForums/Controllers/ForumUserController.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,11 +530,24 @@ internal static string GetAvatar(PortalSettings portalSettings, int userId, int
530530
string imgUrl = string.Empty;
531531
string imgTag = string.Empty;
532532

533-
if (user != null) imgUrl = user.Profile.PhotoURL;
533+
if (user != null)
534+
{
535+
imgUrl = user.Profile.PhotoURL;
536+
}
534537

535-
if (!string.IsNullOrWhiteSpace(imgUrl) && imgUrl.ToLower().EndsWith("gif"))
538+
if (!string.IsNullOrWhiteSpace(imgUrl) && imgUrl.ToLower().Contains(".gif") && !imgUrl.Equals("/images/no_avatar.gif", StringComparison.InvariantCultureIgnoreCase))
536539
{
537-
imgUrl = $"https://{portalSettings.DefaultPortalAlias}/{imgUrl}";
540+
if (!imgUrl.StartsWith("/"))
541+
{
542+
imgUrl = "/" + imgUrl;
543+
}
544+
545+
imgUrl = $"https://{portalSettings.DefaultPortalAlias}{imgUrl}";
546+
if (!string.IsNullOrEmpty(portalSettings.PortalAlias.CultureCode) && imgUrl.ToLowerInvariant().Contains($"/{portalSettings.PortalAlias.CultureCode.ToLowerInvariant()}/"))
547+
{
548+
imgUrl = imgUrl.ToLowerInvariant().Replace($"/{portalSettings.PortalAlias.CultureCode.ToLowerInvariant()}/", "/");
549+
}
550+
538551
imgTag = string.Format("<img class='af-avatar' alt='' src='{0}' height='{1}px' width='{2}px' />", imgUrl, avatarHeight, avatarWidth);
539552
}
540553
else

Dnn.CommunityForums/Controllers/ReplyController.cs

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace DotNetNuke.Modules.ActiveForums.Controllers
2626
using System.Web;
2727

2828
using DotNetNuke.Collections;
29+
using DotNetNuke.Modules.ActiveForums.Data;
2930
using DotNetNuke.Modules.ActiveForums.Enums;
3031
using DotNetNuke.Modules.ActiveForums.Services.ProcessQueue;
3132
using DotNetNuke.Modules.ActiveForums.ViewModels;
@@ -203,45 +204,49 @@ public int Reply_QuickCreate(int portalId, int moduleId, int forumId, int topicI
203204
return replyId;
204205
}
205206

206-
public int Reply_Save(int portalId, int moduleId, DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo ri)
207+
public int Reply_Save(int portalId, int moduleId, DotNetNuke.Modules.ActiveForums.Entities.ReplyInfo reply)
207208
{
208-
ri.Content.DateUpdated = DateTime.UtcNow;
209-
if (ri.ReplyId < 1)
209+
reply.Content.DateUpdated = DateTime.UtcNow;
210+
if (reply.ReplyId < 1)
210211
{
211-
ri.Content.DateCreated = DateTime.UtcNow;
212+
reply.Content.DateCreated = DateTime.UtcNow;
212213
}
213214

214215
Utilities.UpdateModuleLastContentModifiedOnDate(moduleId);
215216

216217
// Clear profile Cache to make sure the LastPostDate is updated for Flood Control
217-
DotNetNuke.Modules.ActiveForums.Controllers.ForumUserController.ClearCache(portalId, ri.Content.AuthorId);
218+
DotNetNuke.Modules.ActiveForums.Controllers.ForumUserController.ClearCache(portalId, reply.Content.AuthorId);
218219

219-
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForForum(ri.ModuleId, ri.ForumId);
220-
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForReply(ri.ModuleId, ri.ReplyId);
221-
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForTopic(ri.ModuleId, ri.TopicId);
222-
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForContent(ri.ModuleId, ri.ContentId);
223-
224-
// if existing topic, update associated journal item
225-
if (ri.ReplyId > 0)
220+
// if existing reply being edited, update associated journal item & tags
221+
if (reply.ReplyId > 0)
226222
{
227-
string fullURL = new ControlUtils().BuildUrl(portalId, ri.Forum.GetTabId(), moduleId, ri.Forum.ForumGroup.PrefixURL, ri.Forum.PrefixURL, ri.Forum.ForumGroupId, ri.ForumId, ri.TopicId, ri.Topic.TopicUrl, -1, -1, string.Empty, 1, ri.ReplyId, ri.Forum.SocialGroupId);
223+
string fullURL = new ControlUtils().BuildUrl(portalId, reply.Forum.GetTabId(), moduleId, reply.Forum.ForumGroup.PrefixURL, reply.Forum.PrefixURL, reply.Forum.ForumGroupId, reply.ForumId, reply.TopicId, reply.Topic.TopicUrl, -1, -1, string.Empty, 1, reply.ReplyId, reply.Forum.SocialGroupId);
228224

229225
if (fullURL.Contains("~/"))
230226
{
231-
fullURL = Utilities.NavigateURL(ri.Forum.GetTabId(), string.Empty, new string[] { $"{ParamKeys.TopicId}={ri.TopicId}", $"{ParamKeys.ContentJumpId}={ri.ReplyId}", });
227+
fullURL = Utilities.NavigateURL(reply.Forum.GetTabId(), string.Empty, new string[] { $"{ParamKeys.TopicId}={reply.TopicId}", $"{ParamKeys.ContentJumpId}={reply.ReplyId}", });
232228
}
233229

234230
if (fullURL.EndsWith("/"))
235231
{
236-
fullURL += Utilities.UseFriendlyURLs(moduleId) ? $"#{ri.ReplyId}" : $"{ParamKeys.ContentJumpId}={ri.ReplyId}";
232+
fullURL += Utilities.UseFriendlyURLs(moduleId) ? $"#{reply.ReplyId}" : $"{ParamKeys.ContentJumpId}={reply.ReplyId}";
237233
}
238234

239-
new Social().UpdateJournalItemForPost(ri.PortalId, ri.ModuleId, ri.Forum.GetTabId(), ri.ForumId, ri.TopicId, ri.ReplyId, ri.Author.AuthorId, fullURL, ri.Content.Subject, string.Empty, ri.Content.Body);
235+
DotNetNuke.Modules.ActiveForums.Controllers.TagController.UpdateTopicTags(reply);
236+
new Social().UpdateJournalItemForPost(reply.PortalId, reply.ModuleId, reply.Forum.GetTabId(), reply.ForumId, reply.TopicId, reply.ReplyId, reply.Author.AuthorId, fullURL, reply.Content.Subject, string.Empty, reply.Content.Body);
240237
}
241238

242-
int replyId = Convert.ToInt32(DotNetNuke.Modules.ActiveForums.DataProvider.Instance().Reply_Save(portalId, ri.TopicId, ri.ReplyId, ri.ReplyToId, ri.StatusId, ri.IsApproved, ri.IsDeleted, ri.Content.Subject.Trim(), ri.Content.Body.Trim(), ri.Content.DateCreated, ri.Content.DateUpdated, ri.Content.AuthorId, ri.Content.AuthorName, ri.Content.IPAddress));
243-
DotNetNuke.Modules.ActiveForums.Controllers.TopicController.SaveToForum(moduleId, ri.ForumId, ri.TopicId);
244-
DotNetNuke.Modules.ActiveForums.Controllers.ForumController.UpdateForumLastUpdates(ri.ForumId);
239+
var forum = new DotNetNuke.Modules.ActiveForums.Controllers.ForumController().GetById(forumId: reply.ForumId, moduleId: moduleId);
240+
DotNetNuke.Modules.ActiveForums.Controllers.TagController.CleanUpTags(reply, forum);
241+
int replyId = Convert.ToInt32(DotNetNuke.Modules.ActiveForums.DataProvider.Instance().Reply_Save(portalId, reply.TopicId, reply.ReplyId, reply.ReplyToId, reply.StatusId, reply.IsApproved, reply.IsDeleted, reply.Content.Subject.Trim(), reply.Content.Body.Trim(), reply.Content.DateCreated, reply.Content.DateUpdated, reply.Content.AuthorId, reply.Content.AuthorName, reply.Content.IPAddress));
242+
DotNetNuke.Modules.ActiveForums.Controllers.TopicController.SaveToForum(moduleId, reply.ForumId, reply.TopicId);
243+
DotNetNuke.Modules.ActiveForums.Controllers.ForumController.UpdateForumLastUpdates(reply.ForumId);
244+
245+
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForForum(reply.ModuleId, reply.ForumId);
246+
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForReply(reply.ModuleId, reply.ReplyId);
247+
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForTopic(reply.ModuleId, reply.TopicId);
248+
DotNetNuke.Modules.ActiveForums.DataCache.ContentCacheClearForContent(reply.ModuleId, reply.ContentId);
249+
245250
return replyId;
246251
}
247252

@@ -321,12 +326,12 @@ internal static bool ProcessApprovedReplyAfterAction(int portalId, int tabId, in
321326

322327
Utilities.UpdateModuleLastContentModifiedOnDate(moduleId);
323328

324-
if (reply.IsApproved && reply.Content.AuthorId > 0)
329+
if (reply.Content.AuthorId > 0)
325330
{
326331
DotNetNuke.Modules.ActiveForums.Controllers.ForumUserController.UpdateUserReplyCount(portalId, reply.Content.AuthorId);
327332
}
328333

329-
334+
DotNetNuke.Modules.ActiveForums.Controllers.TagController.UpdateTopicTags(reply);
330335
DotNetNuke.Modules.ActiveForums.Controllers.UserMentionController.ProcessUserMentions(reply);
331336

332337
return true;

0 commit comments

Comments
 (0)