Using the "extension" parameter
This commit is contained in:
@@ -70,6 +70,6 @@ class Index extends BaseApi
|
||||
];
|
||||
}
|
||||
|
||||
self::exit('events', ['events' => $items]);
|
||||
self::exit('events', ['events' => $items], $parameters['extension'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,6 @@ class Version extends BaseApi
|
||||
{
|
||||
public static function rawContent(array $parameters = [])
|
||||
{
|
||||
self::exit('version', ['version' => '0.9.7']);
|
||||
self::exit('version', ['version' => '0.9.7'], $parameters['extension'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,12 +30,12 @@ class Test extends BaseApi
|
||||
{
|
||||
public static function rawContent(array $parameters = [])
|
||||
{
|
||||
if (self::$format == 'xml') {
|
||||
if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
|
||||
$ok = 'true';
|
||||
} else {
|
||||
$ok = 'ok';
|
||||
}
|
||||
|
||||
self::exit('ok', ['ok' => $ok]);
|
||||
self::exit('ok', ['ok' => $ok], $parameters['extension'] ?? null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class Show extends BaseApi
|
||||
$profile = self::formatProfile($profile, $profileFields);
|
||||
|
||||
$profiles = [];
|
||||
if (self::$format == 'xml') {
|
||||
if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
|
||||
$profiles['0:profile'] = $profile;
|
||||
} else {
|
||||
$profiles[] = $profile;
|
||||
@@ -66,7 +66,7 @@ class Show extends BaseApi
|
||||
'profiles' => $profiles
|
||||
];
|
||||
|
||||
self::exit('friendica_profiles', ['$result' => $result]);
|
||||
self::exit('friendica_profiles', ['$result' => $result], $parameters['extension'] ?? null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user