From: Vincent Vanwaelscappel Date: Fri, 10 Feb 2023 13:07:23 +0000 (+0100) Subject: wip #5721 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9635fa66ba7e1747bddb75807e720c5e09d30b81;p=fluidbook-toolbox.git wip #5721 @0.5 --- diff --git a/app/Jobs/FluidbookCompiler.php b/app/Jobs/FluidbookCompiler.php index 70181d5af..dab83687d 100644 --- a/app/Jobs/FluidbookCompiler.php +++ b/app/Jobs/FluidbookCompiler.php @@ -2113,11 +2113,11 @@ height="0" width="0" style="display:none;visibility:hidden"> $this->vdir->copy($this->wdir . '/' . $this->fluidbookSettings->externalArchives, 'data/images/' . $this->fluidbookSettings->externalArchives); } - if ($this->fluidbookSettings->navExtraImage != '') { + if (stristr($this->fluidbookSettings->navExtraImage, '.')) { $this->vdir->copy($this->wdir . '/' . $this->fluidbookSettings->navExtraImage, 'data/images/' . $this->fluidbookSettings->navExtraImage); } - if ($this->fluidbookSettings->navExtraImageMobile != '') { + if (stristr($this->fluidbookSettings->navExtraImageMobile, '.')) { $this->vdir->copy($this->wdir . '/' . $this->fluidbookSettings->navExtraImageMobile, 'data/images/' . $this->fluidbookSettings->navExtraImageMobile); } @@ -2129,7 +2129,7 @@ height="0" width="0" style="display:none;visibility:hidden"> $sname = 'external-' . $e[0]; $this->addSVGSymbolFromFile($this->wdir . '/' . $ic, $sname); $this->config->{'navExtraIcon' . $i} = $sname; - } else { + } else if (stristr($ic, '.')) { $this->vdir->copy($this->wdir . '/' . $ic, 'data/images/' . $ic); } } diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 072cce4d5..33e31809d 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -448,4 +448,29 @@ class FluidbookPublication extends ToolboxSettingsModel } return true; } + + public function replicate(array $except = null) + { + $new = parent::replicate($except); + if (backpack_user()) { + $new->owner = backpack_user()->id; + } + $new->status = -1; + $new->title = __('Copie de :title', ['title' => $new->title]); + $new->composition = []; + $new->save(); + return $new; + } + + protected function _replicateMedia($newId) + { + $from = protected_path('fluidbookpublication/working/' . $this->id . '/') . '*'; + if (!file_exists($from)) { + return; + } + $to = Files::mkdir(protected_path('fluidbookpublication/working/' . $newId . '/')); + `cp -r $from $to`; + } + + } diff --git a/composer.lock b/composer.lock index 3b3255bd2..6dae228e0 100644 --- a/composer.lock +++ b/composer.lock @@ -1712,13 +1712,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "b19acf0d942a68b260d0f4811e195d9d3769fc96" + "reference": "62d9e898924f03ef4b1efc9aa73e724f643c5b0c" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-99fcd5.tar", - "reference": "b19acf0d942a68b260d0f4811e195d9d3769fc96", - "shasum": "640fdfc450c66dc5893306dd5ceee9034ca81823" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-220aff.tar", + "reference": "62d9e898924f03ef4b1efc9aa73e724f643c5b0c", + "shasum": "7e0aad43509d925b677b21da71194b5702411c7d" }, "require": { "backpack/backupmanager": "^3.0", @@ -1800,7 +1800,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2023-02-09T15:22:42+00:00" + "time": "2023-02-10T11:35:31+00:00" }, { "name": "cubist/cms-front", @@ -7038,16 +7038,16 @@ }, { "name": "php-http/discovery", - "version": "1.15.0", + "version": "1.15.1", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "ebf69e00f8c58c47bc1114e38d2cfd40b7fe9b1e" + "reference": "778b59fe5bc9a1df7b77a02306c9ea229ce32bbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/ebf69e00f8c58c47bc1114e38d2cfd40b7fe9b1e", - "reference": "ebf69e00f8c58c47bc1114e38d2cfd40b7fe9b1e", + "url": "https://api.github.com/repos/php-http/discovery/zipball/778b59fe5bc9a1df7b77a02306c9ea229ce32bbc", + "reference": "778b59fe5bc9a1df7b77a02306c9ea229ce32bbc", "shasum": "" }, "require": { @@ -7074,7 +7074,8 @@ }, "type": "composer-plugin", "extra": { - "class": "Http\\Discovery\\Composer\\Plugin" + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true }, "autoload": { "psr-4": { @@ -7105,9 +7106,9 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.15.0" + "source": "https://github.com/php-http/discovery/tree/1.15.1" }, - "time": "2023-02-09T12:05:45+00:00" + "time": "2023-02-10T10:24:17+00:00" }, { "name": "php-http/httplug",