summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-11-17 12:19:01 -0500
committerEvan Prodromou <evan@status.net>2010-11-17 12:19:01 -0500
commitbacc3d2a74ca09e0287ca7b14f2bb746810311da (patch)
tree9a9f6c42ed9eb0df760fc9254c8a0e1ae0851cbe /lib/action.php
parenta81bc5c0fd3c6b1542554270bbaff81d4e70cd67 (diff)
move EndScriptMessages event into if block
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/action.php b/lib/action.php
index 17d3e2311..c2285894e 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -300,9 +300,11 @@ class Action extends HTMLOutputter // lawsuit
* events and appending to the array. Try to avoid adding strings that won't be used, as
* they'll be added to HTML output.
*/
+
function showScriptMessages()
{
$messages = array();
+
if (Event::handle('StartScriptMessages', array($this, &$messages))) {
// Common messages needed for timeline views etc...
@@ -310,11 +312,14 @@ class Action extends HTMLOutputter // lawsuit
$messages['showmore_tooltip'] = _m('TOOLTIP', 'Show more');
$messages = array_merge($messages, $this->getScriptMessages());
+
+ Event::handle('EndScriptMessages', array($this, &$messages));
}
- Event::handle('EndScriptMessages', array($this, &$messages));
- if ($messages) {
+
+ if (!empty($messages)) {
$this->inlineScript('SN.messages=' . json_encode($messages));
}
+
return $messages;
}