From 6bd6b3bae3964ce3abdf43cfbf724253b85c000d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 20 Jan 2022 21:12:01 +0100 Subject: [PATCH] wip #5041 --- .idea/deployment.xml | 2 +- app/Models/Base/ToolboxModel.php | 4 ++-- app/Models/FluidbookTheme.php | 13 ++++++++++--- composer.lock | 10 +++++----- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.idea/deployment.xml b/.idea/deployment.xml index ade4eccbe..61209bba4 100644 --- a/.idea/deployment.xml +++ b/.idea/deployment.xml @@ -190,7 +190,7 @@ - + diff --git a/app/Models/Base/ToolboxModel.php b/app/Models/Base/ToolboxModel.php index e4d54c93f..0423a4941 100644 --- a/app/Models/Base/ToolboxModel.php +++ b/app/Models/Base/ToolboxModel.php @@ -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, diff --git a/app/Models/FluidbookTheme.php b/app/Models/FluidbookTheme.php index 1ffa3ad0d..f44db8912 100644 --- a/app/Models/FluidbookTheme.php +++ b/app/Models/FluidbookTheme.php @@ -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 ''; + $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 ''; } } diff --git a/composer.lock b/composer.lock index 536ad875c..0c0ba8320 100644 --- a/composer.lock +++ b/composer.lock @@ -1482,13 +1482,13 @@ "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", @@ -1568,7 +1568,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2022-01-20T15:33:21+00:00" + "time": "2022-01-20T17:16:11+00:00" }, { "name": "cubist/cms-front", -- 2.39.5