]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/disfavor.php
Merge branch 'master' of gitorious.org:statusnet/mainline
[quix0rs-gnu-social.git] / actions / disfavor.php
index 6269f1bd25aa56022bc5cc076b8dcd0899d00ae0..39598d60bfd6aa08e551a4af056aa6c5ea37bd24 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * Disfavor action.
  *
@@ -58,6 +57,7 @@ class DisfavorAction extends Action
     {
         parent::handle($args);
         if (!common_logged_in()) {
+            // TRANS: Client error displayed when trying to remove a favorite while not logged in.
             $this->clientError(_('Not logged in.'));
             return;
         }
@@ -71,19 +71,22 @@ class DisfavorAction extends Action
         $notice = Notice::staticGet($id);
         $token  = $this->trimmed('token-'.$notice->id);
         if (!$token || $token != common_session_token()) {
-            $this->clientError(_("There was a problem with your session token. Try again, please."));
+            // TRANS: Client error displayed when the session token does not match or is not given.
+            $this->clientError(_('There was a problem with your session token. Try again, please.'));
             return;
         }
         $fave            = new Fave();
         $fave->user_id   = $user->id;
         $fave->notice_id = $notice->id;
         if (!$fave->find(true)) {
+            // TRANS: Client error displayed when trying to remove favorite status for a notice that is not a favorite.
             $this->clientError(_('This notice is not a favorite!'));
             return;
         }
         $result = $fave->delete();
         if (!$result) {
             common_log_db_error($fave, 'DELETE', __FILE__);
+            // TRANS: Server error displayed when removing a favorite from the database fails.
             $this->serverError(_('Could not delete favorite.'));
             return;
         }
@@ -91,6 +94,7 @@ class DisfavorAction extends Action
         if ($this->boolean('ajax')) {
             $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
+            // TRANS: Title for page on which favorites can be added.
             $this->element('title', null, _('Add to favorites'));
             $this->elementEnd('head');
             $this->elementStart('body');
@@ -105,4 +109,3 @@ class DisfavorAction extends Action
         }
     }
 }
-