aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
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/includes/functions_display.php
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/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php27
1 files changed, 4 insertions, 23 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index a6c9c529d6..64d20924d9 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1097,33 +1097,14 @@ function display_custom_bbcodes()
/**
* Display reasons
+*
+* @deprecated 3.2.0-dev
*/
function display_reasons($reason_id = 0)
{
- global $db, $user, $template;
-
- $sql = 'SELECT *
- FROM ' . REPORTS_REASONS_TABLE . '
- ORDER BY reason_order ASC';
- $result = $db->sql_query($sql);
+ global $phpbb_container;
- while ($row = $db->sql_fetchrow($result))
- {
- // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
- {
- $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
- $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
- }
-
- $template->assign_block_vars('reason', array(
- 'ID' => $row['reason_id'],
- 'TITLE' => $row['reason_title'],
- 'DESCRIPTION' => $row['reason_description'],
- 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false)
- );
- }
- $db->sql_freeresult($result);
+ $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id);
}
/**