api-status: add sitemap_url property if the page-sitemap module is present

This commit is contained in:
Starbeamrainbowlabs 2020-10-26 18:26:33 +00:00
parent 59b40026fc
commit d7128eed0e
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,7 @@
register_module([
"name" => "API status",
"version" => "0.1",
"version" => "0.2",
"author" => "Starbeamrainbowlabs",
"description" => "Provides a basic JSON status action that provides a few useful bits of information for API consumption.",
"id" => "api-status",
@ -41,6 +41,8 @@ register_module([
$result->available_actions = $action_names;
$result->wiki_name = $settings->sitename;
$result->logo_url = $settings->favicon;
if(module_exists("page-sitemap"))
$result->sitemap_url = url_stem()."?action=sitemap";
header("content-type: application/json");
exit($minified ? json_encode($result) : json_encode($result, JSON_PRETTY_PRINT) . "\n");