events.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /**
  3. * List events
  4. */
  5. if (!defined('GNUSOCIAL')) { exit(1); }
  6. class EventsAction extends ShowstreamAction
  7. {
  8. public function getStream()
  9. {
  10. /* whose events */ /* are these the user's own events? */
  11. $stream = new EventsNoticeStream($this->target, $this->scoped);
  12. return $stream;
  13. }
  14. function title()
  15. {
  16. // TRANS: Page title for sample plugin. %s is a user nickname.
  17. return sprintf(_m('%s\'s happenings'), $this->target->getNickname());
  18. }
  19. function getFeeds()
  20. {
  21. return array(
  22. );
  23. }
  24. function showEmptyList() {
  25. $message = sprintf(_('This is %1$s\'s event stream, but %1$s hasn\'t received any events yet.'), $this->target->getNickname()) . ' ';
  26. $this->elementStart('div', 'guide');
  27. $this->raw(common_markup_to_html($message));
  28. $this->elementEnd('div');
  29. }
  30. /**
  31. * Return true if read only.
  32. *
  33. * Some actions only read from the database; others read and write.
  34. * The simple database load-balancer built into StatusNet will
  35. * direct read-only actions to database mirrors (if they are configured),
  36. * and read-write actions to the master database.
  37. *
  38. * This defaults to false to avoid data integrity issues, but you
  39. * should make sure to overload it for performance gains.
  40. *
  41. * @param array $args other arguments, if RO/RW status depends on them.
  42. *
  43. * @return boolean is read only action?
  44. */
  45. function isReadOnly($args)
  46. {
  47. return true;
  48. }
  49. }