aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/config
diff options
context:
space:
mode:
authorMateBartus <mate.bartus@gmail.com>2015-02-25 21:13:20 +0100
committerMateBartus <mate.bartus@gmail.com>2015-04-16 11:29:11 +0200
commita089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f (patch)
tree1891a57f125191ae30e8ffe94b1ecd0d97aabce9 /phpBB/config
parent2c0b1252c8ee7f9c40f15587aa00aa2e70a7168f (diff)
downloadforums-a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f.tar
forums-a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f.tar.gz
forums-a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f.tar.bz2
forums-a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f.tar.xz
forums-a089ff5eb0dcdab83c6c2e64cb0e7cb618aec41f.zip
[ticket/13654] Moving reporting into controller
Moving report.php's content into different services and controllers to better comply with the MVC model. Also implementing: * Replacement for reasons_display() * Adding assign_meta_refresh_var() to \controller\helper * Adding separate routes for easy configuration * Updating unit tests to expect to correct results * Add BC tests PHPBB3-13654
Diffstat (limited to 'phpBB/config')
-rw-r--r--phpBB/config/default/container/services.yml1
-rw-r--r--phpBB/config/default/container/services_report.yml53
-rw-r--r--phpBB/config/default/routing/report.yml17
-rw-r--r--phpBB/config/default/routing/routing.yml3
4 files changed, 74 insertions, 0 deletions
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml
index 4f1aba953f..c964302b86 100644
--- a/phpBB/config/default/container/services.yml
+++ b/phpBB/config/default/container/services.yml
@@ -13,6 +13,7 @@ imports:
- { resource: services_notification.yml }
- { resource: services_password.yml }
- { resource: services_profilefield.yml }
+ - { resource: services_report.yml }
- { resource: services_text_formatter.yml }
- { resource: services_twig.yml }
- { resource: services_user.yml }
diff --git a/phpBB/config/default/container/services_report.yml b/phpBB/config/default/container/services_report.yml
new file mode 100644
index 0000000000..4bf929429e
--- /dev/null
+++ b/phpBB/config/default/container/services_report.yml
@@ -0,0 +1,53 @@
+services:
+# ----- Report controller -----
+ phpbb.report.controller:
+ class: phpbb\report\controller\report
+ arguments:
+ - @config
+ - @user
+ - @template
+ - @controller.helper
+ - @request
+ - @captcha.factory
+ - @phpbb.report.handler_factory
+ - @phpbb.report.report_reason_list_provider
+ - %core.root_path%
+ - %core.php_ext%
+
+# ----- Report handler factory -----
+ phpbb.report.handler_factory:
+ class: phpbb\report\handler_factory
+ arguments:
+ - @service_container
+
+# ----- Report UI provider -----
+ phpbb.report.report_reason_list_provider:
+ class: phpbb\report\report_reason_list_provider
+ arguments:
+ - @dbal.conn.driver
+ - @template
+ - @user
+
+# ----- Report handlers -----
+# Scope MUST be prototype for all the handlers to work correctly.
+ phpbb.report.handlers.report_handler_pm:
+ class: phpbb\report\report_handler_pm
+ scope: prototype
+ arguments:
+ - @dbal.conn.driver
+ - @dispatcher
+ - @config
+ - @auth
+ - @user
+ - @notification_manager
+
+ phpbb.report.handlers.report_handler_post:
+ class: phpbb\report\report_handler_post
+ scope: prototype
+ arguments:
+ - @dbal.conn.driver
+ - @dispatcher
+ - @config
+ - @auth
+ - @user
+ - @notification_manager
diff --git a/phpBB/config/default/routing/report.yml b/phpBB/config/default/routing/report.yml
new file mode 100644
index 0000000000..dbe2d853c0
--- /dev/null
+++ b/phpBB/config/default/routing/report.yml
@@ -0,0 +1,17 @@
+phpbb_report_pm_controller:
+ path: /pm/{id}/report
+ methods: [GET, POST]
+ defaults:
+ _controller: phpbb.report.controller:handle
+ mode: "pm"
+ requirements:
+ id: \d+
+
+phpbb_report_post_controller:
+ path: /post/{id}/report
+ methods: [GET, POST]
+ defaults:
+ _controller: phpbb.report.controller:handle
+ mode: "post"
+ requirements:
+ id: \d+
diff --git a/phpBB/config/default/routing/routing.yml b/phpBB/config/default/routing/routing.yml
index d6881f1959..b7e7a69b4f 100644
--- a/phpBB/config/default/routing/routing.yml
+++ b/phpBB/config/default/routing/routing.yml
@@ -11,3 +11,6 @@
phpbb_help_routing:
resource: "help.yml"
prefix: /help
+
+phpbb_report_routing:
+ resource: "report.yml"