]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/QnA/actions/qnanewquestion.php
Trying to debug some stuff regarding oEmbed
[quix0rs-gnu-social.git] / plugins / QnA / actions / qnanewquestion.php
index 48542ab06e742410c6f5ac10e607feecc2509a3f..79ef3a6eb05c99d334d169899f4fdc81d79550c6 100644 (file)
@@ -76,8 +76,8 @@ class QnanewquestionAction extends Action
         $this->user = common_current_user();
 
         if (empty($this->user)) {
-            // TRANS: Client exception thrown trying to create a Question while not logged in.
             throw new ClientException(
+                // TRANS: Client exception thrown trying to create a Question while not logged in.
                 _m('You must be logged in to post a question.'),
                 403
             );
@@ -121,7 +121,7 @@ class QnanewquestionAction extends Action
     function newQuestion()
     {
         if ($this->boolean('ajax')) {
-            StatusNet::setApi(true);
+            GNUsocial::setApi(true);
         }
         try {
             if (empty($this->title)) {
@@ -148,9 +148,7 @@ class QnanewquestionAction extends Action
         }
 
         if ($this->boolean('ajax')) {
-            header('Content-Type: text/xml;charset=utf-8');
-            $this->xw->startDocument('1.0', 'UTF-8');
-            $this->elementStart('html');
+            $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
             // TRANS: Page title after sending a notice.
             $this->element('title', null, _m('Question posted'));
@@ -158,9 +156,9 @@ class QnanewquestionAction extends Action
             $this->elementStart('body');
             $this->showNotice($saved);
             $this->elementEnd('body');
-            $this->elementEnd('html');
+            $this->endHTML();
         } else {
-            common_redirect($saved->bestUrl(), 303);
+            common_redirect($saved->getUrl(), 303);
         }
     }
 
@@ -240,5 +238,4 @@ class NoticeQuestionListItem extends NoticeListItem
         $this->out->element('ul', 'notices threaded-replies xoxo');
         parent::showEnd();
     }
-
-}
\ No newline at end of file
+}