<?php
-
/**
* Anonyous favor action
*
$profile = AnonymousFavePlugin::getAnonProfile();
if (empty($profile) || $_SERVER['REQUEST_METHOD'] != 'POST') {
- $this->clientError(
- _m('Could not favor notice! Please make sure your browser has cookies enabled.')
+ // TRANS: Client error.
+ $this->clientError( _m('Could not favor notice! Please make sure your browser has cookies enabled.')
);
return;
}
$token = $this->trimmed('token-' . $notice->id);
if (empty($token) || $token != common_session_token()) {
+ // TRANS: Client error.
$this->clientError(_m('There was a problem with your session token. Try again, please.'));
return;
}
if ($profile->hasFave($notice)) {
+ // TRANS: Client error.
$this->clientError(_m('This notice is already a favorite!'));
return;
}
$fave = Fave::addNew($profile, $notice);
if (!$fave) {
+ // TRANS: Server error.
$this->serverError(_m('Could not create favorite.'));
return;
}
if ($this->boolean('ajax')) {
$this->startHTML('text/xml;charset=utf-8');
$this->elementStart('head');
+ // TRANS: Title.
$this->element('title', null, _m('Disfavor favorite'));
$this->elementEnd('head');
$this->elementStart('body');