]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/profileaction.php
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / lib / profileaction.php
index 072c024c74a38c7d87ff7412c4f26f2b88f015fd..504b77566993ccdbab8d08197888aac194a13868 100644 (file)
@@ -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;
+    }
+}
+