123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class SubscribersAction extends GalleryAction
- {
- function title()
- {
- if ($this->page == 1) {
-
-
- return sprintf(_('%s subscribers'), $this->target->getNickname());
- } else {
-
-
- return sprintf(_('%1$s subscribers, page %2$d'),
- $this->target->getNickname(),
- $this->page);
- }
- }
- function showPageNotice()
- {
- if ($this->scoped instanceof Profile && $this->scoped->id === $this->target->id) {
- $this->element('p', null,
-
-
- _('These are the people who listen to '.
- 'your notices.'));
- } else {
- $this->element('p', null,
-
-
- sprintf(_('These are the people who '.
- 'listen to %s\'s notices.'),
- $this->target->getNickname()));
- }
- }
- function showContent()
- {
- parent::showContent();
- $offset = ($this->page-1) * PROFILES_PER_PAGE;
- $limit = PROFILES_PER_PAGE + 1;
- $cnt = 0;
- if ($this->tag) {
- $subscribers = $this->target->getTaggedSubscribers($this->tag, $offset, $limit);
- } else {
- $subscribers = $this->target->getSubscribers($offset, $limit);
- }
- if ($subscribers) {
- $subscribers_list = new SubscribersList($subscribers, $this->target->getUser(), $this);
- $cnt = $subscribers_list->show();
- if (0 == $cnt) {
- $this->showEmptyListMessage();
- }
- }
- $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
- $this->page, 'subscribers',
- array('nickname' => $this->target->getNickname()));
- }
- function showEmptyListMessage()
- {
- if ($this->scoped instanceof Profile && $this->target->id === $this->scoped->id) {
-
- $message = _('You have no subscribers. Try subscribing to people you know and they might return the favor.');
- } elseif ($this->scoped instanceof Profile) {
-
-
- $message = sprintf(_('%s has no subscribers. Want to be the first?'), $this->target->getNickname());
- } else {
-
-
-
-
-
- $message = sprintf(_('%s has no subscribers. Why not [register an account](%%%%action.register%%%%) and be the first?'), $this->target->getNickname());
- }
- $this->elementStart('div', 'guide');
- $this->raw(common_markup_to_html($message));
- $this->elementEnd('div');
- }
- function showSections()
- {
- parent::showSections();
- }
- }
|