Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing

This commit is contained in:
Brion Vibber 2010-03-03 09:33:38 -08:00
commit 9801c60bea
5 changed files with 84 additions and 31 deletions

View File

@ -363,6 +363,14 @@ EndProfileRemoteSubscribe: After showing the link to remote subscription
- $userprofile: UserProfile widget
- &$profile: the profile being shown
StartGroupSubscribe: Before showing the link to remote subscription
- $action: the current action
- $group: the group being shown
EndGroupSubscribe: After showing the link to remote subscription
- $action: the current action
- $group: the group being shown
StartProfilePageProfileSection: Starting to show the section of the
profile page with the actual profile data;
hook to prevent showing the profile (e.g.)
@ -776,6 +784,12 @@ StartShowAllContent: before showing the all (you and friends) content
EndShowAllContent: after showing the all (you and friends) content
- $action: the current action
StartShowSubscriptionsMiniList: at the start of subscriptions mini list
- $action: the current action
EndShowSubscriptionsMiniList: at the end of subscriptions mini list
- $action: the current action
StartDeleteUserForm: starting the data in the form for deleting a user
- $action: action being shown
- $user: user being deleted

View File

@ -300,20 +300,22 @@ class ShowgroupAction extends GroupDesignAction
$this->elementStart('div', 'entity_actions');
$this->element('h2', null, _('Group actions'));
$this->elementStart('ul');
$this->elementStart('li', 'entity_subscribe');
$cur = common_current_user();
if ($cur) {
if ($cur->isMember($this->group)) {
$lf = new LeaveForm($this, $this->group);
$lf->show();
} else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
$jf = new JoinForm($this, $this->group);
$jf->show();
if (Event::handle('StartGroupSubscribe', array($this, $this->group))) {
$this->elementStart('li', 'entity_subscribe');
$cur = common_current_user();
if ($cur) {
if ($cur->isMember($this->group)) {
$lf = new LeaveForm($this, $this->group);
$lf->show();
} else if (!Group_block::isBlocked($this->group, $cur->getProfile())) {
$jf = new JoinForm($this, $this->group);
$jf->show();
}
}
$this->elementEnd('li');
Event::handle('EndGroupSubscribe', array($this, $this->group));
}
$this->elementEnd('li');
$this->elementEnd('ul');
$this->elementEnd('div');
}

View File

@ -106,27 +106,30 @@ class ProfileAction extends OwnerDesignAction
$this->elementStart('div', array('id' => 'entity_subscriptions',
'class' => 'section'));
$this->element('h2', null, _('Subscriptions'));
if (Event::handle('StartShowSubscriptionsMiniList', array($this))) {
$this->element('h2', null, _('Subscriptions'));
$cnt = 0;
$cnt = 0;
if (!empty($profile)) {
$pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show();
if ($cnt == 0) {
$this->element('p', null, _('(None)'));
if (!empty($profile)) {
$pml = new ProfileMiniList($profile, $this);
$cnt = $pml->show();
if ($cnt == 0) {
$this->element('p', null, _('(None)'));
}
}
}
if ($cnt > PROFILES_PER_MINILIST) {
$this->elementStart('p');
$this->element('a', array('href' => common_local_url('subscriptions',
array('nickname' => $this->profile->nickname)),
'class' => 'more'),
_('All subscriptions'));
$this->elementEnd('p');
}
if ($cnt > PROFILES_PER_MINILIST) {
$this->elementStart('p');
$this->element('a', array('href' => common_local_url('subscriptions',
array('nickname' => $this->profile->nickname)),
'class' => 'more'),
_('All subscriptions'));
$this->elementEnd('p');
}
Event::handle('EndShowSubscriptionsMiniList', array($this));
}
$this->elementEnd('div');
}

View File

@ -210,6 +210,26 @@ class OStatusPlugin extends Plugin
return false;
}
function onStartGroupSubscribe($output, $group)
{
$cur = common_current_user();
if (empty($cur)) {
// Add an OStatus subscribe
$output->elementStart('li', 'entity_subscribe');
$url = common_local_url('ostatusinit',
array('nickname' => $group->nickname));
$output->element('a', array('href' => $url,
'class' => 'entity_remote_subscribe'),
_m('Join'));
$output->elementEnd('li');
}
return false;
}
/**
* Check if we've got remote replies to send via Salmon.
*
@ -711,7 +731,7 @@ class OStatusPlugin extends Plugin
return true;
}
function onStartShowAllContent($action)
function onEndShowSubscriptionsMiniList($action)
{
$this->showEntityRemoteSubscribe($action);
@ -727,7 +747,7 @@ class OStatusPlugin extends Plugin
'class' => 'entity_subscribe'));
$action->element('a', array('href' => common_local_url('ostatussub'),
'class' => 'entity_remote_subscribe')
, _m('Subscribe to remote user'));
, _m('New'));
$action->elementEnd('p');
$action->elementEnd('div');
}

View File

@ -41,8 +41,22 @@ min-width:96px;
#entity_remote_subscribe {
padding:0;
float:right;
position:relative;
}
#all #entity_remote_subscribe {
margin-top:-52px;
.section .entity_actions {
margin-bottom:0;
}
.section #entity_remote_subscribe .entity_remote_subscribe {
border-color:#AAAAAA;
}
.section #entity_remote_subscribe .dialogbox {
width:405px;
}
.aside #entity_subscriptions .more {
float:left;
}