2012-03-25 22:05:14 -04:00
|
|
|
<?php
|
|
|
|
|
2017-04-30 00:07:00 -04:00
|
|
|
use Friendica\App;
|
2018-01-17 13:52:25 -05:00
|
|
|
use Friendica\Core\Theme;
|
2017-04-30 00:07:00 -04:00
|
|
|
|
2017-01-09 07:14:25 -05:00
|
|
|
function pretheme_init(App $a) {
|
|
|
|
|
2017-04-30 00:01:26 -04:00
|
|
|
if ($_REQUEST['theme']) {
|
2012-03-26 21:15:10 -04:00
|
|
|
$theme = $_REQUEST['theme'];
|
2018-01-17 13:52:25 -05:00
|
|
|
$info = Theme::getInfo($theme);
|
2017-04-30 00:01:26 -04:00
|
|
|
if ($info) {
|
2012-03-26 21:15:10 -04:00
|
|
|
// unfortunately there will be no translation for this string
|
2012-07-23 22:37:00 -04:00
|
|
|
$desc = $info['description'];
|
|
|
|
$version = $info['version'];
|
|
|
|
$credits = $info['credits'];
|
2017-04-30 00:01:26 -04:00
|
|
|
} else {
|
2012-07-23 22:37:00 -04:00
|
|
|
$desc = '';
|
|
|
|
$version = '';
|
|
|
|
$credits = '';
|
|
|
|
}
|
2018-01-17 13:52:25 -05:00
|
|
|
echo json_encode(['img' => Theme::getScreenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
|
2012-03-26 21:15:10 -04:00
|
|
|
}
|
2017-05-11 08:54:26 -04:00
|
|
|
|
2018-12-26 00:40:12 -05:00
|
|
|
exit();
|
2012-03-25 22:05:14 -04:00
|
|
|
}
|