]> _ Git - cubeextranet.git/commitdiff
wait #5567 @1.25
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 7 Nov 2022 15:15:18 +0000 (15:15 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 7 Nov 2022 15:15:18 +0000 (15:15 +0000)
inc/ws/Controlleur/class.ws.url.php
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 7582332191a22e835a9e8c82b8c253a8251253fb..69f820e3e21ccfa97caf02ebb427303d9ecc9484 100644 (file)
@@ -27,8 +27,8 @@ class wsUrl
             $filtres[] = new commonFiltre(__('Administrateur'), 'admin_book', $settings['filtres']);
             $filtres[] = new commonFiltre(__('Revendeur'), 'revendeur_book', $settings['filtres']);
         }
-        $res = '<script src="https://unpkg.com/@popperjs/core@2"></script>
-<script src="https://unpkg.com/tippy.js@6"></script>';
+        $res = '<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.6/umd/popper.min.js" integrity="sha512-6UofPqm0QupIL0kzS/UIzekR73/luZdC6i/kXDbWnLOJoqwklBK6519iUnShaYceJ0y4FaiPtX/hRnV/X/xlUQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/tippy.js/6.3.7/tippy-bundle.umd.min.js" integrity="sha512-gbruucq/Opx9jlHfqqZeAg2LNK3Y4BbpXHKDhRC88/tARL/izPOE4Zt2w6X9Sn1UeWaGbL38zW7nkL2jdn5JIw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>';
         $res .= commonPage::barre($filtres, 'filtreBooks', 'books', $shortcuts, wsDroits::creation());
         $res .= commonPage::tMain(null, wsDroits::creation());
         $res .= commonPage::bh();
index 811799f8ab996b51ddf1f4085f65dcc97820119e..e4718a8b1d5e0682c235c81e380512f02004ed94 100644 (file)
@@ -15,6 +15,13 @@ class wsBookParametres extends wsParametres
         parent::initFields();
 
         $this->fields=[
+    'title' => [
+        'type' => 'text',
+        'default' => '',
+        'editable' => true,
+        'label' => __('Titre de la publication'),
+        'embed' => false,
+    ],
     'mobileLVersion' => [
         'type' => 'combo',
         'default' => 'stable',
@@ -35,19 +42,11 @@ class wsBookParametres extends wsParametres
         'label' => __('Version mobile'),
         'grade' => 3,
         'datas' => [
-            __('Rediriger vers le PDF') => 'pdf',
             __('Version HTML5 recommandée (vecteurs sur desktop)') => 'html5-desktop',
             __('Version HTML5 vecteurs') => 'html5',
             __('Version HTML5 en images') => 'html5-images',
         ],
     ],
-    'title' => [
-        'type' => 'text',
-        'default' => '',
-        'editable' => true,
-        'label' => __('Titre de la publication'),
-        'embed' => false,
-    ],
     'url_link' => [
         'type' => 'text',
         'default' => 'http://',
@@ -412,7 +411,7 @@ class wsBookParametres extends wsParametres
         'type' => 'integer',
         'default' => 0,
         'editable' => true,
-        'label' => __('Marge supplémentaire horizontale'),
+        'label' => __('Marge supplémentaire horizontale (Mobile)'),
         'grade' => 3,
     ],
     'extraYSpace' => [
@@ -1242,6 +1241,18 @@ class wsBookParametres extends wsParametres
         'editable' => true,
         'label' => __('Cacher le menu lors du zoom'),
     ],
+    'zoomAreaDefaultZoomLevel' => [
+        'type' => 'float',
+        'default' => 2,
+        'editable' => true,
+        'label' => 'Niveau de zoom des zones de zoom',
+    ],
+    'zoomAreaShowTexts' => [
+        'type' => 'boolean',
+        'default' => true,
+        'editable' => true,
+        'label' => 'Inclure la couche de texte dans les zones de zoom',
+    ],
     'sliderImage' => [
         'type' => 'freefile',
         'default' => '',
@@ -2302,6 +2313,7 @@ class wsBookParametres extends wsParametres
             'Remarkable' => 'Remarkable',
             'Mopec' => 'Mopec',
             'Puma' => 'Puma',
+            'Puma South Europe' => 'Puma-SE',
             'MIF' => 'MIF',
             'Flexipan' => 'Flexipan',
             'Zoom + lien produit (déprécié, utiliser la fonctionnalité "Zoom produits")' => 'ZoomProductLink',
@@ -2878,9 +2890,9 @@ L,index',
     'important' => [
         'label' => __('Description de la publication'),
         'fieldsnames' => [
-            0 => 'mobileLVersion',
-            1 => 'mobileVersion',
-            2 => 'title',
+            0 => 'title',
+            1 => 'mobileLVersion',
+            2 => 'mobileVersion',
             3 => 'url_link',
             4 => 'signature',
         ],
@@ -3129,6 +3141,8 @@ L,index',
             3 => 'zoomw',
             4 => 'zoomMouseMoveMode',
             5 => 'hideHeaderOnZoom',
+            6 => 'zoomAreaDefaultZoomLevel',
+            7 => 'zoomAreaShowTexts',
         ],
     ],
     'slider' => [
index 2e527df9c3da0f5705bc9c65a5deb4b40ec2ded6..b358c596afa2937324e5b5d7f19276f0934fb720 100644 (file)
@@ -698,14 +698,18 @@ class wsHTML5Compiler
         wsLinks::getLinksAndRulersFromFile($this->book_id, $links, $rulers);
     }
 
-
-    public function writePumaCart()
+    public function writePumaSECart()
     {
-        $this->lessVariables['import-cart-styles'] = 'puma';
+        $this->lessVariables['import-cart-styles'] = 'puma-se';
+        $this->addJsLib('puma-se', 'js/libs/fluidbook/cart/fluidbook.cart.puma-se.js');
 
+        $this->_commonPuma();
+    }
+
+    protected function _commonPuma(){
         $this->addJsLib('parsley', 'js/libs/parsley.min.js');
         $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js');
-        $this->addJsLib('puma', 'js/libs/fluidbook/cart/fluidbook.cart.puma.js');
+
         $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js');
         $this->addJsLib('exceljs', 'js/libs/exceljs.min.js');
         $this->addVideoJs();
@@ -750,6 +754,14 @@ class wsHTML5Compiler
         }
     }
 
+    public function writePumaCart()
+    {
+        $this->lessVariables['import-cart-styles'] = 'puma';
+        $this->addJsLib('puma', 'js/libs/fluidbook/cart/fluidbook.cart.puma.js');
+
+        $this->_commonPuma();
+    }
+
 
     public function writeThirietCart()
     {
@@ -916,6 +928,8 @@ class wsHTML5Compiler
                     return $this->writeFlexipanCart();
                 case 'Puma':
                     return $this->writePumaCart();
+                case 'Puma-SE':
+                    return $this->writePumaSECart();
                 case 'MIF':
                     return $this->writeMIFCart();
                 case 'GrandVision':
index 3dbbe8d7f31bcb1df5859c4a22adc9a735ed5062..cbe982e4f7e444b252052530555d1133274f4386 100644 (file)
@@ -138,7 +138,7 @@ class wsHTML5Link
                 }
 
             case 7:
-                if ($compiler->book->parametres->basketManager === 'Puma') {
+                if ($compiler->book->parametres->basketManager === 'Puma' || $compiler->book->parametres->basketManager === 'Puma-SE') {
                     return new pumaCartLink($id, $init, $compiler);
                 }
                 if ($compiler->book->parametres->basketManager === 'MIF') {
@@ -199,6 +199,7 @@ class wsHTML5Link
                     case 'ZoomProductLink':
                     case 'Flexipan':
                     case 'Puma':
+                    case 'Puma-SE':
                     case 'MIF':
                         return new zoomProductLink($id, $init, $compiler);
                     default :
@@ -283,8 +284,8 @@ class wsHTML5Link
                     case 'page':
                     default:
                         $extras = self::parseExtras($init['extra']);
-                        $delay=$extras['delay']??0;
-                        $compiler->addTriggersLink($init['page'], $init['to'],$delay);
+                        $delay = $extras['delay'] ?? 0;
+                        $compiler->addTriggersLink($init['page'], $init['to'], $delay);
                         break;
                 }
                 break;
@@ -1828,6 +1829,7 @@ class layerLink extends imageLink
             'height' => round($this->height),
             'x' => round($this->left),
             'y' => round($this->top),
+            'texts' => $this->compiler->config->zoomAreaShowTexts,
         ];
     }
 }
@@ -2812,6 +2814,7 @@ class zoomLink extends normalLink
     public function init()
     {
         $this->compiler->addJsLib('fluidbook-zoom', 'js/libs/fluidbook/links/fluidbook.links.zoom.js');
+        $this->maxzoom_default = $this->compiler->config->zoomAreaDefaultZoomLevel ?: 2;
         parent::init();
     }
 
@@ -2870,6 +2873,7 @@ class zoomLink extends normalLink
             'y' => round($this->top),
             'border' => $this->border,
             'borderColor' => $this->borderColor,
+            'texts' => $this->compiler->config->zoomAreaShowTexts,
         ];
     }
 
@@ -2877,7 +2881,7 @@ class zoomLink extends normalLink
     {
 
         $maxzoom = $attributes['maxzoom']; // Max zoom level might not always be set in the link editor
-        $maxzoom = max(1, min($maxzoom, 4.166666667));
+        $maxzoom = max(1, min($maxzoom, 20));
         if (!$maxzoom) {
             $maxzoom = 2;
         }
@@ -2888,7 +2892,8 @@ class zoomLink extends normalLink
             // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
             // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
             // factor by setting the resolution to 72 * $maxzoom
-            'resolution' => round(150 * $maxzoom)
+            'resolution' => round(150 * $maxzoom),
+            'texts'=> $attributes['texts'] ?? true
         ];
 
         // Round all link co-ordinates because there seems to be a problem with the the Workshop link editor
@@ -2993,8 +2998,6 @@ class zoomLink extends normalLink
 
 class zoomProductLink extends zoomLink
 {
-    protected $maxzoom_default = 2.5;
-
     public function __construct($id, $init, &$compiler)
     {
         $init['group'] = $init['to'];