]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apilist.php
Updating Janrain OpenID auth library
[quix0rs-gnu-social.git] / actions / apilist.php
index 7a9ce70c5c80f8d56a250c6c9462c1910aefc6ac..56d0f0f1bc14452d3eeea54d9566c77242f1f20e 100644 (file)
@@ -30,26 +30,21 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apibareauth.php';
-
 class ApiListAction extends ApiBareAuthAction
 {
     /**
      * 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;
 
     /**
@@ -64,7 +59,6 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return boolean success flag
      */
-
     function prepare($args)
     {
         parent::prepare($args);
@@ -81,7 +75,8 @@ class ApiListAction extends ApiBareAuthAction
         $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;
         }
 
@@ -93,7 +88,6 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return boolean success flag
      */
-
     function handle($args)
     {
         parent::handle($args);
@@ -117,6 +111,7 @@ class ApiListAction extends ApiBareAuthAction
             break;
         default:
             $this->clientError(
+                // TRANS: Client error displayed when coming across a non-supported API method.
                 _('API method not found.'),
                 404,
                 $this->format
@@ -129,7 +124,6 @@ class ApiListAction extends ApiBareAuthAction
      * require authentication if it is a write action or user is ambiguous
      *
      */
-
     function requiresAuth()
     {
         return parent::requiresAuth() ||
@@ -141,12 +135,12 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @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
             );
@@ -161,6 +155,7 @@ class ApiListAction extends ApiBareAuthAction
 
         if(!$result) {
             $this->clientError(
+                // TRANS: Client error displayed when an unknown error occurs updating a list.
                 _('An error occured.'),
                 503,
                 $this->format
@@ -176,6 +171,7 @@ class ApiListAction extends ApiBareAuthAction
             break;
         default:
             $this->clientError(
+                // TRANS: Client error displayed when coming across a non-supported API method.
                 _('API method not found.'),
                 404,
                 $this->format
@@ -189,12 +185,12 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @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
             );
@@ -212,6 +208,7 @@ class ApiListAction extends ApiBareAuthAction
             break;
         default:
             $this->clientError(
+                // TRANS: Client error displayed when coming across a non-supported API method.
                 _('API method not found.'),
                 404,
                 $this->format
@@ -225,7 +222,6 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return boolean is_read-only=false
      */
-
     function isReadOnly($args)
     {
         return false;
@@ -236,7 +232,6 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return String time_last_modified
      */
-
     function lastModified()
     {
         if(!empty($this->list)) {
@@ -253,7 +248,6 @@ class ApiListAction extends ApiBareAuthAction
      *
      * @return string etag
      */
-
     function etag()
     {
         if (!empty($this->list)) {
@@ -271,5 +265,4 @@ class ApiListAction extends ApiBareAuthAction
 
         return null;
     }
-
 }