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 - $userprofile: UserProfile widget
- &$profile: the profile being shown - &$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 StartProfilePageProfileSection: Starting to show the section of the
profile page with the actual profile data; profile page with the actual profile data;
hook to prevent showing the profile (e.g.) 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 EndShowAllContent: after showing the all (you and friends) content
- $action: the current action - $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 StartDeleteUserForm: starting the data in the form for deleting a user
- $action: action being shown - $action: action being shown
- $user: user being deleted - $user: user being deleted

View File

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

View File

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

View File

@ -210,6 +210,26 @@ class OStatusPlugin extends Plugin
return false; 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. * Check if we've got remote replies to send via Salmon.
* *
@ -711,7 +731,7 @@ class OStatusPlugin extends Plugin
return true; return true;
} }
function onStartShowAllContent($action) function onEndShowSubscriptionsMiniList($action)
{ {
$this->showEntityRemoteSubscribe($action); $this->showEntityRemoteSubscribe($action);
@ -727,7 +747,7 @@ class OStatusPlugin extends Plugin
'class' => 'entity_subscribe')); 'class' => 'entity_subscribe'));
$action->element('a', array('href' => common_local_url('ostatussub'), $action->element('a', array('href' => common_local_url('ostatussub'),
'class' => 'entity_remote_subscribe') 'class' => 'entity_remote_subscribe')
, _m('Subscribe to remote user')); , _m('New'));
$action->elementEnd('p'); $action->elementEnd('p');
$action->elementEnd('div'); $action->elementEnd('div');
} }

View File

@ -41,8 +41,22 @@ min-width:96px;
#entity_remote_subscribe { #entity_remote_subscribe {
padding:0; padding:0;
float:right; float:right;
position:relative;
} }
#all #entity_remote_subscribe { .section .entity_actions {
margin-top:-52px; 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;
} }