Merge pull request #7102 from nupplaphil/task/mod_pretheme

Move mod/pretheme to src/Module/ThemeDetails
This commit is contained in:
Hypolite Petovan 2019-05-05 20:33:21 -04:00 committed by GitHub
commit b79201beaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 25 deletions

View 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();
}
}