xref: /plugin/combo/action/manifest.php (revision 007225e5fb2d3f64edaccd3bd447ca26effb9d68)
1<?php
2
3if (!defined('DOKU_INC')) die();
4
5
6/**
7 *
8 * To add the manifest image
9 *
10 * https://www.dokuwiki.org/devel:manifest
11 *
12 * @see <a href="https://combostrap.com/manifest">manifest</a>
13 *
14 */
15
16class action_plugin_combo_manifest extends DokuWiki_Action_Plugin
17{
18
19
20    function register(Doku_Event_Handler $controller)
21    {
22
23        /* This will call the function _manifest */
24        $controller->register_hook(
25            'MANIFEST_SEND',
26            'BEFORE',
27            $this,
28            '_manifest',
29            array()
30        );
31
32
33    }
34
35
36    /**
37     * Main function; dispatches the visual comment actions
38     * @param   $event Doku_Event
39     *
40     * We take into account the file generated by https://realfavicongenerator.net/
41     *
42     *
43     *
44     */
45    function _manifest(&$event, $param)
46    {
47
48        $mediaId = ":android-chrome-192x192.png";
49        $mediaFile = mediaFN($mediaId);
50        if (file_exists($mediaFile)){
51            $url = ml($mediaId, '', true, '', true);
52            $event->data['icons'][]=
53                array(
54                    "src" => $url,
55                    "sizes" => "192x192",
56                    "type" => "image/png"
57                );
58        }
59
60    }
61
62
63
64
65}
66