]> git.mxchange.org Git - friendica.git/blob - mod/pretheme.php
The central item fetch does work now and the API now uses these functions
[friendica.git] / mod / pretheme.php
1 <?php
2
3 use Friendica\App;
4 use Friendica\Core\Theme;
5
6 function pretheme_init(App $a) {
7
8         if ($_REQUEST['theme']) {
9                 $theme = $_REQUEST['theme'];
10                 $info = Theme::getInfo($theme);
11                 if ($info) {
12                         // unfortunately there will be no translation for this string
13                         $desc = $info['description'];
14                         $version = $info['version'];
15                         $credits = $info['credits'];
16                 } else {
17                         $desc = '';
18                         $version = '';
19                         $credits = '';
20                 }
21                 echo json_encode(['img' => Theme::getScreenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
22         }
23
24         killme();
25 }