]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/SubMirror/actions/mirrorsettings.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / plugins / SubMirror / actions / mirrorsettings.php
index 000d7ecad09c5045b64becd795a76404264e4518..f0d00d6e55923008cccda46a1ae2b7a9e5b4e0ee 100644 (file)
@@ -25,9 +25,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET') && !defined('LACONICA')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL') && !defined('STATUSNET')) { exit(1); }
 
 class MirrorSettingsAction extends SettingsAction
 {
@@ -52,7 +50,7 @@ class MirrorSettingsAction extends SettingsAction
     {
         // TRANS: Page instructions.
         return _m('You can mirror updates from many RSS and Atom feeds ' .
-                  'into your StatusNet timeline!');
+                  'into your GNU social timeline!');
     }
 
     /**
@@ -91,8 +89,9 @@ class MirrorSettingsAction extends SettingsAction
 
     function showFeedForm($mirror)
     {
-        $profile = Profile::staticGet('id', $mirror->subscribed);
-        if ($profile) {
+        $profile = Profile::getKV('id', $mirror->subscribed);
+
+        if ($profile instanceof Profile) {
             $form = new EditMirrorForm($this, $profile);
             $form->show();
         }
@@ -103,9 +102,6 @@ class MirrorSettingsAction extends SettingsAction
         switch ($this->arg('provider')) {
         case 'statusnet':
             break;
-        case 'twitter':
-            $form = new AddTwitterMirrorForm($this);
-            break;
         case 'wordpress':
             break;
         case 'linkedin':
@@ -123,11 +119,10 @@ class MirrorSettingsAction extends SettingsAction
      *
      * @todo move the ajax display handling to common code
      */
-    function handle($args)
+    function handle(array $args=array())
     {
         if ($this->boolean('ajax')) {
-            header('Content-Type: text/html;charset=utf-8');
-            $this->elementStart('html');
+            $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
             // TRANS: Title for page with form to add a mirror feed provider on.
             $this->element('title', null, _m('Provider add'));
@@ -137,7 +132,7 @@ class MirrorSettingsAction extends SettingsAction
             $this->showAddFeedForm();
 
             $this->elementEnd('body');
-            $this->elementEnd('html');
+            $this->endHTML();
         } else {
             return parent::handle($args);
         }