/**
* The list in question in the current request
*/
-
var $list = null;
/**
* Is this an update request?
*/
-
var $update = false;
/**
* Is this a delete request?
*/
-
var $delete = false;
/**
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
$this->list = $this->getTargetList($this->arg('user'), $this->arg('id'));
if (empty($this->list)) {
- $this->clientError(_('Not found'), 404, $this->format);
+ // TRANS: Client error displayed when referring to a non-existing list.
+ $this->clientError(_('List not found.'), 404, $this->format);
return false;
}
*
* @return boolean success flag
*/
-
function handle($args)
{
parent::handle($args);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
* require authentication if it is a write action or user is ambiguous
*
*/
-
function requiresAuth()
{
return parent::requiresAuth() ||
*
* @return boolean success
*/
-
function handlePut()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You can not update lists that don\'t belong to you.'),
+ // TRANS: Client error displayed when trying to update another user's list.
+ _('You cannot update lists that do not belong to you.'),
401,
$this->format
);
if(!$result) {
$this->clientError(
+ // TRANS: Client error displayed when an unknown error occurs updating a list.
_('An error occured.'),
503,
$this->format
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean success
*/
-
function handleDelete()
{
if($this->auth_user->id != $this->list->tagger) {
$this->clientError(
- _('You can not delete lists that don\'t belong to you.'),
+ // TRANS: Client error displayed when trying to delete another user's list.
+ _('You cannot delete lists that do not belong to you.'),
401,
$this->format
);
break;
default:
$this->clientError(
+ // TRANS: Client error displayed when coming across a non-supported API method.
_('API method not found.'),
404,
$this->format
*
* @return boolean is_read-only=false
*/
-
function isReadOnly($args)
{
return false;
*
* @return String time_last_modified
*/
-
function lastModified()
{
if(!empty($this->list)) {
*
* @return string etag
*/
-
function etag()
{
if (!empty($this->list)) {
return null;
}
-
}