mirror of
https://github.com/friendica/friendica
synced 2025-04-25 15:10:13 +00:00
Move mod/pretheme to src/Module/ThemeDetails
This commit is contained in:
parent
155d541860
commit
3f71a51d21
3 changed files with 34 additions and 25 deletions
33
src/Module/ThemeDetails.php
Normal file
33
src/Module/ThemeDetails.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Theme;
|
||||
|
||||
/**
|
||||
* Prints theme specific details as a JSON string
|
||||
*/
|
||||
class ThemeDetails extends BaseModule
|
||||
{
|
||||
public static function rawContent()
|
||||
{
|
||||
if (!empty($_REQUEST['theme'])) {
|
||||
$theme = $_REQUEST['theme'];
|
||||
$info = Theme::getInfo($theme);
|
||||
|
||||
// Unfortunately there will be no translation for this string
|
||||
$description = defaults($info, 'description', '');
|
||||
$version = defaults($info, 'version' , '');
|
||||
$credits = defaults($info, 'credits' , '');
|
||||
|
||||
echo json_encode([
|
||||
'img' => Theme::getScreenshot($theme),
|
||||
'desc' => $description,
|
||||
'version' => $version,
|
||||
'credits' => $credits,
|
||||
]);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue