$favicon .= '<link rel="apple-touch-icon" href="data/apple-touch-icon.png" />' . "\n\t";
}
if ($this->theme->parametres->favicon != '') {
-
$pngFile = $this->themeRoot . '/' . $this->theme->parametres->favicon;
- $icoFile = $this->themeRoot . '/favicon.ico';
- if (!file_exists($icoFile) || filemtime($icoFile) < filemtime($pngFile) || filemtime(__FILE__) > filemtime($icoFile)) {
- $tmp = CubeIT_Files::tempnam() . '.png';
- $convert = "convert $pngFile -resize 64x64^ -gravity center $tmp";
- `$convert`;
-
- $icotool = new cubeCommandLine('icotool');
- $icotool->setArg('c');
- $icotool->setArg('o', $icoFile);
- $icotool->setArg(null, $tmp);
- $icotool->execute();
-
- unlink($tmp);
- }
$this->vdir->copy($pngFile, 'data/favicon.png');
- $this->vdir->copy($icoFile, 'data/favicon.ico');
-
- $dataico = 'data:image/vnd.microsoft.icon;base64,' . base64_encode(file_get_contents($icoFile));
$datapng = 'data:image/png;base64,' . base64_encode(file_get_contents($pngFile));
- $favicon .= '<link rel="shortcut icon" href="' . $dataico . '" />' . "\n\t";
- $favicon .= '<link rel="icon" type="image/vnd.microsoft.icon" href="' . $dataico . '" />' . "\n\t";
$favicon .= '<link rel="icon" type="image/png" href="' . $datapng . '" />' . "\n\t";
if (!$hasIos) {
$favicon .= '<link rel="apple-touch-icon" href="data/favicon.png" />';