}
-
return $theme;
}
foreach ($data['parametres'] as $k => $v) {
$field = $theme->getField($k);
if ($field instanceof Files) {
+ if (!$v) {
+ continue;
+ }
$path = $oldRoot . $v;
+ if (!file_exists($path)) {
+ $opath = str_replace('.svg', '.o.svg', $path);
+ if (file_exists($opath)) {
+ copy($opath, $path);
+ } else {
+ continue;
+ }
+ }
$media = $theme->getMediaInField($k);
$upload = false;
/** @var Media $m */
$m = $media->get(0);
- if ($media->getAttribute('file_name') !== $k) {
+ if ($m->getAttribute('file_name') !== $k) {
$upload = true;
} else {
$mpath = $m->getPath();
if (!$upload) {
continue;
}
- $theme->addMediaToField($k, $path);
+ $s = storage_path('themes/' . $theme->getAttribute('id'));
+ if (!file_exists($s)) {
+ mkdir($s);
+ }
+ $f = $s . '/' . $v;
+ copy($path, $f);
+ $theme->addMediaToField($k, $f);
}
}
}
protected static $_colorAlphaToWS2Cache = [];
protected $_oldRoot = '/home/extranet/www/fluidbook/';
+ public static $updateWS2ViewOnChange = true;
+
public function setFields()
{
parent::setFields();
public function updateWS2Table()
{
- return;
$fileFields = [];
$colorFields = [];
$colorAlphaFields = [];
continue;
}
$v = $theme->$k;
- if (null === $v) {
- continue;
- }
+
if (in_array($k, $colorAlphaFields)) {
$v = self::_colorAlphaToWS2($v);
} else if (in_array($k, $colorFields)) {
$v = self::_colorToWS2($v);
} else if (in_array($k, $fileFields)) {
- /** @var Media $media */
- $media = $theme->getMedia($v)->get(0);
- if (null !== $media) {
- $v = $media->getAttribute('file_name');
+ if (null === $v) {
+ $v = '';
+ } else {
+ /** @var Media $media */
+ $media = $theme->getMedia($v)->get(0);
+ if (null !== $media) {
+ $v = $media->getAttribute('file_name');
+ }
}
}
if (null === $v) {
public function postSave()
{
parent::postSave();
- $this->updateWS2Table();
+ if (self::$updateWS2ViewOnChange) {
+ $this->updateWS2Table();
+ }
}
public function postDelete()
{
parent::postDelete();
- $this->updateWS2Table();
+ if (self::$updateWS2ViewOnChange) {
+ $this->updateWS2Table();
+ }
}
public function fromWS2($data)
"source": {
"type": "git",
"url": "https://github.com/EnhydraV/lucy.git",
- "reference": "ca0a21bfa43e92d41b11b897f641043c6540b676"
+ "reference": "551d90e6ee4eedd380d494aebfc8c5ee424fd785"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/EnhydraV/lucy/zipball/ca0a21bfa43e92d41b11b897f641043c6540b676",
- "reference": "ca0a21bfa43e92d41b11b897f641043c6540b676",
+ "url": "https://api.github.com/repos/EnhydraV/lucy/zipball/551d90e6ee4eedd380d494aebfc8c5ee424fd785",
+ "reference": "551d90e6ee4eedd380d494aebfc8c5ee424fd785",
"shasum": ""
},
"require": {
"geoip2/geoip2": "^2.0",
"jenssegers/agent": "^v2.6",
- "nesbot/carbon": "^2.0"
+ "nesbot/carbon": "^2.0",
+ "php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
"support": {
"source": "https://github.com/EnhydraV/lucy/tree/master"
},
- "time": "2021-06-09T16:39:23+00:00"
+ "time": "2021-06-09T19:11:40+00:00"
},
{
"name": "alchemy/binary-driver",
},
{
"name": "backpack/crud",
- "version": "4.1.46",
+ "version": "4.1.47",
"source": {
"type": "git",
"url": "https://github.com/Laravel-Backpack/CRUD.git",
- "reference": "4bb96f8e34289b858e482ad9c9bf3ea51cb8b7c0"
+ "reference": "b2325eedd661adb75c23683aa6ee1d291b3578e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Laravel-Backpack/CRUD/zipball/4bb96f8e34289b858e482ad9c9bf3ea51cb8b7c0",
- "reference": "4bb96f8e34289b858e482ad9c9bf3ea51cb8b7c0",
+ "url": "https://api.github.com/repos/Laravel-Backpack/CRUD/zipball/b2325eedd661adb75c23683aa6ee1d291b3578e7",
+ "reference": "b2325eedd661adb75c23683aa6ee1d291b3578e7",
"shasum": ""
},
"require": {
"role": "Creator & Maintainer"
}
],
- "description": "Quickly build an admin interfaces using Laravel 7, CoreUI, Boostrap 4 and jQuery.",
+ "description": "Quickly build an admin interfaces using Laravel, CoreUI, Bootstrap and jQuery.",
"homepage": "https://github.com/laravel-backpack/CRUD",
"keywords": [
"Admin Interface",
],
"support": {
"issues": "https://github.com/Laravel-Backpack/CRUD/issues",
- "source": "https://github.com/Laravel-Backpack/CRUD/tree/4.1.46"
+ "source": "https://github.com/Laravel-Backpack/CRUD/tree/4.1.47"
},
- "time": "2021-05-27T09:23:32+00:00"
+ "time": "2021-06-14T08:42:33+00:00"
},
{
"name": "backpack/logmanager",
},
{
"name": "facade/ignition",
- "version": "2.10.1",
+ "version": "2.10.2",
"source": {
"type": "git",
"url": "https://github.com/facade/ignition.git",
- "reference": "508d80f91de953617977e5666f8953669b6e81f2"
+ "reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/facade/ignition/zipball/508d80f91de953617977e5666f8953669b6e81f2",
- "reference": "508d80f91de953617977e5666f8953669b6e81f2",
+ "url": "https://api.github.com/repos/facade/ignition/zipball/43688227bbf27c43bc1ad83af224f135b6ef0ff4",
+ "reference": "43688227bbf27c43bc1ad83af224f135b6ef0ff4",
"shasum": ""
},
"require": {
"issues": "https://github.com/facade/ignition/issues",
"source": "https://github.com/facade/ignition"
},
- "time": "2021-06-03T21:41:42+00:00"
+ "time": "2021-06-11T06:57:25+00:00"
},
{
"name": "facade/ignition-contracts",