subscriptionlistitem.php 1.2 KB

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