X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fprofileaction.php;h=504b77566993ccdbab8d08197888aac194a13868;hb=99194e03fa50b61f99164674afc949b4bbefd44a;hp=072c024c74a38c7d87ff7412c4f26f2b88f015fd;hpb=806fcfb7075d9bd3100cb198be4b0ad35e096421;p=quix0rs-gnu-social.git diff --git a/lib/profileaction.php b/lib/profileaction.php index 072c024c74..504b775669 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; + } +} +