X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpretheme.php;h=4989eb87b716539b7436c98e7cfb7a48b5d5b099;hb=c17adaf3333b356d0c7b19226b29cd733a43017b;hp=5a71bbe53e45168b8c99498254fe05f6e631da50;hpb=be52ec6f5ad57493286068df8b854a13a815dbf9;p=friendica.git diff --git a/mod/pretheme.php b/mod/pretheme.php index 5a71bbe53e..4989eb87b7 100644 --- a/mod/pretheme.php +++ b/mod/pretheme.php @@ -1,6 +1,25 @@ get_theme_screenshot($_REQUEST['theme']))); +use Friendica\App; +use Friendica\Core\Theme; + +function pretheme_init(App $a) { + + if ($_REQUEST['theme']) { + $theme = $_REQUEST['theme']; + $info = Theme::getInfo($theme); + if ($info) { + // unfortunately there will be no translation for this string + $desc = $info['description']; + $version = $info['version']; + $credits = $info['credits']; + } else { + $desc = ''; + $version = ''; + $credits = ''; + } + echo json_encode(['img' => Theme::getScreenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]); + } + killme(); }