summaryrefslogtreecommitdiff
path: root/lib/profileaction.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-04-06 15:22:23 -0700
committerBrion Vibber <brion@pobox.com>2010-04-06 15:22:23 -0700
commit5dc169260dc36209dd5ad0d4d4cac2bdaaefe62c (patch)
treec5fb50f7fbf6ff20b581c1ad5b50f2e19e6d7584 /lib/profileaction.php
parenta3314f483ec3250b322666a769a10197fb9dfff0 (diff)
parent4bb75d1c8e22b7bfc689a9e582ef846515a90383 (diff)
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/profileaction.php')
-rw-r--r--lib/profileaction.php55
1 files changed, 40 insertions, 15 deletions
diff --git a/lib/profileaction.php b/lib/profileaction.php
index 072c024c7..504b77566 100644
--- a/lib/profileaction.php
+++ b/lib/profileaction.php
@@ -139,25 +139,30 @@ class ProfileAction extends OwnerDesignAction
$this->elementStart('div', array('id' => 'entity_subscribers',
'class' => 'section'));
- $this->element('h2', null, _('Subscribers'));
+ if (Event::handle('StartShowSubscribersMiniList', array($this))) {
- $cnt = 0;
+ $this->element('h2', null, _('Subscribers'));
- if (!empty($profile)) {
- $pml = new ProfileMiniList($profile, $this);
- $cnt = $pml->show();
- if ($cnt == 0) {
- $this->element('p', null, _('(None)'));
+ $cnt = 0;
+
+ if (!empty($profile)) {
+ $sml = new SubscribersMiniList($profile, $this);
+ $cnt = $sml->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('subscribers',
- array('nickname' => $this->profile->nickname)),
- 'class' => 'more'),
- _('All subscribers'));
- $this->elementEnd('p');
+ if ($cnt > PROFILES_PER_MINILIST) {
+ $this->elementStart('p');
+ $this->element('a', array('href' => common_local_url('subscribers',
+ array('nickname' => $this->profile->nickname)),
+ 'class' => 'more'),
+ _('All subscribers'));
+ $this->elementEnd('p');
+ }
+
+ Event::handle('EndShowSubscribersMiniList', array($this));
}
$this->elementEnd('div');
@@ -266,3 +271,23 @@ class ProfileAction extends OwnerDesignAction
}
}
+class SubscribersMiniList extends ProfileMiniList
+{
+ function newListItem($profile)
+ {
+ return new SubscribersMiniListItem($profile, $this->action);
+ }
+}
+
+class SubscribersMiniListItem extends ProfileMiniListItem
+{
+ function linkAttributes()
+ {
+ $aAttrs = parent::linkAttributes();
+ if (common_config('nofollow', 'subscribers')) {
+ $aAttrs['rel'] .= ' nofollow';
+ }
+ return $aAttrs;
+ }
+}
+