]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/subscriptionlistitem.php
*** Privacy Leak fixed: ***
[quix0rs-gnu-social.git] / lib / subscriptionlistitem.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 class SubscriptionListItem extends ProfileListItem
6 {
7     /** Owner of this list */
8     var $owner = null;
9
10     // FIXME: TagSubs plugin sends a TagSub here, but should send a Profile and handle TagSub specifics itself?
11     function __construct($target, $owner, HTMLOutputter $action)
12     {
13         if ($owner instanceof Profile) {
14             parent::__construct($target, $action, $owner);
15         } else {
16             parent::__construct($target, $action);
17         }
18
19         $this->owner = $owner;
20     }
21
22     function showProfile()
23     {
24         $this->startProfile();
25         $this->showAvatar($this->profile);
26         $this->showNickname();
27         $this->showFullName();
28         $this->showLocation();
29         $this->showHomepage();
30         $this->showBio();
31         // Relevant portion!
32         $this->showTags();
33         if ($this->isOwn()) {
34             $this->showOwnerControls();
35         }
36         $this->endProfile();
37     }
38
39     function showOwnerControls()
40     {
41         // pass
42     }
43
44     function isOwn()
45     {
46         $user = common_current_user();
47         return (!empty($user) && ($this->owner->id == $user->id));
48     }
49 }