]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/subscriberslistitem.php
Avoid having to check for notices without rendered copies in upgrade.php
[quix0rs-gnu-social.git] / lib / subscriberslistitem.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 class SubscribersListItem extends SubscriptionListItem
6 {
7     function showActions()
8     {
9         $this->startActions();
10         if (Event::handle('StartProfileListItemActionElements', array($this))) {
11             $this->showSubscribeButton();
12             // Relevant code!
13             $this->showBlockForm();
14             Event::handle('EndProfileListItemActionElements', array($this));
15         }
16         $this->endActions();
17     }
18
19     function showBlockForm()
20     {
21         $user = common_current_user();
22
23         if (!empty($user) && $this->owner->id == $user->id) {
24             $returnto = array('action' => 'subscribers',
25                               'nickname' => $this->owner->getNickname());
26             $page = $this->out->arg('page');
27             if ($page) {
28                 $returnto['param-page'] = $page;
29             }
30             $bf = new BlockForm($this->out, $this->profile, $returnto);
31             $bf->show();
32         }
33     }
34
35     function linkAttributes()
36     {
37         $aAttrs = parent::linkAttributes();
38
39         if (common_config('nofollow', 'subscribers')) {
40             $aAttrs['rel'] .= ' nofollow';
41         }
42
43         return $aAttrs;
44     }
45
46     function homepageAttributes()
47     {
48         $aAttrs = parent::linkAttributes();
49
50         if (common_config('nofollow', 'subscribers')) {
51             $aAttrs['rel'] = 'nofollow';
52         }
53
54         return $aAttrs;
55     }
56 }