mirror of
https://github.com/friendica/friendica
synced 2024-12-23 08:00:16 +00:00
Merge pull request #7029 from nupplaphil/task/mod_manifest
Move mod/manifest to src/Module/Manifest
This commit is contained in:
commit
2d1e771178
2 changed files with 34 additions and 28 deletions
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Renderer;
|
||||
|
||||
function manifest_content(App $a) {
|
||||
|
||||
$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';
|
||||
}
|
||||
|
||||
$o = Renderer::replaceMacros($tpl, [
|
||||
'$baseurl' => System::baseUrl(),
|
||||
'$touch_icon' => $touch_icon,
|
||||
'$title' => Config::get('config', 'sitename', 'Friendica'),
|
||||
]);
|
||||
|
||||
echo $o;
|
||||
|
||||
exit();
|
||||
}
|
34
src/Module/Manifest.php
Normal file
34
src/Module/Manifest.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Renderer;
|
||||
|
||||
class Manifest extends BaseModule
|
||||
{
|
||||
public static function rawContent()
|
||||
{
|
||||
$app = self::getApp();
|
||||
$config = $app->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();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue