From: Philipp Holzer Date: Mon, 22 Apr 2019 10:48:40 +0000 (+0200) Subject: Move mod/manifset to src/Module/Manifset X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ac96e1bf3ef82f5e638b5adfa0be033ab612279f;p=friendica.git Move mod/manifset to src/Module/Manifset --- 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}}" - }] + } }