]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7212 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Nov 2024 16:53:13 +0000 (17:53 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Nov 2024 16:53:13 +0000 (17:53 +0100)
app/Fluidbook/Compiler/Compiler.php
app/Models/Traits/PublicationSettings.php

index 76fadad8ee84389ad70bbc951d205c09faa5bfb2..aa981954b9c794d7ec790c46086a58720f0249ab 100644 (file)
@@ -517,7 +517,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         $this->config->rasterizePages = ArrayUtil::parseRange($this->config->rasterizePages);
         $this->config->vectorPages = array_diff(ArrayUtil::parseRange($this->config->vectorPages), $this->config->rasterizePages);
         $this->numerotation = $this->config->numerotation = explode(',', $this->getFluidbook()->page_numbers);
-        $this->config->dynamicBackgroundColor=[];
+        $this->config->dynamicBackgroundColor = [];
 
         $this->initTabsConfig();
 
@@ -1487,7 +1487,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
                 $dbc[$page] = $e;
             }
         }
-        if(count($dbc)) {
+        if (count($dbc)) {
             $this->config->dynamicBackgroundColor = $dbc + $this->config->dynamicBackgroundColor;
         }
 
@@ -1513,6 +1513,9 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         foreach ($p as $range => $coins) {
             $pages = ArrayUtil::parseRange($range);
             foreach ($pages as $page) {
+                if ($this->isDoublePage() && $page % 2 === 1 && $page > 1) {
+                    continue;
+                }
                 $this->config->set('gamifyCoins.visit_page_' . $page, $coins);
             }
         }
index cba6137c8fd3d38055c70b9d9b01a4a996a25159..80362fd257ec8506602568a81fd5cc2f7e485b7e 100644 (file)
@@ -1702,7 +1702,7 @@ trait PublicationSettings
     {
         $this->addSettingField('section_gamify', FormSection::class, $this->__('Gamification'));
         $this->addSettingField('gamify_coins_pages', Textarea::class, $this->__('Attribuer des coins lors de la visite des pages'), [
-            'hint' => __('Format (un par ligne): numéro de page=[variable:]nombre. Par exemple : :example1 ou :example2', ['example1' => '2=5', 'example2' => '5=A:10']),
+            'hint' => __('Format (un par ligne): numéro ou intervale de pages=[variable:]nombre. Par exemple : :example1 ou :example2 ou :example3', ['example1' => '2=5', 'example2' => '5=A:10','example3'=>'5-8;9=1']),
         ]);
     }