mirror of
https://github.com/friendica/friendica
synced 2024-11-14 05:02:54 +00:00
db949bb802
Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
24 lines
561 B
PHP
24 lines
561 B
PHP
<?php
|
|
|
|
if(! function_exists('pretheme_init')) {
|
|
function pretheme_init(&$a) {
|
|
|
|
if($_REQUEST['theme']) {
|
|
$theme = $_REQUEST['theme'];
|
|
$info = get_theme_info($theme);
|
|
if($info) {
|
|
// unfortunately there will be no translation for this string
|
|
$desc = $info['description'];
|
|
$version = $info['version'];
|
|
$credits = $info['credits'];
|
|
}
|
|
else {
|
|
$desc = '';
|
|
$version = '';
|
|
$credits = '';
|
|
}
|
|
echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
|
|
}
|
|
killme();
|
|
}
|
|
}
|