2019-05-05 19:23:03 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Core\Theme;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prints theme specific details as a JSON string
|
|
|
|
*/
|
|
|
|
class ThemeDetails extends BaseModule
|
|
|
|
{
|
2019-11-05 20:16:26 +01:00
|
|
|
public static function rawContent($parameters)
|
2019-05-05 19:23:03 +02:00
|
|
|
{
|
|
|
|
if (!empty($_REQUEST['theme'])) {
|
|
|
|
$theme = $_REQUEST['theme'];
|
|
|
|
$info = Theme::getInfo($theme);
|
|
|
|
|
|
|
|
// Unfortunately there will be no translation for this string
|
2019-10-15 15:20:32 +02:00
|
|
|
$description = $info['description'] ?? '';
|
|
|
|
$version = $info['version'] ?? '';
|
|
|
|
$credits = $info['credits'] ?? '';
|
2019-05-05 19:23:03 +02:00
|
|
|
|
|
|
|
echo json_encode([
|
|
|
|
'img' => Theme::getScreenshot($theme),
|
|
|
|
'desc' => $description,
|
|
|
|
'version' => $version,
|
|
|
|
'credits' => $credits,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
}
|