]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/invite.php
Added basic language support for sending out invitations:
[quix0rs-gnu-social.git] / actions / invite.php
index 2853fb070768f4b7477af85544957bb39dd039f4..b6e0ba8dd17dffb23151548219844316c90f29d1 100644 (file)
@@ -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,