]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/repeat.php
Merge remote branch 'gitorious/1.0.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / repeat.php
index e112496bc120dbab109235077b5faa94260764a8..869c2ddd4ee1851c073586789020768b64eb56a0 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Repeat action.
  *
@@ -41,7 +40,6 @@ if (!defined('STATUSNET')) {
  * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
  * @link     http://status.net/
  */
-
 class RepeatAction extends Action
 {
     var $user = null;
@@ -54,40 +52,45 @@ class RepeatAction extends Action
         $this->user = common_current_user();
 
         if (empty($this->user)) {
-            $this->clientError(_("Only logged-in users can repeat notices."));
+            // TRANS: Client error displayed when trying to repeat a notice while not logged in.
+            $this->clientError(_('Only logged-in users can repeat notices.'));
             return false;
         }
 
         $id = $this->trimmed('notice');
 
         if (empty($id)) {
-            $this->clientError(_("No notice specified."));
+            // TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID.
+            $this->clientError(_('No notice specified.'));
             return false;
         }
 
         $this->notice = Notice::staticGet('id', $id);
 
         if (empty($this->notice)) {
-            $this->clientError(_("No notice specified."));
+            // TRANS: Client error displayed when trying to repeat a non-existing notice.
+            $this->clientError(_('No notice specified.'));
             return false;
         }
 
         if ($this->user->id == $this->notice->profile_id) {
-            $this->clientError(_("You can't repeat your own notice."));
+            // TRANS: Client error displayed when trying to repeat an own notice.
+            $this->clientError(_('You cannot repeat your own notice.'));
             return false;
         }
 
         $token  = $this->trimmed('token-'.$id);
 
         if (empty($token) || $token != common_session_token()) {
-            $this->clientError(_("There was a problem with your session token. Try again, please."));
+            $this->clientError(_('There was a problem with your session token. Try again, please.'));
             return false;
         }
 
         $profile = $this->user->getProfile();
 
         if ($profile->hasRepeated($id)) {
-            $this->clientError(_("You already repeated that notice."));
+            // TRANS: Client error displayed when trying to repeat an already repeated notice.
+            $this->clientError(_('You already repeated that notice.'));
             return false;
         }
 
@@ -101,26 +104,25 @@ class RepeatAction extends Action
      *
      * @return void
      */
-
     function handle($args)
     {
         $repeat = $this->notice->repeat($this->user->id, 'web');
 
-
-
         if ($this->boolean('ajax')) {
             $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
+            // TRANS: Title after repeating a notice.
             $this->element('title', null, _('Repeated'));
             $this->elementEnd('head');
             $this->elementStart('body');
             $this->element('p', array('id' => 'repeat_response',
                                       'class' => 'repeated'),
+                                // TRANS: Confirmation text after repeating a notice.
                                 _('Repeated!'));
             $this->elementEnd('body');
             $this->elementEnd('html');
         } else {
-            // FIXME!
+            // @todo FIXME!
         }
     }
 }