2019-05-05 17:23:03 +00:00
|
|
|
<?php
|
2024-08-24 13:27:00 +00:00
|
|
|
|
|
|
|
// Copyright (C) 2010-2024, the Friendica project
|
|
|
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
2019-05-05 17:23:03 +00:00
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
2022-04-09 11:58:01 +00:00
|
|
|
use Friendica\Core\System;
|
2019-05-05 17:23:03 +00:00
|
|
|
use Friendica\Core\Theme;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints theme specific details as a JSON string
|
|
|
|
*/
|
|
|
|
class ThemeDetails extends BaseModule
|
|
|
|
{
|
2021-11-20 14:38:03 +00:00
|
|
|
protected function rawContent(array $request = [])
|
2019-05-05 17:23:03 +00:00
|
|
|
{
|
|
|
|
if (!empty($_REQUEST['theme'])) {
|
|
|
|
$theme = $_REQUEST['theme'];
|
|
|
|
$info = Theme::getInfo($theme);
|
|
|
|
|
|
|
|
// Unfortunately there will be no translation for this string
|
2019-10-15 13:20:32 +00:00
|
|
|
$description = $info['description'] ?? '';
|
|
|
|
$version = $info['version'] ?? '';
|
|
|
|
$credits = $info['credits'] ?? '';
|
2019-05-05 17:23:03 +00:00
|
|
|
|
2023-09-21 16:16:17 +00:00
|
|
|
$this->jsonExit([
|
2019-05-05 17:23:03 +00:00
|
|
|
'img' => Theme::getScreenshot($theme),
|
|
|
|
'desc' => $description,
|
|
|
|
'version' => $version,
|
|
|
|
'credits' => $credits,
|
|
|
|
]);
|
|
|
|
}
|
2022-05-18 02:13:54 +00:00
|
|
|
System::exit();
|
2019-05-05 17:23:03 +00:00
|
|
|
}
|
|
|
|
}
|