]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/invite.php
Merge branch 'master' of git.gnu.io:Quix0r/gnu-social
[quix0rs-gnu-social.git] / actions / invite.php
index 89b7e83bf6d19a32899e05db5fe2b32ac1439cb3..0deb7a76ee2d997a5dd66236fc5fc1774e31e1cc 100644 (file)
@@ -33,12 +33,12 @@ class InviteAction extends Action
         return;
     }
 
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         return false;
     }
 
-    function handle($args)
+    function handle(array $args=array())
     {
         parent::handle($args);
         if (!common_config('invite', 'enabled')) {
@@ -74,6 +74,7 @@ class InviteAction extends Action
             $bestname = $profile->getBestName();
             $sitename = common_config('site', 'name');
             $personal = $this->trimmed('personal');
+            $language = $this->trimmed('language');
 
             $addresses = explode("\n", $this->trimmed('addresses'));
             foreach ($addresses as $email) {
@@ -128,7 +129,7 @@ class InviteAction extends Action
                 } catch (NoSuchUserException $e) {
                     // If email was not known, let's send an invite!
                     $this->sent[] = $email;
-                    $this->sendInvitation($email, $user, $personal);
+                    $this->sendInvitation($email, $user, $personal, $language);
                 }
             }
 
@@ -248,7 +249,7 @@ class InviteAction extends Action
         }
     }
 
-    function sendInvitation($email, $user, $personal)
+    function sendInvitation($email, $user, $personal, $language)
     {
         $profile = $user->getProfile();
         $bestname = $profile->getBestName();
@@ -284,7 +285,7 @@ class InviteAction extends Action
         $title = (empty($personal)) ? 'invite' : 'invitepersonal';
 
         // @todo FIXME: i18n issue.
-        $inviteTemplate = DocFile::forTitle($title, DocFile::mailPaths());
+        $inviteTemplate = DocFile::forTitle($title, DocFile::mailPaths(), $language);
 
         $body = $inviteTemplate->toHTML(array('inviter' => $bestname,
                                               'inviterurl' => $profile->profileurl,