From: vincent@cubedesigners.com Date: Tue, 6 Feb 2018 18:12:53 +0000 (+0000) Subject: fix #1904 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=44559c21cc7611456eefefec0e8f4d8170f99c80;p=cubeextranet.git fix #1904 @1 --- diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 942a1250a..86484d626 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -539,9 +539,31 @@ class wsHTML5Compiler { $favicon = ''; + $hasIos = false; + if ($this->theme->parametres->iosicon != '') { + $hasIos = true; + $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->iosicon, 'data/apple-touch-icon.png'); + $favicon .= ''; + } if ($this->theme->parametres->favicon != '') { - $this->vdir->copy($this->themeRoot . '/' . $this->theme->parametres->favicon, 'data/favicon.png'); - $favicon = ''; + + $pngFile = $this->themeRoot . '/' . $this->theme->parametres->favicon; + $icoFile = $this->themeRoot . '/favicon.ico'; + if (!file_exists($icoFile) || filemtime($icoFile) < filemtime($pngFile)) { + $icotool = new cubeCommandLine('icotool'); + $icotool->setArg('c'); + $icotool->setArg('o', $icoFile); + $icotool->setArg(null, $pngFile); + $icotool->execute(); + } + $this->vdir->copy($pngFile, 'data/favicon.png'); + $this->vdir->copy($icoFile, 'data/favicon.ico'); + $favicon .= ''; + $favicon .= ''; + $favicon .= ''; + if (!$hasIos) { + $favicon .= ''; + } } $print = $this->writePrint();