From 68aa155786942425c1fc0d5ab9d090e3a5116502 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 29 Apr 2021 18:51:56 +0000 Subject: [PATCH] wip #4440 @2 --- inc/ws/Metier/class.ws.book.parametres.php | 3 ++- inc/ws/Util/html5/master/class.ws.html5.links.php | 6 +++--- inc/ws/Util/packager/class.ws.packager.html.php | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index ea207076d..2c52bae67 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -751,11 +751,12 @@ class wsBookParametres extends wsParametres $this->fields['forceCompileOnDownload'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Forcer la compilation lors du téléchargement'), 'grade' => 3); $this->fields['htmlExtension'] = array('type' => 'text', 'default' => 'html', 'editable' => true, 'label' => __('Extension des fichiers html'), 'grade' => 5, 'hint' => __('Ex : php, htm, html, phtml, asp'), 'grade' => 5); + $this->fields['actualHtmlExtension'] = array('type' => 'text', 'default' => 'html', 'editable' => false, 'label' => __('Extension des fichiers html réellement appliquée au fluidbook'), 'grade' => 5, 'hint' => __('Ex : php, htm, html, phtml, asp'), 'grade' => 5); $this->fields['htmlPrepend'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code à insérer en tête des fichiers'), 'grade' => 5); $this->fields['baseUrl'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Base de l\'url'), 'grade' => 5,); $this->forms['package'] = array('label' => __('Option d\'export'), - 'fieldsnames' => array('htmlExtension', 'htmlPrepend', 'baseUrl', 'forceCompileOnDownload')); + 'fieldsnames' => array('htmlExtension', "actualHtmlExtension", 'htmlPrepend', 'baseUrl', 'forceCompileOnDownload')); $this->fields['disableDemo'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Désactiver le lien de démo'), 'grade' => 5); $this->fields['redirectDemo'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Rediriger le lien de démo vers'), 'grade' => 5); diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index c66b2c630..9b5ba33ff 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1730,9 +1730,9 @@ class htmlMultimediaLink extends wsHTML5Link $d = array('fdir' => $fdir, 'dir' => $dir); $file = $this->compiler->wdir . '/' . $this->alternative; $content = file_get_contents($file); - if (false && strpos($content, '
')) { - return $this->getLottieContent($content, $this->width, $this->height); - } +// if (false && strpos($content, '
')) { +// return $this->getLottieContent($content, $this->width, $this->height); +// } $this->compiler->vdir->copy($this->compiler->wdir . '/' . $this->alternative, $d['dir'] . '/' . $this->alternative); $this->_config = $this->getConfigHTML($d['dir'], $this->alternative); $this->copyExternalFile($d['dir'] . '/' . $this->alternative); diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 5786692c0..6a77db49c 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -35,6 +35,7 @@ class wsPackagerHTML extends wsPackager } $this->_ext = $this->book->parametres->htmlExtension; + $this->book->parametres->actualHtmlExtension = $this->_ext; $this->copyFluidbookFiles(); $this->mergeJavascript(); @@ -307,6 +308,12 @@ class wsPackagerHTML extends wsPackager $rm->setArg(null, $dest . '/' . $f); } $rm->execute(); + + if ($this->_ext !== 'html') { + $e = $this->_ext; + `find $dest -type f -name "*.html" -exec rename 's/\.html$/.$e/' '{}' \;`; + + } } public function makePackage($zip) -- 2.39.5