This commit is contained in:
Illya Marchenko 2024-05-02 11:30:01 +03:00
commit 1759b4d932
Signed by: stuzer05
GPG Key ID: A6ABAAA9268F9F4F
3 changed files with 50 additions and 0 deletions

16
composer.json Normal file

@ -0,0 +1,16 @@
{
"name": "stuzer05/manifest",
"type": "roundcube-plugin",
"description": "Provides PWA manifest",
"license": "MIT",
"version": "0.0.1",
"homepage": "https://stuzer.link",
"authors": [
{
"name": "Illya Marchenko",
"email": "dev@stuzer.link"
}
],
"repositories": [],
"require": {}
}

15
manifest.json Normal file

@ -0,0 +1,15 @@
{
"name": "Roundcube Webmail",
"short_name": "Roundcube",
"start_url": "/",
"background_color": "#ffffff",
"theme_color": "#37beff",
"icons": [
{
"src": "/skins/elastic/images/logo.svg",
"sizes": "192x192",
"type": "image/svg"
}
],
"display": "standalone"
}

19
manifest.php Normal file

@ -0,0 +1,19 @@
<?php
class manifest extends rcube_plugin
{
public $task = 'login|mail|settings|addressbook|calendar';
function init()
{
$this->add_hook('render_page', array($this, 'add_manifest'));
}
function add_manifest($p)
{
$manifest_url = $this->url('manifest.json');
$p['content'] = preg_replace('/<head>/', '<head>' . "\n" . ' <link rel="manifest" href="' . $manifest_url . '">', $p['content'], 1);
return $p;
}
}