123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?php
- defined('GNUSOCIAL') || die();
- class OauthappssettingsAction extends SettingsAction
- {
- protected $page = null;
- protected function doPreparation()
- {
- $this->page = $this->int('page') ?: 1;
- }
-
- public function title()
- {
-
- return _('OAuth applications');
- }
-
- public function getInstructions()
- {
-
- return _('Applications you have registered');
- }
- public function showContent()
- {
- $offset = ($this->page - 1) * APPS_PER_PAGE;
- $limit = APPS_PER_PAGE + 1;
- $application = new Oauth_application();
- $application->owner = $this->scoped->getID();
- $application->whereAdd("name <> 'anonymous'");
- $application->limit($offset, $limit);
- $application->orderBy('created DESC, id DESC');
- $application->find();
- $cnt = 0;
- if ($application) {
- $al = new ApplicationList($application, $this->scoped, $this);
- $cnt = $al->show();
- if (0 == $cnt) {
- $this->showEmptyListMessage();
- }
- }
- $this->elementStart('p', ['id' => 'application_register']);
- $this->element(
- 'a',
- [
- 'href' => common_local_url('newapplication'),
- 'class' => 'more',
- ],
-
- 'Register a new application'
- );
- $this->elementEnd('p');
- $this->pagination(
- $this->page > 1,
- $cnt > APPS_PER_PAGE,
- $this->page,
- 'oauthappssettings'
- );
- }
- public function showEmptyListMessage()
- {
-
- $message = sprintf(_('You have not registered any applications yet.'));
- $this->elementStart('div', 'guide');
- $this->raw(common_markup_to_html($message));
- $this->elementEnd('div');
- }
- }
|