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