123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- class ApiOAuthPinAction extends InfoAction
- {
- function __construct($title, $message, $verifier, $desktopMode = false)
- {
- $this->verifier = $verifier;
- $this->title = $title;
- $this->desktopMode = $desktopMode;
- parent::__construct($title, $message);
- }
-
- function showBody()
- {
- $bodyClasses = array();
- if ($this->desktopMode) {
- $bodyClasses[] = 'oauth-desktop-mode';
- }
- if (common_current_user()) {
- $bodyClasses[] = 'user_in';
- }
- $attrs = array('id' => strtolower($this->trimmed('action')));
- if (!empty($bodyClasses)) {
- $attrs['class'] = implode(' ', $bodyClasses);
- }
- $this->elementStart('body', $attrs);
- $this->elementStart('div', array('id' => 'wrap'));
- if (Event::handle('StartShowHeader', array($this))) {
- $this->showHeader();
- Event::handle('EndShowHeader', array($this));
- }
- $this->showCore();
- if (Event::handle('StartShowFooter', array($this))) {
- $this->showFooter();
- Event::handle('EndShowFooter', array($this));
- }
- $this->elementEnd('div');
- $this->showScripts();
- $this->elementEnd('body');
- }
-
- function showLocalNav()
- {
-
- }
-
- function showHeader()
- {
- if ($this->desktopMode == false) {
- parent::showHeader();
- }
- }
-
- function showAside()
- {
- if ($this->desktopMode == false) {
- parent::showAside();
- }
- }
-
- function showFooter()
- {
- if ($this->desktopMode == false) {
- parent::showFooter();
- }
- }
-
- function showSiteNotice()
- {
-
- }
-
- function showNoticeForm()
- {
-
- }
-
- function showContent()
- {
- $this->element('div', array('class' => 'info'), $this->message);
- $this->element('div', array('id' => 'oauth_pin'), $this->verifier);
- }
- }
|