aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/controller/helper.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2015-01-30 13:14:33 +0100
committerAndreas Fischer <bantu@phpbb.com>2015-01-30 13:14:33 +0100
commitb78ae290e86d1789a293580c1db2c932876d194c (patch)
tree956fb9d329585eb12f4dce92bf688f07a4a0dae9 /phpBB/phpbb/controller/helper.php
parent1642e560dcc1625c4d52f265a98825e4b81c12c3 (diff)
parentab07be81573c155d46dcb739a3811b1e958139a5 (diff)
downloadforums-b78ae290e86d1789a293580c1db2c932876d194c.tar
forums-b78ae290e86d1789a293580c1db2c932876d194c.tar.gz
forums-b78ae290e86d1789a293580c1db2c932876d194c.tar.bz2
forums-b78ae290e86d1789a293580c1db2c932876d194c.tar.xz
forums-b78ae290e86d1789a293580c1db2c932876d194c.zip
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/13553] Add a method to the controller helper to display a message [prep-release-3.1.3] Add changelog for 3.1.3-RC1 [prep-release-3.1.3] Prepare Changelog [prep-release-3.1.3] Add migration for 3.1.3-RC1 [prep-release-3.1.3] Update version to 3.1.2-RC1 Conflicts: build/build.xml phpBB/includes/constants.php phpBB/install/schemas/schema_data.sql phpBB/styles/prosilver/style.cfg phpBB/styles/subsilver2/style.cfg
Diffstat (limited to 'phpBB/phpbb/controller/helper.php')
-rw-r--r--phpBB/phpbb/controller/helper.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 76acfacf40..8c1aaac9dc 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -192,9 +192,24 @@ class helper
*/
public function error($message, $code = 500)
{
+ return $this->message($message, false, $code);
+ }
+
+ /**
+ * Output a message
+ *
+ * In case of an error, please throw an exception instead
+ *
+ * @param string $message The message to display
+ * @param string|false $title Title for the message
+ * @param int $code The HTTP status code (e.g. 404, 500, 503, etc.)
+ * @return Response A Response instance
+ */
+ public function message($message, $title = false, $code = 200)
+ {
$this->template->assign_vars(array(
'MESSAGE_TEXT' => $message,
- 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
+ 'MESSAGE_TITLE' => ($title === false) ? $this->user->lang('INFORMATION') : $title,
));
return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code);