friendica-github/src/Module/ThemeDetails.php

40 lines
923 B
PHP
Raw Normal View History

<?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
namespace Friendica\Module;
use Friendica\BaseModule;
2022-04-09 11:58:01 +00:00
use Friendica\Core\System;
use Friendica\Core\Theme;
/**
* Prints theme specific details as a JSON string
*/
class ThemeDetails extends BaseModule
{
protected function rawContent(array $request = [])
{
if (!empty($_REQUEST['theme'])) {
$theme = $_REQUEST['theme'];
$info = Theme::getInfo($theme);
// Unfortunately there will be no translation for this string
$description = $info['description'] ?? '';
$version = $info['version'] ?? '';
$credits = $info['credits'] ?? '';
$this->jsonExit([
'img' => Theme::getScreenshot($theme),
'desc' => $description,
'version' => $version,
'credits' => $credits,
]);
}
2022-05-18 02:13:54 +00:00
System::exit();
}
}