xref: /template/strap/action/manifest.php (revision 82a60d039cd81033dc8147c27f0a50716b7a5301)
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 * [[doku>devel:manifest|webmanifest]]
15 * https://developer.mozilla.org/en-US/docs/Web/Manifest
16 */
17
18class action_plugin_combo_manifest extends DokuWiki_Action_Plugin
19{
20
21
22    function register(Doku_Event_Handler $controller)
23    {
24
25        /* This will call the function _manifest */
26        $controller->register_hook(
27            'MANIFEST_SEND',
28            'BEFORE',
29            $this,
30            '_manifest',
31            array()
32        );
33
34
35    }
36
37
38    /**
39     * Main function; dispatches the visual comment actions
40     * @param   $event Doku_Event
41     *
42     * We take into account the file generated by https://realfavicongenerator.net/
43     *
44     *
45     *
46     */
47    function _manifest(&$event, $param)
48    {
49
50        $mediaId = ":android-chrome-192x192.png";
51        $mediaFile = mediaFN($mediaId);
52        if (file_exists($mediaFile)){
53            $url = ml($mediaId, '', true, '', true);
54            $event->data['icons'][]=
55                array(
56                    "src" => $url,
57                    "sizes" => "192x192",
58                    "type" => "image/png"
59                );
60        }
61
62    }
63
64
65
66
67}
68