if ($this->book->parametres->scorm_enable) {
$this->book->parametres->seoVersion = false;
}
+
if ($this->book->parametres->embedAllLibraries) {
$this->addVideoJs();
$this->addSlideshowLibrary(false);
if ($this->theme->parametres->favicon != '') {
$pngFile = $this->checkThemeImage($this->theme->parametres->favicon);
- $icoFile = $this->checkThemeImage('favicon.ico');
+ $icoFile = $this->checkThemeImage('favicon.ico', false);
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 = new CubeIT_CommandLine('icotool');
$icotool->setArg('c');
$icotool->setArg('o', $icoFile);
$icotool->setArg(null, $tmp);
$icotool->execute();
+ if (!file_exists($icoFile)) {
+ die('error while generating ico ' . $icoFile);
+ }
+
unlink($tmp);
}
$this->log('Write CSS');
}
- protected function checkThemeImage($path)
+ protected function checkThemeImage($path, $checkExists = true)
{
$path = trim($path);
$path = trim($path, '/');
return false;
}
$p = $this->themeRoot . '/' . $path;
- if (file_exists($p)) {
+ if (!$checkExists || file_exists($p)) {
return $p;
}
$po = str_replace('.svg', '.o.svg', $p);