]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/AutoSandbox/AutoSandboxPlugin.php
Events on user registrations now strictly typed
[quix0rs-gnu-social.git] / plugins / AutoSandbox / AutoSandboxPlugin.php
index 16683e1402589421d9cea0ff73c92f48c3c46b18..ca48020ea3b8668d73947010a2eff615eb121914 100644 (file)
@@ -63,21 +63,24 @@ class AutoSandboxPlugin extends Plugin
                             'author' => 'Sean Carmody',
                             'homepage' => 'http://status.net/wiki/Plugin:AutoSandbox',
                             'rawdescription' =>
+                            // TRANS: Plugin description.
                             _m('Automatically sandboxes newly registered members.'));
         return true;
     }
 
     function onStartRegistrationFormData($action)
     {
+         // TRANS: User instructions after registration.
          $instr = _m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline.');
 
          if (isset($this->contact)) {
-             $contactuser = User::staticGet('nickname', $this->contact);
+             $contactuser = User::getKV('nickname', $this->contact);
              if (!empty($contactuser)) {
                  $contactlink = "@<a href=\"$contactuser->uri\">$contactuser->nickname</a>";
-                 // TRANS: $contactlink is a clickable e-mailaddress.
-                 $instr = _m("Note you will initially be \"sandboxed\" so your posts will not appear in the public timeline. ".
-                   'Send a message to $contactlink to speed up the unsandboxing process.');
+                 // TRANS: User instructions after registration.
+                 // TRANS: %s is a clickable e-mailaddress.
+                 $instr = sprintf(_m('Note you will initially be "sandboxed" so your posts will not appear in the public timeline. '.
+                   'Send a message to %s to speed up the unsandboxing process.'),$contactlink);
              }
          }
 
@@ -87,11 +90,11 @@ class AutoSandboxPlugin extends Plugin
          $action->elementEnd('div');
     }
 
-    function onEndUserRegister(&$profile,&$user)
+    public function onEndUserRegister(Profile $profile)
     {
-       $profile->sandbox();
-       if ($this->debug) {
-           common_log(LOG_WARNING, "AutoSandbox: sandboxed of $user->nickname");
+        $profile->sandbox();
+        if ($this->debug) {
+            common_log(LOG_WARNING, "AutoSandbox: sandboxed of $profile->nickname");
         }
     }
 }