]> _ Git - fluidbook-toolbox.git/commitdiff
wip #4216 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Jul 2021 17:43:14 +0000 (19:43 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 16 Jul 2021 17:43:14 +0000 (19:43 +0200)
app/Models/FluidbookTheme.php

index 692d3fb3f3ba5c63623d317f2c9dc095835c4c1e..6960c3a468b7f5bf54d903f0083c9c713d0c35e1 100644 (file)
@@ -24,6 +24,8 @@ class FluidbookTheme extends CubistMagicAbstractModel
     protected static $_colorAlphaToWS2Cache = [];
     protected $_oldRoot = '/home/extranet/www/fluidbook/';
 
+    protected $_enableTrackNonDefaultValues = true;
+
     public static $updateWS2ViewOnChange = true;
 
     public function setFields()
@@ -127,9 +129,12 @@ class FluidbookTheme extends CubistMagicAbstractModel
         ]);
         $this->addField([
             'name' => 'subSecondaryColor',
-            'type' => 'Text',
-            'label' => __('Couleur secondaire pour la version HTML5 (boutons)'),
+            'type' => 'Color',
+            'label' => __('Couleur des boutons'),
+            'hint' => __('Laisser vide pour utiliser la couleur calculée par défaut'),
             'default' => '',
+            'allows_alpha' => false,
+            'allows_empty' => true,
             'translatable' => false,
         ]);
         $this->addField([
@@ -744,7 +749,7 @@ class FluidbookTheme extends CubistMagicAbstractModel
     public static function _colorToWS2($data)
     {
         if ($data === '') {
-            return null;
+            return '';
         }
         if (!isset(self::$_colorToWS2Cache[$data])) {
             self::$_colorToWS2Cache[$data] = self::__colorToWS2($data, false);
@@ -883,8 +888,8 @@ class FluidbookTheme extends CubistMagicAbstractModel
                 $get = [$k . '=' . urlencode($v)];
             }
             $get = '?' . implode('&', $get);
-        }else{
-            $get='';
+        } else {
+            $get = '';
         }
         return 'https://workshop.fluidbook.com/viewerh/20098-' . $this->getIdValue() . '_f2e0452eed6dba9878016ce5603fdc54_' . time() . '/' . $get . '#/page/' . $page;
     }