roundcube-manifest/manifest.php

20 lines
471 B
PHP
Raw Permalink Normal View History

2024-05-02 11:30:01 +03:00
<?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;
}
}