]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/invite.php
Fix for error output on invalid user ID to api groups list
[quix0rs-gnu-social.git] / actions / invite.php
index 9f9368701cbcb1ec279c1ba981671c60cf8b32b3..54b2de62ac910e3792f902495c54a4554e81a79c 100644 (file)
@@ -68,7 +68,7 @@ class InviteAction extends CurrentUserDesignAction
 
         foreach ($addresses as $email) {
             $email = trim($email);
-            if (!Validate::email($email, true)) {
+            if (!Validate::email($email, common_config('email', 'check_domain'))) {
                 $this->showForm(sprintf(_('Invalid email address: %s'), $email));
                 return;
             }
@@ -98,6 +98,12 @@ class InviteAction extends CurrentUserDesignAction
         $this->showPage();
     }
 
+    function showScripts()
+    {
+        parent::showScripts();
+        $this->autofocus('addresses');
+    }
+
     function title()
     {
         if ($this->mode == 'sent') {
@@ -122,7 +128,7 @@ class InviteAction extends CurrentUserDesignAction
             $this->element('p', null, _('You are already subscribed to these users:'));
             $this->elementStart('ul');
             foreach ($this->already as $other) {
-                $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
+                $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
             }
             $this->elementEnd('ul');
         }
@@ -130,7 +136,7 @@ class InviteAction extends CurrentUserDesignAction
             $this->element('p', null, _('These people are already users and you were automatically subscribed to them:'));
             $this->elementStart('ul');
             foreach ($this->subbed as $other) {
-                $this->element('li', null, sprintf(_('%s (%s)'), $other->nickname, $other->email));
+                $this->element('li', null, sprintf(_('%1$s (%2$s)'), $other->nickname, $other->email));
             }
             $this->elementEnd('ul');
         }
@@ -188,7 +194,8 @@ class InviteAction extends CurrentUserDesignAction
                         _('Optionally add a personal message to the invitation.'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
-        $this->submit('send', _('Send'));
+        // TRANS: Send button for inviting friends
+        $this->submit('send', _m('BUTTON', 'Send'));
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
     }