subscriberslistitem.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. if (!defined('GNUSOCIAL')) { exit(1); }
  3. class SubscribersListItem extends SubscriptionListItem
  4. {
  5. function showActions()
  6. {
  7. $this->startActions();
  8. if (Event::handle('StartProfileListItemActionElements', array($this))) {
  9. $this->showSubscribeButton();
  10. // Relevant code!
  11. $this->showBlockForm();
  12. Event::handle('EndProfileListItemActionElements', array($this));
  13. }
  14. $this->endActions();
  15. }
  16. function showBlockForm()
  17. {
  18. $user = common_current_user();
  19. if (!empty($user) && $this->owner->id == $user->id) {
  20. $returnto = array('action' => 'subscribers',
  21. 'nickname' => $this->owner->getNickname());
  22. $page = $this->out->arg('page');
  23. if ($page) {
  24. $returnto['param-page'] = $page;
  25. }
  26. $bf = new BlockForm($this->out, $this->profile, $returnto);
  27. $bf->show();
  28. }
  29. }
  30. function linkAttributes()
  31. {
  32. $aAttrs = parent::linkAttributes();
  33. if (common_config('nofollow', 'subscribers')) {
  34. $aAttrs['rel'] .= ' nofollow';
  35. }
  36. return $aAttrs;
  37. }
  38. function homepageAttributes()
  39. {
  40. $aAttrs = parent::linkAttributes();
  41. if (common_config('nofollow', 'subscribers')) {
  42. $aAttrs['rel'] = 'nofollow';
  43. }
  44. return $aAttrs;
  45. }
  46. }