subscriptionlistitem.php 940 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. if (!defined('GNUSOCIAL')) { exit(1); }
  3. class SubscriptionListItem extends ProfileListItem
  4. {
  5. /** Owner of this list */
  6. var $owner = null;
  7. function __construct(Profile $profile, $owner, $action)
  8. {
  9. parent::__construct($profile, $action);
  10. $this->owner = $owner;
  11. }
  12. function showProfile()
  13. {
  14. $this->startProfile();
  15. $this->showAvatar($this->profile);
  16. $this->showNickname();
  17. $this->showFullName();
  18. $this->showLocation();
  19. $this->showHomepage();
  20. $this->showBio();
  21. // Relevant portion!
  22. $this->showTags();
  23. if ($this->isOwn()) {
  24. $this->showOwnerControls();
  25. }
  26. $this->endProfile();
  27. }
  28. function showOwnerControls()
  29. {
  30. // pass
  31. }
  32. function isOwn()
  33. {
  34. $user = common_current_user();
  35. return (!empty($user) && ($this->owner->id == $user->id));
  36. }
  37. }