From ac96e1bf3ef82f5e638b5adfa0be033ab612279f Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Mon, 22 Apr 2019 12:48:40 +0200 Subject: [PATCH] Move mod/manifset to src/Module/Manifset --- mod/manifest.php | 28 ---------------------------- src/Module/Manifest.php | 34 ++++++++++++++++++++++++++++++++++ view/templates/manifest.tpl | 4 ++-- 3 files changed, 36 insertions(+), 30 deletions(-) delete mode 100644 mod/manifest.php create mode 100644 src/Module/Manifest.php 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}}" - }] + } }