]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
Change the title of NewnoticeAction if replying
[quix0rs-gnu-social.git] / actions / newnotice.php
index d1e47fec5c095b994240f870d296be01303a7caf..ff1af6344255a13626f84181a2e24a16e551f9e2 100644 (file)
@@ -62,6 +62,9 @@ class NewnoticeAction extends FormAction
             // TRANS: Page title after sending a notice.
             return _('Notice posted');
         }
+        if ($this->int('inreplyto')) {
+            return _m('TITLE', 'New reply');
+        }
         // TRANS: Page title for sending a new notice.
         return _m('TITLE','New notice');
     }
@@ -73,6 +76,10 @@ class NewnoticeAction extends FormAction
                 $this->formOpts[$opt] = $this->trimmed($opt);
             }
         }
+
+        // Backwards compatibility for "share this" widget things.
+        // If no 'content', use 'status_textarea'
+        $this->formOpts['content'] = $this->trimmed('content') ?: $this->trimmed('status_textarea');
     }
 
     /**
@@ -106,7 +113,7 @@ class NewnoticeAction extends FormAction
         $cmd = $inter->handle_command($user, $content);
 
         if ($cmd) {
-            if (StatusNet::isAjax()) {
+            if (GNUsocial::isAjax()) {
                 $cmd->execute(new AjaxWebChannel($this));
             } else {
                 $cmd->execute(new WebChannel($this));
@@ -124,7 +131,7 @@ class NewnoticeAction extends FormAction
                                        Notice::maxContent()));
         }
 
-        $replyto = intval($this->trimmed('inreplyto'));
+        $replyto = $this->int('inreplyto');
         if ($replyto) {
             $options['reply_to'] = $replyto;
         }
@@ -191,7 +198,7 @@ class NewnoticeAction extends FormAction
 
         Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options));
 
-        if (!StatusNet::isAjax()) {
+        if (!GNUsocial::isAjax()) {
             $url = common_local_url('shownotice', array('notice' => $this->stored->id));
             common_redirect($url, 303);
         }