friendica/mod/manifest.php

29 lines
597 B
PHP
Raw Normal View History

2017-04-12 20:24:27 -04:00
<?php
use Friendica\App;
2017-08-26 02:04:21 -04:00
use Friendica\Core\System;
2017-04-30 00:01:26 -04:00
use Friendica\Core\Config;
use Friendica\Core\Renderer;
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
function manifest_content(App $a) {
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
$tpl = get_markup_template('manifest.tpl');
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
header('Content-type: application/manifest+json');
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
if ($touch_icon == '') {
$touch_icon = 'images/friendica-128.png';
}
2017-04-12 20:24:27 -04:00
$o = Renderer::replaceMacros($tpl, [
'$baseurl' => System::baseUrl(),
2017-04-30 00:01:26 -04:00
'$touch_icon' => $touch_icon,
'$title' => Config::get('config', 'sitename', 'Friendica'),
]);
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
echo $o;
2017-04-12 20:24:27 -04:00
2017-04-30 00:01:26 -04:00
killme();
}