]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/applicationeditform.php
Merge branch 'testing' into 0.9.x
[quix0rs-gnu-social.git] / lib / applicationeditform.php
index f8fcb3e3f50be67dc55a57f0e40c0e016cbeb779..81c8fb01816c4b02a1a63a82cf755639cd24f100 100644 (file)
@@ -119,12 +119,9 @@ class ApplicationEditForm extends Form
 
         if (!empty($this->application)) {
             return common_local_url('editapplication',
-                array('id' => $this->application->id,
-                      'nickname' => $cur->nickname)
-            );
+                                    array('id' => $this->application->id));
         } else {
-            return common_local_url('newapplication',
-                array('nickname' => $cur->nickname));
+            return common_local_url('newapplication');
         }
     }
 
@@ -136,6 +133,7 @@ class ApplicationEditForm extends Form
 
     function formLegend()
     {
+        // TRANS: Form legend.
         $this->out->element('legend', null, _('Edit application'));
     }
 
@@ -149,7 +147,7 @@ class ApplicationEditForm extends Form
     {
         if ($this->application) {
             $id                = $this->application->id;
-           $icon              = $this->application->icon;
+            $icon              = $this->application->icon;
             $name              = $this->application->name;
             $description       = $this->application->description;
             $source_url        = $this->application->source_url;
@@ -160,7 +158,7 @@ class ApplicationEditForm extends Form
             $this->access_type = $this->application->access_type;
         } else {
             $id                = '';
-           $icon              = '';
+            $icon              = '';
             $name              = '';
             $description       = '';
             $source_url        = '';
@@ -171,32 +169,33 @@ class ApplicationEditForm extends Form
             $this->access_type = '';
         }
 
-       $this->out->hidden('token', common_session_token());
-
         $this->out->elementStart('ul', 'form_data');
 
-       $this->out->elementStart('li');
+        $this->out->elementStart('li', array('id' => 'application_icon'));
 
-       if (!empty($icon)) {
-           $this->out->element('img', array('src' => $icon));
-       }
+        if (!empty($icon)) {
+            $this->out->element('img', array('src' => $icon));
+        }
 
-       $this->out->element('label', array('for' => 'app_icon'),
-                                _('Icon'));
+        $this->out->element('label', array('for' => 'app_icon'),
+                            // TRANS: Form input field label for application icon.
+                            _('Icon'));
         $this->out->element('input', array('name' => 'app_icon',
-                                      'type' => 'file',
-                                      'id' => 'app_icon'));
+                                           'type' => 'file',
+                                           'id' => 'app_icon'));
+        // TRANS: Form guide.
         $this->out->element('p', 'form_guide', _('Icon for this application'));
         $this->out->element('input', array('name' => 'MAX_FILE_SIZE',
-                                      'type' => 'hidden',
-                                      'id' => 'MAX_FILE_SIZE',
-                                      'value' => ImageFile::maxFileSizeInt()));
+                                           'type' => 'hidden',
+                                           'id' => 'MAX_FILE_SIZE',
+                                           'value' => ImageFile::maxFileSizeInt()));
         $this->out->elementEnd('li');
 
-       $this->out->elementStart('li');
+        $this->out->elementStart('li');
 
         $this->out->hidden('application_id', $id);
 
+        // TRANS: Form input field label for application name.
         $this->out->input('name', _('Name'),
                           ($this->out->arg('name')) ? $this->out->arg('name') : $name);
 
@@ -206,42 +205,57 @@ class ApplicationEditForm extends Form
 
         $maxDesc = Oauth_application::maxDesc();
         if ($maxDesc > 0) {
-            $descInstr = sprintf(_('Describe your application in %d chars'),
-                                $maxDesc);
+            // TRANS: Form input field instructions.
+            $descInstr = sprintf(_('Describe your application in %d characters'),
+                                 $maxDesc);
         } else {
+            // TRANS: Form input field instructions.
             $descInstr = _('Describe your application');
         }
+        // TRANS: Form input field label.
         $this->out->textarea('description', _('Description'),
                         ($this->out->arg('description')) ? $this->out->arg('description') : $description,
-                        $descInstr);
+                             $descInstr);
 
         $this->out->elementEnd('li');
 
         $this->out->elementStart('li');
+        // TRANS: Form input field instructions.
+        $instruction = _('URL of the homepage of this application');
+        // TRANS: Form input field label.
         $this->out->input('source_url', _('Source URL'),
                           ($this->out->arg('source_url')) ? $this->out->arg('source_url') : $source_url,
-                          _('URL of the homepage of this application'));
+                          $instruction);
         $this->out->elementEnd('li');
 
         $this->out->elementStart('li');
+        // TRANS: Form input field instructions.
+        $instruction = _('Organization responsible for this application');
+        // TRANS: Form input field label.
         $this->out->input('organization', _('Organization'),
                           ($this->out->arg('organization')) ? $this->out->arg('organization') : $organization,
-                          _('Organization responsible for this application'));
+                          $instruction);
         $this->out->elementEnd('li');
 
         $this->out->elementStart('li');
+        // TRANS: Form input field instructions.
+        $instruction = _('URL for the homepage of the organization');
+        // TRANS: Form input field label.
         $this->out->input('homepage', _('Homepage'),
                           ($this->out->arg('homepage')) ? $this->out->arg('homepage') : $homepage,
-                          _('URL for the homepage of the organization'));
+                          $instruction);
         $this->out->elementEnd('li');
 
         $this->out->elementStart('li');
+        // TRANS: Form input field instructions.
+        $instruction = _('URL to redirect to after authentication');
+        // TRANS: Form input field label.
         $this->out->input('callback_url', ('Callback URL'),
                           ($this->out->arg('callback_url')) ? $this->out->arg('callback_url') : $callback_url,
-                          _('URL to redirect to after authentication'));
+                          $instruction);
         $this->out->elementEnd('li');
 
-        $this->out->elementStart('li');
+        $this->out->elementStart('li', array('id' => 'application_types'));
 
         $attrs = array('name' => 'app_type',
                        'type' => 'radio',
@@ -259,8 +273,9 @@ class ApplicationEditForm extends Form
         $this->out->element('input', $attrs);
 
         $this->out->element('label', array('for' => 'app_type-browser',
-                                      'class' => 'radio'),
-                                      _('Browser'));
+                                           'class' => 'radio'),
+                            // TRANS: Radio button label for application type
+                            _('Browser'));
 
         $attrs = array('name' => 'app_type',
                        'type' => 'radio',
@@ -275,12 +290,14 @@ class ApplicationEditForm extends Form
         $this->out->element('input', $attrs);
 
         $this->out->element('label', array('for' => 'app_type-desktop',
-                                      'class' => 'radio'),
-                                      _('Desktop'));
+                                           'class' => 'radio'),
+                            // TRANS: Radio button label for application type
+                            _('Desktop'));
+        // TRANS: Form guide.
         $this->out->element('p', 'form_guide', _('Type of application, browser or desktop'));
         $this->out->elementEnd('li');
 
-        $this->out->elementStart('li');
+        $this->out->elementStart('li', array('id' => 'default_access_types'));
 
         $attrs = array('name' => 'default_access_type',
                        'type' => 'radio',
@@ -298,8 +315,9 @@ class ApplicationEditForm extends Form
         $this->out->element('input', $attrs);
 
         $this->out->element('label', array('for' => 'default_access_type-ro',
-                                      'class' => 'radio'),
-                                      _('Read-only'));
+                                           'class' => 'radio'),
+                            // TRANS: Radio button label for access type.
+                            _('Read-only'));
 
         $attrs = array('name' => 'default_access_type',
                        'type' => 'radio',
@@ -309,15 +327,17 @@ class ApplicationEditForm extends Form
 
         if ($this->application->access_type & Oauth_application::$readAccess
             && $this->application->access_type & Oauth_application::$writeAccess
-        ) {
+            ) {
             $attrs['checked'] = 'checked';
         }
 
         $this->out->element('input', $attrs);
 
         $this->out->element('label', array('for' => 'default_access_type-rw',
-                                      'class' => 'radio'),
-                                      _('Read-write'));
+                                           'class' => 'radio'),
+                            // TRANS: Radio button label for access type.
+                            _('Read-write'));
+        // TRANS: Form guide.
         $this->out->element('p', 'form_guide', _('Default access for this application: read-only, or read-write'));
 
         $this->out->elementEnd('li');
@@ -333,9 +353,13 @@ class ApplicationEditForm extends Form
 
     function formActions()
     {
-        $this->out->submit('cancel', _('Cancel'), 'submit form_action-primary',
-            'cancel', _('Cancel'));
-        $this->out->submit('save', _('Save'), 'submit form_action-secondary',
-            'save', _('Save'));
+        // TRANS: Button label
+        $this->out->submit('cancel', _m('BUTTON','Cancel'), 'submit form_action-primary',
+                           // TRANS: Submit button title
+                           'cancel', _('Cancel'));
+        // TRANS: Button label
+        $this->out->submit('save', _m('BUTTON','Save'), 'submit form_action-secondary',
+                           // TRANS: Submit button title
+                           'save', _('Save'));
     }
 }