]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Bookmark/actions/newbookmark.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / plugins / Bookmark / actions / newbookmark.php
index 57be783b3805003ad8d4ba8941ded6ae75bc77c2..c3987a28b8dfa730c07d60e642680a222c330e94 100644 (file)
@@ -150,9 +150,7 @@ class NewbookmarkAction extends Action
 
         } catch (ClientException $ce) {
             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 an AJAX error occurs
                 $this->element('title', null, _('Ajax Error'));
@@ -160,7 +158,7 @@ class NewbookmarkAction extends Action
                 $this->elementStart('body');
                 $this->element('p', array('id' => 'error'), $ce->getMessage());
                 $this->elementEnd('body');
-                $this->elementEnd('html');
+                $this->endHTML();
                 return;
             } else {
                 $this->error = $ce->getMessage();
@@ -170,9 +168,7 @@ class NewbookmarkAction 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 posting a bookmark.
             $this->element('title', null, _m('Bookmark posted'));
@@ -180,9 +176,9 @@ class NewbookmarkAction 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);
         }
     }
 
@@ -195,7 +191,7 @@ class NewbookmarkAction extends Action
      *
      * @return void
      */
-    function showNotice($notice)
+    function showNotice(Notice $notice)
     {
         class_exists('NoticeList'); // @fixme hack for autoloader
         $nli = new NoticeListItem($notice, $this);
@@ -233,7 +229,7 @@ class NewbookmarkAction extends Action
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {