123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- require_once(INSTALLDIR.'/lib/profilelist.php');
- class SubqueueAction extends GalleryAction
- {
- protected $needLogin = true;
- protected function prepare(array $args=array())
- {
- parent::prepare($args);
- if ($this->scoped->id != $this->target->id) {
-
- $this->clientError(_('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;
- $members = $this->target->getRequests($offset, $limit);
- if ($members) {
-
- $member_list = new SubQueueList($members, $this);
- $cnt = $member_list->show();
- }
- $members->free();
- $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE,
- $this->page, 'subqueue',
- array('nickname' => $this->target->getNickname()));
- }
- }
- class SubQueueList extends ProfileList
- {
- function newListItem($profile)
- {
- return new SubQueueListItem($profile, $this->action);
- }
- }
- class SubQueueListItem extends ProfileListItem
- {
- function showActions()
- {
- $this->startActions();
- if (Event::handle('StartProfileListItemActionElements', array($this))) {
- $this->showApproveButtons();
- Event::handle('EndProfileListItemActionElements', array($this));
- }
- $this->endActions();
- }
- function showApproveButtons()
- {
- $this->out->elementStart('li', 'entity_approval');
- $form = new ApproveSubForm($this->out, $this->profile);
- $form->show();
- $this->out->elementEnd('li');
- }
- }
|