diff --git a/mod/manifest.php b/mod/manifest.php deleted file mode 100644 index bdb5298ef3..0000000000 --- a/mod/manifest.php +++ /dev/null @@ -1,28 +0,0 @@ - System::baseUrl(), - '$touch_icon' => $touch_icon, - '$title' => Config::get('config', 'sitename', 'Friendica'), - ]); - - echo $o; - - exit(); -} diff --git a/src/Module/Manifest.php b/src/Module/Manifest.php new file mode 100644 index 0000000000..40ae53891e --- /dev/null +++ b/src/Module/Manifest.php @@ -0,0 +1,34 @@ +getConfig(); + + $tpl = Renderer::getMarkupTemplate('manifest.tpl'); + + header('Content-type: application/manifest+json'); + + $touch_icon = $config->get('system', 'touch_icon', 'images/friendica-128.png'); + if ($touch_icon == '') { + $touch_icon = 'images/friendica-128.png'; + } + + $output = Renderer::replaceMacros($tpl, [ + '$baseurl' => $app->getBaseURL(), + '$touch_icon' => $touch_icon, + '$title' => $config->get('config', 'sitename', 'Friendica'), + ]); + + echo $output; + + exit(); + } +} diff --git a/view/templates/manifest.tpl b/view/templates/manifest.tpl index 6f9294774d..b4b369cb94 100644 --- a/view/templates/manifest.tpl +++ b/view/templates/manifest.tpl @@ -3,7 +3,7 @@ "start_url": "{{$baseurl}}", "display": "standalone", "description": "A Decentralized Social Network", - "icons": [{ + "icons": { "src": "{{$baseurl}}/{{$touch_icon}}" - }] + } }