]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6726 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Feb 2024 10:33:23 +0000 (11:33 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Feb 2024 10:33:23 +0000 (11:33 +0100)
app/Fluidbook/Compiler/Compiler.php
app/Models/Traits/ToolboxSettings.php

index cd12ffbbaa4de4415fd1cf39742e84c5f4fa7f46..84334f2841a772ac4a13b224a32c2f0ec3b2f4b4 100644 (file)
@@ -301,7 +301,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         $this->phonegapVersion = self::getPhonegapVersion($phonegapVersion);
         $this->appcache = $appcache;
         $this->multiApp = $this->home = $home;
-        $this->devversion = $this->getFluidbook()->mobileLVersion;
+        $this->devversion = $this->getFluidbook()->version < 3 ? "dev" : $this->getFluidbook()->mobileLVersion;
         $this->scormVariant = $scormVariant;
 
         $this->hybrid = $hybrid;
@@ -499,6 +499,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         }
 
         $this->config = new Data(array_merge($this->fluidbookSettings->getRawData()['settings'], $this->themeSettings->getRawData()));
+
         $this->config->pages = count($this->getFluidbook()->composition);
         $this->config->bookmarkDisablePages = ArrayUtil::parseRange($this->config->bookmarkDisablePages);
         $this->config->rasterizePages = ArrayUtil::parseRange($this->config->rasterizePages);
index 4cca4ce1fea6466a8046a9f948d4062b186fe449..d1fcc806ef0b91e034464accf32d787f23b4d268 100644 (file)
@@ -22,6 +22,18 @@ trait ToolboxSettings
     {
         if (null === $this->_settingsData) {
             $this->_settingsData = $this->getPageData();
+
+            $this->_settingsData->setOffsetPrefix('settings.');
+            foreach ($this->getFields() as $field) {
+                if (!$field->getAttribute('fake') || $field->getAttribute('store_in') !== 'settings') {
+                    continue;
+                }
+                if ($this->_settingsData->has($field->getName())) {
+                    continue;
+                }
+                $this->_settingsData->set($field->getName(), $field->getAttribute('default'));
+            }
+
         }
         return $this->_settingsData;
     }