subscriberslistitem.php 1.5 KB

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