subscriptionlistitem.php 1.2 KB

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