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'); $application->find(); $cnt = 0; if ($application) { $al = new ApplicationList($application, $this->scoped, $this); $cnt = $al->show(); if (0 == $cnt) { $this->showEmptyListMessage(); } } $this->elementStart('p', array('id' => 'application_register')); $this->element('a', array('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'); }
static function getByConsumerKey($key) { if (empty($key)) { return null; } $app = new Oauth_application(); $app->consumer_key = $key; $app->limit(1); $result = $app->find(true); return empty($result) ? null : $app; }