]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Added link to Subscriptions page to XHR get the ostatus sub form
authorSarven Capadisli <csarven@status.net>
Mon, 22 Feb 2010 16:07:48 +0000 (17:07 +0100)
committerSarven Capadisli <csarven@status.net>
Mon, 22 Feb 2010 16:07:48 +0000 (17:07 +0100)
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/ostatussub.php
plugins/OStatus/theme/base/css/ostatus.css

index 3ac2bb87d74be44beeeeebf7e4cc4bdf467df6ae..0b0317316c8ae672d2974d00ddcf6dbae91d6b8c 100644 (file)
@@ -497,4 +497,21 @@ class OStatusPlugin extends Plugin
         }
         return true;
     }
+
+    function onStartShowSubscriptionsContent($action)
+    {
+        $user = common_current_user();
+        if ($user && ($user->id == $action->profile->id)) {
+            $action->elementStart('div', 'entity_actions');
+            $action->elementStart('p', array('id' => 'entity_remote_subscribe',
+                                             'class' => 'entity_subscribe'));
+            $action->element('a', array('href' => common_local_url('ostatussub'),
+                                        'class' => 'entity_remote_subscribe')
+                                , _m('Subscribe to remote user'));
+            $action->elementEnd('p');
+            $action->elementEnd('div');
+        }
+
+        return true;
+    }
 }
index 8cb8e2ae7c89e531ae2a5688a3430aaeb41fd8c5..95dec19afc5e9890a6940e5d950ff3b0e4e602b6 100644 (file)
@@ -55,7 +55,20 @@ class OStatusSubAction extends Action
     function showForm($error=null)
     {
         $this->error = $error;
-        $this->showPage();
+        if ($this->boolean('ajax')) {
+            header('Content-Type: text/xml;charset=utf-8');
+            $this->xw->startDocument('1.0', 'UTF-8');
+            $this->elementStart('html');
+            $this->elementStart('head');
+            $this->element('title', null, _m('Subscribe to user'));
+            $this->elementEnd('head');
+            $this->elementStart('body');
+            $this->showContent();
+            $this->elementEnd('body');
+            $this->elementEnd('html');
+        } else {
+            $this->showPage();
+        }
     }
 
     function showPageNotice()
@@ -81,7 +94,7 @@ class OStatusSubAction extends Action
         $profile = $user->getProfile();
 
         $this->elementStart('form', array('method' => 'post',
-                                          'id' => 'ostatus_sub',
+                                          'id' => 'form_ostatus_sub',
                                           'class' => 'form_settings',
                                           'action' =>
                                           common_local_url('ostatussub')));
@@ -141,7 +154,7 @@ class OStatusSubAction extends Action
             if ($this->profile_uri) {
                 $this->validateAndPreview();
             } else {
-                $this->showPage();
+                $this->showForm();
             }
         }
     }
index 9bc90a7315b0903ef9b51e855eb162b7d82421a0..feeeb47d38209c7fa76acbf6ec25c1ec97ae1433 100644 (file)
@@ -7,24 +7,42 @@
  * @link      http://status.net/
  */
 
-#form_ostatus_connect.dialogbox {
+#form_ostatus_connect.dialogbox,
+#form_ostatus_sub.dialogbox {
 width:70%;
 background-image:none;
 }
-#form_ostatus_connect.dialogbox .form_data label {
+#form_ostatus_sub.dialogbox {
+width:65%;
+}
+#form_ostatus_connect.dialogbox .form_data label,
+#form_ostatus_sub.dialogbox .form_data label {
 width:34%;
 }
-#form_ostatus_connect.dialogbox .form_data input {
+#form_ostatus_connect.dialogbox .form_data input,
+#form_ostatus_sub.dialogbox .form_data input {
 width:57%;
 }
-#form_ostatus_connect.dialogbox .form_data .form_guide {
+#form_ostatus_connect.dialogbox .form_data .form_guide,
+#form_ostatus_sub.dialogbox .form_data .form_guide {
 margin-left:36%;
 }
 
-#form_ostatus_connect.dialogbox #ostatus_nickname {
+#form_ostatus_connect.dialogbox #ostatus_nickname,
+#form_ostatus_sub.dialogbox #ostatus_nickname {
 display:none;
 }
 
-#form_ostatus_connect.dialogbox .submit_dialogbox  {
+#form_ostatus_connect.dialogbox .submit_dialogbox,
+#form_ostatus_sub.dialogbox .submit_dialogbox {
 min-width:96px;
 }
+
+#subscriptions #entity_remote_subscribe {
+padding:0;
+float:right;
+}
+
+#subscriptions .entity_remote_subscribe {
+float:right;
+}