1<?php
2/**
3 * Embed the various bookmarking icon sizes
4 *
5 * Basically it will first check for an exact image in the right size in the wiki namespace, then for generally named
6 * logos in the wiki namespace and finally it falls back to the logo configured in the template.
7 *
8 *
9 * @author Andreas Gohr <gohr@cosmocode.de>
10 */
11use dokuwiki\template\sprintdoc\Template;
12
13if(!defined('DOKU_INC')) die();
14
15// standard favicon
16echo Template::getResizedImgTag(
17    'link',
18    array(
19        'rel' => 'shortcut icon',
20        'href' => array('wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo-square.png')
21    ),
22    0, 0 // no scaling
23);
24
25// square apple icons
26foreach(array(57, 60, 72, 76, 114, 120, 144, 152, 180) as $size) {
27    echo Template::getResizedImgTag(
28        'link',
29        array(
30            'rel' => 'apple-touch-icon',
31            'sizes' => $size . 'x' . $size,
32            'href' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png'),
33        ),
34        $size, $size
35    );
36}
37
38// square favicons
39foreach(array(32, 96, 192) as $size) {
40    echo Template::getResizedImgTag(
41        'link',
42        array(
43            'rel' => 'icon',
44            'sizes' => $size . 'x' . $size,
45            'href' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png')
46        ),
47        $size, $size
48    );
49}
50
51// square microsoft icons
52foreach(array(70, 310) as $size) {
53    echo Template::getResizedImgTag(
54        'meta',
55        array(
56            'name' => 'msapplication-square' . $size . 'x' . $size . 'logo',
57            'content' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png'),
58        ),
59        $size, $size
60    );
61}
62
63// wide micorsoft icons
64foreach(array(array(310, 150)) as $size) {
65    echo Template::getResizedImgTag(
66        'meta',
67        array(
68            'name' => 'msapplication-wide' . $size[0] . 'x' . $size[1] . 'logo',
69            'content' => array('wiki:logo-' . $size[0] . 'x' . $size[1] . '.png', 'wiki:logo-wide.png', 'wiki:logo.png')
70        ),
71        $size[0], $size[1]
72    );
73}
74