From: Vincent Vanwaelscappel Date: Mon, 12 Sep 2022 17:49:00 +0000 (+0200) Subject: wip #5448 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=cd14f373ea54c48020c28a06578e540b25319978;p=fluidbook-toolbox.git wip #5448 @0:20 --- diff --git a/app/Models/ToolSVGSprite.php b/app/Models/ToolSVGSprite.php index db0198c70..c4cdd0166 100644 --- a/app/Models/ToolSVGSprite.php +++ b/app/Models/ToolSVGSprite.php @@ -7,6 +7,7 @@ use App\Models\Base\ToolboxModel; use App\SubForms\ToolSVGSpriteIcon; use Cubist\Backpack\Magic\Fields\BunchOfFieldsMultiple; use Cubist\Backpack\Magic\Fields\Text; +use Fluidbook\Tools\SVG\SVGTools; class ToolSVGSprite extends ToolboxModel { @@ -26,9 +27,21 @@ class ToolSVGSprite extends ToolboxModel $this->addOwnerField(); - $this->addField('name', Text::class, __('Nom'), ['column' => true]); $this->addField('prefix', Text::class, __('Préfixe'), ['column' => true]); - $this->addField('icons', BunchOfFieldsMultiple::class, __('Icônes'), ['bunch' => ToolSVGSpriteIcon::class, 'edit_label' => __('Edit :icon :name', ['name' => '%iconname','icon'=>'
%svgcode
']), 'add_label' => __('Ajouter une icône')]); + $this->addField('icons', BunchOfFieldsMultiple::class, __('Icônes'), ['bunch' => ToolSVGSpriteIcon::class, 'edit_label' => __('Edit :icon :name', ['name' => '%iconname', 'icon' => '
%svgcode
']), 'add_label' => __('Ajouter une icône')]); + } + + public function preSave() + { + parent::preSave(); + $icons = []; + foreach ($this->icons as $k => $icon) { + $icon['svgcode'] = SVGTools::optimizeSVGStr($icon['svgcode']); + $icons[$k] = $icon; + } + $this->icons = $icons; + } + } diff --git a/scripts/update b/scripts/update index 6604470a2..1dfef82ce 100644 --- a/scripts/update +++ b/scripts/update @@ -19,3 +19,5 @@ sudo chown -R 1001:33 /application/storage/framework php artisan optimize:clear php artisan cubist:magic:precache sudo chown -R 1001:33 /application/storage/framework +sudo chown -R 1001:33 /application/vendor +sudo chown -R 0:0 /etc/sudoers.d/toolbox