Added link to Subscriptions page to XHR get the ostatus sub form

This commit is contained in:
Sarven Capadisli 2010-02-22 17:07:48 +01:00
parent e6ce04cbce
commit 3569493ba7
3 changed files with 57 additions and 9 deletions

View File

@ -497,4 +497,21 @@ class OStatusPlugin extends Plugin
} }
return true; 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;
}
} }

View File

@ -55,8 +55,21 @@ class OStatusSubAction extends Action
function showForm($error=null) function showForm($error=null)
{ {
$this->error = $error; $this->error = $error;
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(); $this->showPage();
} }
}
function showPageNotice() function showPageNotice()
{ {
@ -81,7 +94,7 @@ class OStatusSubAction extends Action
$profile = $user->getProfile(); $profile = $user->getProfile();
$this->elementStart('form', array('method' => 'post', $this->elementStart('form', array('method' => 'post',
'id' => 'ostatus_sub', 'id' => 'form_ostatus_sub',
'class' => 'form_settings', 'class' => 'form_settings',
'action' => 'action' =>
common_local_url('ostatussub'))); common_local_url('ostatussub')));
@ -141,7 +154,7 @@ class OStatusSubAction extends Action
if ($this->profile_uri) { if ($this->profile_uri) {
$this->validateAndPreview(); $this->validateAndPreview();
} else { } else {
$this->showPage(); $this->showForm();
} }
} }
} }

View File

@ -7,24 +7,42 @@
* @link http://status.net/ * @link http://status.net/
*/ */
#form_ostatus_connect.dialogbox { #form_ostatus_connect.dialogbox,
#form_ostatus_sub.dialogbox {
width:70%; width:70%;
background-image:none; 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%; 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%; 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%; margin-left:36%;
} }
#form_ostatus_connect.dialogbox #ostatus_nickname { #form_ostatus_connect.dialogbox #ostatus_nickname,
#form_ostatus_sub.dialogbox #ostatus_nickname {
display:none; display:none;
} }
#form_ostatus_connect.dialogbox .submit_dialogbox { #form_ostatus_connect.dialogbox .submit_dialogbox,
#form_ostatus_sub.dialogbox .submit_dialogbox {
min-width:96px; min-width:96px;
} }
#subscriptions #entity_remote_subscribe {
padding:0;
float:right;
}
#subscriptions .entity_remote_subscribe {
float:right;
}