]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7256 @2.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jan 2025 10:48:16 +0000 (11:48 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jan 2025 10:48:16 +0000 (11:48 +0100)
app/Fluidbook/Compiler/Links.php
app/Fluidbook/Packager/Packager.php
app/Models/Traits/PublicationSettings.php

index f95b5a77508e83d18560cfd9438c3e894d9761ad..2e76c3e6ce5b77881d51f2d8c3f0db53b2b16254 100644 (file)
@@ -5,7 +5,6 @@ namespace App\Fluidbook\Compiler;
 use App\Fluidbook\Link\Link;
 use App\Fluidbook\Link\LinksData;
 use App\SubForms\Link\Base;
-use Cubist\Util\Files\Files;
 use Cubist\Util\Text;
 use Fluidbook\Tools\Links\AnchorLink;
 use Fluidbook\Tools\Links\ContentLink;
index c6b2a6fcc82c691e6f2f2dbefb01c360068a1d1c..d83961ac1a553bf8cf73db3fcd37cce2551e9155 100644 (file)
@@ -44,7 +44,7 @@ class Packager extends \App\Jobs\Base
 
     public $type = "unset";
 
-    /** @var Lock  */
+    /** @var Lock */
     protected $lock;
 
     /**
@@ -332,14 +332,16 @@ class Packager extends \App\Jobs\Base
         $htmlFiles = array('index');
         $filesToDelete = [];
 
+        $htmlPrepend = $book->getSettings()->get('htmlPrepend');
         foreach ($htmlFiles as $name) {
-            $html = $book->getSettings()->get('htmlPrepend') . file_get_contents($dest . $name . '.html');
+            $html = $htmlPrepend . file_get_contents($dest . $name . '.html');
             file_put_contents($dest . '/' . $name . '.' . $this->_ext, $html);
             if ($this->_ext != 'html') {
                 $filesToDelete[] = $name . '.html';
             }
         }
 
+
         $rm = new CommandLine('rm');
         foreach ($filesToDelete as $f) {
             $rm->setArg(null, $dest . '/' . $f);
@@ -348,8 +350,11 @@ class Packager extends \App\Jobs\Base
 
         if ($this->_ext !== 'html') {
             $e = $this->_ext;
+            $cmd = "find $dest -type f -name \"*.html\" -exec sed -i \"s/index_player\.html/index_player\.$e/g\" '{}' +";
+            `$cmd`;
             $cmd = "find $dest -type f -name \"*.html\" -exec rename 's/\.html$/.$e/' '{}' \;";
             `$cmd`;
+
         }
         return $compiler;
     }
index 80362fd257ec8506602568a81fd5cc2f7e485b7e..33536a9d03c024473efc25b92d29f57de9abc7e8 100644 (file)
@@ -1648,7 +1648,7 @@ trait PublicationSettings
             'default' => 'html',
         ]);
         $this->addSettingField('actualHtmlExtension', LongText::class, $this->__('Extension des fichiers html réellement appliquée au fluidbook'), [
-            'hint' => $this->__('Ex : php, htm, html, phtml, asp'),
+            'hint' => $this->__('Ex : php, htm, html, phtml, asp, aspx'),
             'default' => 'html',
         ]);
         $this->addSettingField('htmlPrepend', Textarea::class, $this->__('Code à insérer en tête des fichiers'));