]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showapplication.php
Profile::getOwnedTags -> Profile::getLists, first argument is the current user, or...
[quix0rs-gnu-social.git] / actions / showapplication.php
index b9e3b329146dc3e18020477eb67eea56129c4d44..c9cdbf184870074f5fede8f4e80a37ea820c50e9 100644 (file)
@@ -40,19 +40,16 @@ 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
 {
     /**
      * Application to show
      */
-
     var $application = null;
 
     /**
      * User who owns the app
      */
-
     var $owner = null;
 
     var $msg = null;
@@ -68,7 +65,6 @@ class ShowApplicationAction extends OwnerDesignAction
      *
      * @return success flag
      */
-
     function prepare($args)
     {
         parent::prepare($args);
@@ -79,11 +75,13 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->owner        = User::staticGet($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;
         }
@@ -91,6 +89,7 @@ class ShowApplicationAction extends OwnerDesignAction
         $cur = common_current_user();
 
         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;
         }
@@ -105,7 +104,6 @@ class ShowApplicationAction extends OwnerDesignAction
      *
      * @return void
      */
-
     function handle($args)
     {
         parent::handle($args);
@@ -115,6 +113,7 @@ class ShowApplicationAction extends OwnerDesignAction
             // CSRF protection
             $token = $this->trimmed('token');
             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;
             }
@@ -132,7 +131,6 @@ class ShowApplicationAction extends OwnerDesignAction
      *
      * @return string title of the page
      */
-
     function title()
     {
         if (!empty($this->application->name)) {
@@ -154,6 +152,7 @@ class ShowApplicationAction extends OwnerDesignAction
         $consumer = $this->application->getConsumer();
 
         $this->elementStart('div', 'entity_profile vcard');
+        // 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,
@@ -182,7 +181,12 @@ class ShowApplicationAction extends OwnerDesignAction
         $userCnt = $appUsers->count();
 
         $this->raw(sprintf(
-            _('Created by %1$s - %2$s access by default - %3$d users'),
+            // TRANS: Information output on an OAuth application page.
+            // TRANS: %1$s is the application creator, %2$s is "read-only" or "read-write",
+            // TRANS: %3$d is the number of users using the OAuth application.
+            _m('Created by %1$s - %2$s access by default - %3$d user',
+               'Created by %1$s - %2$s access by default - %3$d users',
+               $userCnt),
               $profile->getBestName(),
               $defaultAccess,
               $userCnt
@@ -192,13 +196,15 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->elementEnd('div');
 
         $this->elementStart('div', 'entity_actions');
+        // TRANS: Header on the OAuth application page.
         $this->element('h2', null, _('Application actions'));
         $this->elementStart('ul');
         $this->elementStart('li', 'entity_edit');
         $this->element('a',
                        array('href' => common_local_url('editapplication',
                                                         array('id' => $this->application->id))),
-                       'Edit');
+                       // TRANS: Link text to edit application on the OAuth application page.
+                       _m('EDITAPP','Edit'));
         $this->elementEnd('li');
 
         $this->elementStart('li', 'entity_reset_keysecret');
@@ -215,6 +221,8 @@ class ShowApplicationAction extends OwnerDesignAction
                                       'id' => 'reset',
                                       'name' => 'reset',
                                       'class' => 'submit',
+                                      // TRANS: Button text on the OAuth application page.
+                                      // TRANS: Resets the OAuth consumer key and secret.
                                       'value' => _('Reset key & secret'),
                                       'onClick' => 'return confirmReset()'));
         $this->elementEnd('fieldset');
@@ -231,7 +239,8 @@ class ShowApplicationAction extends OwnerDesignAction
 
         $this->elementStart('fieldset');
         $this->hidden('token', common_session_token());
-        $this->submit('delete', _('Delete'));
+        // TRANS: Submit button text the OAuth application page to delete an application.
+        $this->submit('delete', _m('BUTTON','Delete'));
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
         $this->elementEnd('li');
@@ -240,6 +249,7 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->elementEnd('div');
 
         $this->elementStart('div', 'entity_data');
+        // TRANS: Header on the OAuth application page.
         $this->element('h2', null, _('Application info'));
         $this->element('div',
                        'entity_consumer_key',
@@ -258,7 +268,8 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize'));
 
         $this->element('p', 'note',
-            _('Note: We support HMAC-SHA1 signatures. We do not support the plaintext signature method.'));
+            // TRANS: Note on the OAuth application page about signature support.
+            _('Note: HMAC-SHA1 signatures are supported. The plaintext signature method is not supported.'));
         $this->elementEnd('div');
 
         $this->elementStart('p', array('id' => 'application_action'));
@@ -274,11 +285,11 @@ class ShowApplicationAction extends OwnerDesignAction
      *
      * @return void
      */
-
     function showScripts()
     {
         parent::showScripts();
 
+        // TRANS: Text in confirmation dialog to reset consumer key and secret for an OAuth application.
         $msg = _('Are you sure you want to reset your consumer key and secret?');
 
         $js  = 'function confirmReset() { ';
@@ -295,7 +306,6 @@ class ShowApplicationAction extends OwnerDesignAction
      * XXX: Should this be moved to its own page with a confirm?
      *
      */
-
     function resetKey()
     {
         $this->application->query('BEGIN');
@@ -355,5 +365,4 @@ class ShowApplicationAction extends OwnerDesignAction
         $this->msg = ('Consumer key and secret reset.');
         $this->showPage();
     }
-
 }