From 3ed28ea26fe79c265573fd39ed895b4093f98523 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 23 Jul 2018 15:34:54 +0000 Subject: [PATCH] wip #2150 @0.5 --- .../html5/master/class.ws.html5.compiler.php | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) 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 b901bc57e..853b1651f 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -162,6 +162,8 @@ class wsHTML5Compiler public $beginBody = array(); public $seoArticles = []; public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com']; + + public $_signature; /** * @var wsHTML5Seo */ @@ -362,9 +364,15 @@ class wsHTML5Compiler $this->writeLangs(); $this->log('Langs written'); $this->writeSEO(); + $this->log('SEO written'); $this->writeIndex(); - $this->writeWidget(); $this->log('Index written'); + if ($this->book->parametres->scorm_enable) { + $this->writeScorm(); + $this->log('SCORM written'); + } + $this->writeWidget(); + $this->log('Widget written'); $this->writeSounds(); $this->log('Sound written'); $this->writeTexts(); @@ -419,15 +427,6 @@ class wsHTML5Compiler public function getVideosFormats($poster = true) { $res = []; - // - // if (!$this->phonegap) { - // $res = array('ogv', 'webm', 'mp4', 'flv'); - // } elseif ($this->phonegap == 'ios') { - // $res = array('mp4'); - // } else if ($this->phonegap == 'android') { - // $res = array('webm', 'mp4'); - // } - $res[] = 'mp4'; if ($poster) { @@ -488,19 +487,16 @@ class wsHTML5Compiler $titre = $this->book->parametres->title; - $daoSignature = new wsDAOSignature($core->con); - $signature = $daoSignature->selectById($this->book->parametres->signature); - - $exportSignature = array('main' => $signature->main, - 'mainLink' => $signature->mainLink, - 'partner' => $signature->partner, - 'partnerLink' => $signature->partnerLink); + if (null === $this->_signature) { + $daoSignature = new wsDAOSignature($core->con); + $this->_signature = $daoSignature->selectById($this->book->parametres->signature); + } $credits = ''; - if ($signature->partner != '') { - $credits = '' . $signature->partner . ' '; + if ($this->_signature->partner != '') { + $credits = '' . $this->_signature->partner . ' '; } - $credits .= '' . $signature->main . ''; + $credits .= '' . $this->_signature->main . ''; $hiddenContents = implode("\n", $this->hiddenContents); @@ -533,7 +529,6 @@ class wsHTML5Compiler $script .= '' . "\n"; if ($this->book->parametres->scorm_enable) { $script .= '' . "\n"; - $this->writeScorm(); } if (count($this->specialJsFiles)) { $script .= '' . "\n"; @@ -545,7 +540,7 @@ class wsHTML5Compiler $socialTitle = $this->book->parametres->facebook_title ? $this->book->parametres->facebook_title : $titre; $socialDescription = $this->book->parametres->seoDescription ? $this->book->parametres->seoDescription : $this->book->parametres->seoDescription; - $socialImage = 'https://workshop.fluidbook.com/services/facebook_thumbnail?id=' . $this->book_id . '&j=' . time(); + $socialImage = 'https://workshop.fluidbook.com/services/facebook_thumbnail?id=' . $this->book_id . '&j=' . TIME; $dim = CubeIT_Image::getimagesize($socialImage); $socialImageWidth = $dim[0]; $socialImageHeight = $dim[1]; -- 2.39.5