]> git.mxchange.org Git - friendica.git/blob - mod/pretheme.php
be92885b72938a864d61b6fdd35267ce4d05111b
[friendica.git] / mod / pretheme.php
1 <?php
2
3 use Friendica\App;
4
5 function pretheme_init(App $a) {
6
7         if ($_REQUEST['theme']) {
8                 $theme = $_REQUEST['theme'];
9                 $info = get_theme_info($theme);
10                 if ($info) {
11                         // unfortunately there will be no translation for this string
12                         $desc = $info['description'];
13                         $version = $info['version'];
14                         $credits = $info['credits'];
15                 } else {
16                         $desc = '';
17                         $version = '';
18                         $credits = '';
19                 }
20                 echo json_encode(['img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
21         }
22
23         killme();
24 }