]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/twitapilaconica.php
A different search pagination fix (see ticket #1333) that doesn't require fixing...
[quix0rs-gnu-social.git] / actions / twitapilaconica.php
index 9d9fcef6f543ce079cdd1915a8ba2850438e5f9d..8cd7a64b9f40b27de55b9cff9beeb224b3f96134 100644 (file)
@@ -70,7 +70,7 @@ class TwitapilaconicaAction extends TwitterapiAction
         switch ($apidata['content-type']) {
          case 'xml':
             $this->init_document('xml');
-            common_element('version', null, LACONICA_VERSION);
+            $this->element('version', null, LACONICA_VERSION);
             $this->end_document('xml');
             break;
          case 'json':
@@ -79,7 +79,7 @@ class TwitapilaconicaAction extends TwitterapiAction
             $this->end_document('json');
             break;
          default:
-            $this->client_error(_('API method not found!'), $code=404);
+            $this->clientError(_('API method not found!'), $code=404);
         }
     }
 
@@ -115,14 +115,24 @@ class TwitapilaconicaAction extends TwitterapiAction
         switch ($apidata['content-type']) {
          case 'xml':
             $this->init_document('xml');
+            $this->elementStart('config');
             // XXX: check that all sections and settings are legal XML elements
             foreach ($keys as $section => $settings) {
-                common_element_start($section);
+                $this->elementStart($section);
                 foreach ($settings as $setting) {
-                    common_element($setting, null, common_config($section, $setting));
+                    $value = common_config($section, $setting);
+                    if (is_array($value)) {
+                        $value = implode(',', $value);
+                    } else if ($value === false) {
+                        $value = 'false';
+                    } else if ($value === true) {
+                        $value = 'true';
+                    }
+                    $this->element($setting, null, $value);
                 }
-                common_element_end($section);
+                $this->elementEnd($section);
             }
+            $this->elementEnd('config');
             $this->end_document('xml');
             break;
          case 'json':
@@ -138,7 +148,7 @@ class TwitapilaconicaAction extends TwitterapiAction
             $this->end_document('json');
             break;
          default:
-            $this->client_error(_('API method not found!'), $code=404);
+            $this->clientError(_('API method not found!'), $code=404);
         }
     }
 
@@ -159,6 +169,6 @@ class TwitapilaconicaAction extends TwitterapiAction
     function wadl($args, $apidata)
     {
         parent::handle($args);
-        common_server_error(_('API method under construction.'), 501);
+        $this->serverError(_('API method under construction.'), 501);
     }
 }