]> git.mxchange.org Git - friendica.git/blob - src/Module/ThemeDetails.php
Added parameter to rawContent
[friendica.git] / src / Module / ThemeDetails.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\Core\Theme;
7
8 /**
9  * Prints theme specific details as a JSON string
10  */
11 class ThemeDetails extends BaseModule
12 {
13         public static function rawContent($parameters)
14         {
15                 if (!empty($_REQUEST['theme'])) {
16                         $theme = $_REQUEST['theme'];
17                         $info = Theme::getInfo($theme);
18
19                         // Unfortunately there will be no translation for this string
20                         $description = $info['description'] ?? '';
21                         $version     = $info['version']     ?? '';
22                         $credits     = $info['credits']     ?? '';
23
24                         echo json_encode([
25                                 'img'     => Theme::getScreenshot($theme),
26                                 'desc'    => $description,
27                                 'version' => $version,
28                                 'credits' => $credits,
29                         ]);
30                 }
31                 exit();
32         }
33 }