diff options
author | Zach Copley <zach@status.net> | 2010-10-25 11:25:35 -0700 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-10-25 11:25:35 -0700 |
commit | 82c280979d17c3c719026f1618ab0b608a4ebcf7 (patch) | |
tree | 0c9d7d67410d3aaf373a98c43f7869d51618983d /actions/apioauthauthorize.php | |
parent | 479096c8d79e40abc27566551dda280be5910c32 (diff) |
Add special CSS classes to OAuth authorization and pin pages when
in desktop mode
Diffstat (limited to 'actions/apioauthauthorize.php')
-rw-r--r-- | actions/apioauthauthorize.php | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/actions/apioauthauthorize.php b/actions/apioauthauthorize.php index 75b4540fb..2b8ea84c7 100644 --- a/actions/apioauthauthorize.php +++ b/actions/apioauthauthorize.php @@ -323,18 +323,46 @@ class ApiOauthAuthorizeAction extends Action } /** - * Override to add some special (more compact) styling when the page is - * being displayed in desktop mode. + * Show body - override to add a special CSS class for the authorize + * page's "desktop mode" (minimal display) + * + * Calls template methods * * @return nothing */ - function showStylesheets() + function showBody() { - parent::showStyleSheets(); + $bodyClasses = array(); if ($this->desktopMode()) { - $this->style('#wrap {min-width: 500px;} #content {width: 480px; padding: 6px; margin: 4px 0px 0px 4px; border-top-left-radius: 7px; -moz-border-radius-topleft: 7px; -webkit-border-top-left-radius: 7px;} fieldset {margin-bottom: 10px !important;}'); + $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 showForm($error=null) @@ -599,7 +627,12 @@ class ApiOauthAuthorizeAction extends Action ); if ($this->reqToken->verified_callback == 'oob') { - $pin = new ApiOauthPinAction($title, $msg, $this->reqToken->verifier); + $pin = new ApiOauthPinAction( + $title, + $msg, + $this->reqToken->verifier, + $this->desktopMode() + ); $pin->showPage(); } else { |