Simplify implementation of the report function
authorMarcel Werk <burntime@woltlab.com>
Thu, 6 Apr 2023 12:08:51 +0000 (14:08 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 6 Apr 2023 12:08:51 +0000 (14:08 +0200)
com.woltlab.wcf/templates/article.tpl
com.woltlab.wcf/templates/comments.tpl
com.woltlab.wcf/templates/user.tpl
wcfsetup/install/files/lib/system/event/listener/PreloadPhrasesCollectingListener.class.php

index 6466ad8215bd9f9558b3be04f771dbc6d9c72ded..a4814cb41afae4be1c76e56179e8383a0bf8ad1e 100644 (file)
        </script>
 {/if}
 
-{if $__wcf->session->getPermission('user.profile.canReportContent')}
-       <script data-relocate="true">
-               $(function() {
-                       WCF.Language.addObject({
-                               'wcf.moderation.report.reportContent': '{jslang}wcf.moderation.report.reportContent{/jslang}',
-                               'wcf.moderation.report.success': '{jslang}wcf.moderation.report.success{/jslang}'
-                       });
-               });
-       </script>
-{/if}
-
 {include file='footer'}
index fd3f70e68a7617f47aee307c565b9ec42b699ac8..616a5576c839381df8265e6a9ff57d03469a7972 100644 (file)
@@ -4,8 +4,6 @@
                        'wcf.comment.guestDialog.title': '{jslang}wcf.comment.guestDialog.title{/jslang}',
                        'wcf.comment.more': '{jslang}wcf.comment.more{/jslang}',
                        'wcf.comment.response.more': '{jslang}wcf.comment.response.more{/jslang}',
-                       'wcf.moderation.report.reportContent': '{jslang}wcf.moderation.report.reportContent{/jslang}',
-                       'wcf.moderation.report.success': '{jslang}wcf.moderation.report.success{/jslang}'
                });
 
                setup('{@$commentContainerID|encodeJS}');
index 67d22d21e13d29b23cda2d1538341fa1d4b7eb0c..ad069b66994fb9d8bbbb63b3b8b87e147f4e38aa 100644 (file)
                                new WCF.User.Profile.Editor({@$user->userID}, {if $editOnInit}true{else}false{/if});
                        {/if}
                        
-                       {if $__wcf->session->getPermission('user.profile.canReportContent')}
-                               WCF.Language.addObject({
-                                       'wcf.moderation.report.reportContent': '{jslang}wcf.user.profile.report{/jslang}',
-                                       'wcf.moderation.report.success': '{jslang}wcf.moderation.report.success{/jslang}'
-                               });
-                       {/if}
-                       
                        {event name='javascriptInit'}
                });
 
index a8c7611bd599a8d063d4f9f2edc4fc438bddc512..bb3b901bd834b097f14a8ee54f059e1693b86845 100644 (file)
@@ -130,6 +130,8 @@ final class PreloadPhrasesCollectingListener
         $event->preload('wcf.message.share.permalink.html');
         $event->preload('wcf.message.share.socialMedia');
 
+        $event->preload('wcf.moderation.report.reportContent');
+
         $event->preload('wcf.page.jumpTo');
         $event->preload('wcf.page.jumpTo.description');
         $event->preload('wcf.page.jumpTo.pageNo');