]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5721 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Feb 2023 13:07:23 +0000 (14:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Feb 2023 13:07:23 +0000 (14:07 +0100)
app/Jobs/FluidbookCompiler.php
app/Models/FluidbookPublication.php
composer.lock

index 70181d5afe66edc115070da9e7753679664665a2..dab83687dd77aad547cf68906921692c1397c4c5 100644 (file)
@@ -2113,11 +2113,11 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $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"></iframe></noscript>
                     $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);
                 }
             }
index 072cce4d5d1c12770fd8f5a363a422bbdd907008..33e31809d65d1a506b3d866413a69fd7dccbb815 100644 (file)
@@ -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`;
+    }
+
+
 }
index 3b3255bd20943a0bbd8a78bbecb1847718892e58..6dae228e0ad27884b5d2d82e819e53105f4844fd 100644 (file)
             "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",
                 }
             ],
             "description": "Cubist Backpack extension",
-            "time": "2023-02-09T15:22:42+00:00"
+            "time": "2023-02-10T11:35:31+00:00"
         },
         {
             "name": "cubist/cms-front",
         },
         {
             "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": {
             },
             "type": "composer-plugin",
             "extra": {
-                "class": "Http\\Discovery\\Composer\\Plugin"
+                "class": "Http\\Discovery\\Composer\\Plugin",
+                "plugin-optional": true
             },
             "autoload": {
                 "psr-4": {
             ],
             "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",