]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5041
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jan 2022 20:12:01 +0000 (21:12 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jan 2022 20:12:01 +0000 (21:12 +0100)
.idea/deployment.xml
app/Models/Base/ToolboxModel.php
app/Models/FluidbookTheme.php
composer.lock

index ade4eccbe72d31d73e607b54a076396b0a8aad9f..61209bba4148793763094d6f1014b3d739ad5ce1 100644 (file)
             <mapping deploy="/" local="$PROJECT_DIR$" web="/" />
           </mappings>
           <excludedPaths>
-            <excludedPath local="true" path="$PROJECT_DIR$/.env" />
+            <excludedPath local="true" path="$PROJECT_DIR$/vendor" />
           </excludedPaths>
         </serverdata>
       </paths>
index e4d54c93fe7d68b3be58625bfb35a1eb858cd3c7..0423a49411d88a0b63d308dd69b8184fff4ad2a0 100644 (file)
@@ -12,7 +12,6 @@ class ToolboxModel extends CubistMagicAbstractModel
 {
     protected static $_permissionBase = null;
     protected static $_ownerAttribute = 'owner';
-    protected $_syncDbSchema = false;
 
     public static function addOwnerClause(Builder $builder)
     {
@@ -30,7 +29,8 @@ class ToolboxModel extends CubistMagicAbstractModel
 
     public function addOwnerField($tab = null)
     {
-        $fieldSettings = ['name' => static::$_ownerAttribute,
+        $fieldSettings = [
+            'name' => static::$_ownerAttribute,
             'label' => __('PropriĆ©taire'),
             'type' => User::class,
             'column' => true,
index 1ffa3ad0de299c068b96e628f7d16ac5b9b92093..f44db8912596604191574cbbd7b0b7ed540ed6ef 100644 (file)
@@ -17,6 +17,7 @@ class FluidbookTheme extends ToolboxModel
         'singular' => 'theme',
         'plural' => 'themes'];
 
+    protected static $_permissionBase = 'fluidbook-theme';
 
     protected static $_colorToWS3Cache = [];
 
@@ -26,8 +27,6 @@ class FluidbookTheme extends ToolboxModel
 
     public static $updateWS2ViewOnChange = true;
 
-    protected static $_permissionBase ='fluidbook-theme';
-
     public function setFields()
     {
         parent::setFields();
@@ -768,6 +767,14 @@ class FluidbookTheme extends ToolboxModel
 
     public function getPreviewImage()
     {
-        return '<img src="data:image/jpeg;base64,' . base64_encode(file_get_contents(storage_path('/themes/' . $this->getIdValue() . '.jpg'))) . '" width="200" height="140" alt="" />';
+        $f = storage_path('/themes/' . $this->getIdValue() . '.jpg');
+        if (!file_exists($f)) {
+            $b = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mN89x8AAuEB74Y0o2cAAAAASUVORK5CYII=';
+            $type = 'png';
+        } else {
+            $type = 'jpeg';
+            $b = base64_encode(file_get_contents($f));
+        }
+        return '<img src="data:image/' . $type . ';base64,' . $b . '" width="200" height="140" alt="" />';
     }
 }
index 536ad875c94ea4c17b7af6c05ff1b245e2c2dbd9..0c0ba8320d82064c5821a74e2bce9801c2a34e18 100644 (file)
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_cms-back.git",
-                "reference": "28d4e0e991dca01af6cd3095d85ec67b60448373"
+                "reference": "6c9993581e0abf2f551fa1ce66783571911810fa"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-03ce41.tar",
-                "reference": "28d4e0e991dca01af6cd3095d85ec67b60448373",
-                "shasum": "e768e8c863cb325bb1699ccdda2eb9ab24ec3b2a"
+                "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-926445.tar",
+                "reference": "6c9993581e0abf2f551fa1ce66783571911810fa",
+                "shasum": "77d16e40a8d7c66a1a0ec551b185a5c4b9fad5b3"
             },
             "require": {
                 "backpack/backupmanager": "^3.0",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2022-01-20T15:33:21+00:00"
+            "time": "2022-01-20T17:16:11+00:00"
         },
         {
             "name": "cubist/cms-front",