123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class SubqueueAction extends GalleryAction
- {
- protected $needLogin = true;
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- if (!$this->target->sameAs($this->scoped)) {
-
- throw new ClientException(_('You may only approve your own pending subscriptions.'));
- }
- return true;
- }
- function title()
- {
- if ($this->page == 1) {
-
-
- return sprintf(_('%s subscribers awaiting approval'),
- $this->target->getNickname());
- } else {
-
-
- return sprintf(_('%1$s subscribers awaiting approval, page %2$d'),
- $this->target->getNickname(),
- $this->page);
- }
- }
- function showPageNotice()
- {
- $this->element('p', 'instructions',
-
- _('A list of users awaiting approval to subscribe to you.'));
- }
- function showContent()
- {
- $offset = ($this->page-1) * PROFILES_PER_PAGE;
- $limit = PROFILES_PER_PAGE + 1;
- $cnt = 0;
- try {
- $subqueue = $this->target->getRequests($offset, $limit);
- } catch (NoResultException $e) {
-
- $this->element('div', null, _m('You have no pending subscription requests.'));
- return;
- }
- $list = new SubQueueList($subqueue, $this);
- $cnt = $list->show();
- $subqueue->free();
- $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
- $this->page, 'subqueue',
- array('nickname' => $this->target->getNickname()));
- }
- }
|