X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowapplication.php;h=c10883942f5f19f5377494262fdf7a5832adf08b;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=c9cdbf184870074f5fede8f4e80a37ea820c50e9;hpb=57198a74647f8350db4de03b0b7ef157091a4359;p=quix0rs-gnu-social.git diff --git a/actions/showapplication.php b/actions/showapplication.php index c9cdbf1848..c10883942f 100644 --- a/actions/showapplication.php +++ b/actions/showapplication.php @@ -22,7 +22,7 @@ * @category Application * @package StatusNet * @author Zach Copley - * @copyright 2008-2009 StatusNet, Inc. + * @copyright 2008-2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -40,7 +40,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class ShowApplicationAction extends OwnerDesignAction +class ShowApplicationAction extends Action { /** * Application to show @@ -65,25 +65,23 @@ class ShowApplicationAction extends OwnerDesignAction * * @return success flag */ - function prepare($args) + function prepare(array $args=array()) { parent::prepare($args); $id = (int)$this->arg('id'); - $this->application = Oauth_application::staticGet($id); - $this->owner = User::staticGet($this->application->owner); + $this->application = Oauth_application::getKV($id); + $this->owner = User::getKV($this->application->owner); if (!common_logged_in()) { // TRANS: Client error displayed trying to display an OAuth application while not logged in. $this->clientError(_('You must be logged in to view an application.')); - return false; } if (empty($this->application)) { // TRANS: Client error displayed trying to display a non-existing OAuth application. $this->clientError(_('No such application.'), 404); - return false; } $cur = common_current_user(); @@ -91,7 +89,6 @@ class ShowApplicationAction extends OwnerDesignAction if ($cur->id != $this->owner->id) { // TRANS: Client error displayed trying to display an OAuth application for which the logged in user is not the owner. $this->clientError(_('You are not the owner of this application.'), 401); - return false; } return true; @@ -104,7 +101,7 @@ class ShowApplicationAction extends OwnerDesignAction * * @return void */ - function handle($args) + function handle(array $args=array()) { parent::handle($args); @@ -115,7 +112,6 @@ class ShowApplicationAction extends OwnerDesignAction if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token does not match or is not given. $this->clientError(_('There was a problem with your session token.')); - return; } if ($this->arg('reset')) { @@ -151,20 +147,20 @@ class ShowApplicationAction extends OwnerDesignAction $consumer = $this->application->getConsumer(); - $this->elementStart('div', 'entity_profile vcard'); + $this->elementStart('div', 'entity_profile h-card'); // TRANS: Header on the OAuth application page. $this->element('h2', null, _('Application profile')); if (!empty($this->application->icon)) { $this->element('img', array('src' => $this->application->icon, - 'class' => 'photo logo entity_depiction')); + 'class' => 'u-photo logo entity_depiction')); } $this->element('a', array('href' => $this->application->source_url, - 'class' => 'url fn entity_fn'), + 'class' => 'u-url p-name entity_fn'), $this->application->name); $this->element('a', array('href' => $this->application->homepage, - 'class' => 'url entity_org'), + 'class' => 'u-url entity_org'), $this->application->organization); $this->element('div', @@ -174,7 +170,7 @@ class ShowApplicationAction extends OwnerDesignAction $this->elementStart('div', 'entity_statistics'); $defaultAccess = ($this->application->access_type & Oauth_application::$writeAccess) ? 'read-write' : 'read-only'; - $profile = Profile::staticGet($this->application->owner); + $profile = Profile::getKV($this->application->owner); $appUsers = new Oauth_application_user(); $appUsers->application_id = $this->application->id; @@ -251,21 +247,24 @@ class ShowApplicationAction extends OwnerDesignAction $this->elementStart('div', 'entity_data'); // TRANS: Header on the OAuth application page. $this->element('h2', null, _('Application info')); - $this->element('div', - 'entity_consumer_key', - $consumer->consumer_key); - - $this->element('div', - 'entity_consumer_secret', - $consumer->consumer_secret); - - $this->element('div', - 'entity_request_token_url', - common_local_url('ApiOauthRequestToken')); - - $this->element('div', 'entity_access_token_url', common_local_url('ApiOauthAccessToken')); - $this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize')); + $this->elementStart('dl'); + // TRANS: Field label on application page. + $this->element('dt', null, _('Consumer key')); + $this->element('dd', null, $consumer->consumer_key); + // TRANS: Field label on application page. + $this->element('dt', null, _('Consumer secret')); + $this->element('dd', null, $consumer->consumer_secret); + // TRANS: Field label on application page. + $this->element('dt', null, _('Request token URL')); + $this->element('dd', null, common_local_url('ApiOAuthRequestToken')); + // TRANS: Field label on application page. + $this->element('dt', null, _('Access token URL')); + $this->element('dd', null, common_local_url('ApiOAuthAccessToken')); + // TRANS: Field label on application page. + $this->element('dt', null, _('Authorize URL')); + $this->element('dd', null, common_local_url('ApiOAuthAuthorize')); + $this->elementEnd('dl'); $this->element('p', 'note', // TRANS: Note on the OAuth application page about signature support.