xref: /template/sprintdoc/tpl/favicon_tiles.php (revision 4134f067dfee5c2cc8a0097b00bfd428b2946213)
1ca90ebc1SJana Deutschländer<?php
206cdf148SAndreas Gohr/**
306cdf148SAndreas Gohr * Embed the various bookmarking icon sizes
406cdf148SAndreas Gohr *
506cdf148SAndreas Gohr * Basically it will first check for an exact image in the right size in the wiki namespace, then for generally named
606cdf148SAndreas Gohr * logos in the wiki namespace and finally it falls back to the logo configured in the template.
706cdf148SAndreas Gohr *
806cdf148SAndreas Gohr *
906cdf148SAndreas Gohr * @author Andreas Gohr <gohr@cosmocode.de>
1006cdf148SAndreas Gohr */
1106cdf148SAndreas Gohruse dokuwiki\template\sprintdoc\Template;
1206cdf148SAndreas Gohr
13ca90ebc1SJana Deutschländerif(!defined('DOKU_INC')) die();
14ca90ebc1SJana Deutschländer
1506cdf148SAndreas Gohr// standard favicon
1606cdf148SAndreas Gohrecho Template::getResizedImgTag(
1706cdf148SAndreas Gohr    'link',
1806cdf148SAndreas Gohr    array(
1906cdf148SAndreas Gohr        'rel' => 'shortcut icon',
20*4134f067SMichael Große        'href' => array('wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo-square.png')
2106cdf148SAndreas Gohr    ),
2206cdf148SAndreas Gohr    0, 0 // no scaling
2306cdf148SAndreas Gohr);
24ca90ebc1SJana Deutschländer
2506cdf148SAndreas Gohr// square apple icons
2606cdf148SAndreas Gohrforeach(array(57, 60, 72, 76, 114, 120, 144, 152, 180) as $size) {
2706cdf148SAndreas Gohr    echo Template::getResizedImgTag(
2806cdf148SAndreas Gohr        'link',
2906cdf148SAndreas Gohr        array(
3006cdf148SAndreas Gohr            'rel' => 'apple-touch-icon',
3106cdf148SAndreas Gohr            'sizes' => $size . 'x' . $size,
32*4134f067SMichael Große            'href' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png'),
3306cdf148SAndreas Gohr        ),
3406cdf148SAndreas Gohr        $size, $size
3506cdf148SAndreas Gohr    );
3606cdf148SAndreas Gohr}
37ca90ebc1SJana Deutschländer
3806cdf148SAndreas Gohr// square favicons
3906cdf148SAndreas Gohrforeach(array(32, 96, 192) as $size) {
4006cdf148SAndreas Gohr    echo Template::getResizedImgTag(
4106cdf148SAndreas Gohr        'link',
4206cdf148SAndreas Gohr        array(
4306cdf148SAndreas Gohr            'rel' => 'icon',
4406cdf148SAndreas Gohr            'sizes' => $size . 'x' . $size,
45*4134f067SMichael Große            'href' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png')
4606cdf148SAndreas Gohr        ),
4706cdf148SAndreas Gohr        $size, $size
4806cdf148SAndreas Gohr    );
4906cdf148SAndreas Gohr}
50ca90ebc1SJana Deutschländer
5106cdf148SAndreas Gohr// square microsoft icons
5206cdf148SAndreas Gohrforeach(array(70, 310) as $size) {
5306cdf148SAndreas Gohr    echo Template::getResizedImgTag(
5406cdf148SAndreas Gohr        'meta',
5506cdf148SAndreas Gohr        array(
5606cdf148SAndreas Gohr            'name' => 'msapplication-square' . $size . 'x' . $size . 'logo',
57*4134f067SMichael Große            'content' => array('wiki:logo-' . $size . 'x' . $size . '.png', 'wiki:logo-square.png', 'wiki:favicon.ico', 'wiki:favicon.png', 'wiki:logo.png'),
5806cdf148SAndreas Gohr        ),
5906cdf148SAndreas Gohr        $size, $size
6006cdf148SAndreas Gohr    );
6106cdf148SAndreas Gohr}
6206cdf148SAndreas Gohr
6306cdf148SAndreas Gohr// wide micorsoft icons
6406cdf148SAndreas Gohrforeach(array(array(310, 150)) as $size) {
6506cdf148SAndreas Gohr    echo Template::getResizedImgTag(
6606cdf148SAndreas Gohr        'meta',
6706cdf148SAndreas Gohr        array(
6806cdf148SAndreas Gohr            'name' => 'msapplication-wide' . $size[0] . 'x' . $size[1] . 'logo',
69e302d67fSMichael Große            'content' => array('wiki:logo-' . $size[0] . 'x' . $size[1] . '.png', 'wiki:logo-wide.png', 'wiki:logo.png')
7006cdf148SAndreas Gohr        ),
7106cdf148SAndreas Gohr        $size[0], $size[1]
7206cdf148SAndreas Gohr    );
7306cdf148SAndreas Gohr}
74