friendica/mod/pretheme.php

25 lines
537 B
PHP
Raw Normal View History

2012-03-25 22:05:14 -04:00
<?php
use Friendica\App;
function pretheme_init(App $a) {
2017-04-30 00:01:26 -04:00
if ($_REQUEST['theme']) {
$theme = $_REQUEST['theme'];
$info = get_theme_info($theme);
2017-04-30 00:01:26 -04:00
if ($info) {
// 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 = '';
}
echo json_encode(['img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits]);
}
2012-03-25 22:05:14 -04:00
killme();
}