X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=actions%2Fdisfavor.php;h=e9fc17c5b730fd75b9faf3baaf918859d39b48ff;hb=2dbdb0f185cb9b98097ce2f20bbd9430ab715203;hp=6b8f024a68dd6d593f11c838f800ecba3c6ab496;hpb=4737563b957e84ee06d07f373af533b2f037497a;p=quix0rs-gnu-social.git diff --git a/actions/disfavor.php b/actions/disfavor.php index 6b8f024a68..e9fc17c5b7 100644 --- a/actions/disfavor.php +++ b/actions/disfavor.php @@ -1,5 +1,4 @@ - * @author Robin Millette + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ * * StatusNet - the distributed open-source microblogging tool * Copyright (C) 2008, 2009, StatusNet, Inc. @@ -29,7 +28,7 @@ * along with this program. If not, see . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -40,10 +39,10 @@ require_once INSTALLDIR.'/lib/favorform.php'; * * @category Action * @package StatusNet - * @author Evan Prodromou - * @author Robin Millette + * @author Evan Prodromou + * @author Robin Millette * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://laconi.ca/ + * @link http://status.net/ */ class DisfavorAction extends Action { @@ -58,6 +57,7 @@ class DisfavorAction extends Action { parent::handle($args); if (!common_logged_in()) { + // TRANS: Error message displayed when trying to perform an action that requires a logged in user. $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 } } } -