summaryrefslogtreecommitdiff
path: root/lib/action.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-12-07 10:50:05 -0800
committerBrion Vibber <brion@pobox.com>2010-12-07 10:50:05 -0800
commit9df856e667a12cd217576263efbc72fff12692d9 (patch)
treedc8d588e8b01d1ec788c78d6aec10a9b9d26bec6 /lib/action.php
parent01f32e3998b8d031d2a39e2d0506253142b6632e (diff)
parent4b4b763255ad3b2bff8f18da2bd3927b52a54e55 (diff)
Merge branch '0.9.x' into merge
Conflicts: README actions/hostmeta.php classes/File_redirection.php lib/common.php lib/designsettings.php lib/router.php lib/util.php lib/xmppmanager.php plugins/OStatus/OStatusPlugin.php
Diffstat (limited to 'lib/action.php')
-rw-r--r--lib/action.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/lib/action.php b/lib/action.php
index 427b85427..0e5d7ae36 100644
--- a/lib/action.php
+++ b/lib/action.php
@@ -274,15 +274,15 @@ class Action extends HTMLOutputter // lawsuit
if (Event::handle('StartShowScripts', array($this))) {
if (Event::handle('StartShowJQueryScripts', array($this))) {
$this->script('jquery.min.js');
- $this->script('jquery.form.js');
- $this->script('jquery.cookie.js');
- $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js').'"); }');
+ $this->script('jquery.form.min.js');
+ $this->script('jquery.cookie.min.js');
+ $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.min.js').'"); }');
$this->script('jquery.joverlay.min.js');
Event::handle('EndShowJQueryScripts', array($this));
}
if (Event::handle('StartShowStatusNetScripts', array($this)) &&
Event::handle('StartShowLaconicaScripts', array($this))) {
- $this->script('util.js');
+ $this->script('util.min.js');
$this->showScriptMessages();
// Frame-busting code to avoid clickjacking attacks.
$this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }');
@@ -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;
}
@@ -1404,4 +1409,15 @@ class Action extends HTMLOutputter // lawsuit
$this->clientError(_('There was a problem with your session token.'));
}
}
+
+ /**
+ * Check if the current request is a POST
+ *
+ * @return boolean true if POST; otherwise false.
+ */
+
+ function isPost()
+ {
+ return ($_SERVER['REQUEST_METHOD'] == 'POST');
+ }
}