From d87856e96fd75e18201942187e3e8b1158694319 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 7 Nov 2022 15:15:18 +0000 Subject: [PATCH] wait #5567 @1.25 --- inc/ws/Controlleur/class.ws.url.php | 4 +- inc/ws/Metier/class.ws.book.parametres.php | 38 +++++++++++++------ .../html5/master/class.ws.html5.compiler.php | 22 +++++++++-- .../html5/master/class.ws.html5.links.php | 17 +++++---- 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 758233219..69f820e3e 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -27,8 +27,8 @@ class wsUrl $filtres[] = new commonFiltre(__('Administrateur'), 'admin_book', $settings['filtres']); $filtres[] = new commonFiltre(__('Revendeur'), 'revendeur_book', $settings['filtres']); } - $res = ' -'; + $res = ' +'; $res .= commonPage::barre($filtres, 'filtreBooks', 'books', $shortcuts, wsDroits::creation()); $res .= commonPage::tMain(null, wsDroits::creation()); $res .= commonPage::bh(); diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 811799f8a..e4718a8b1 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -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' => [ diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 2e527df9c..b358c596a 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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': diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 3dbbe8d7f..cbe982e4f 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -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']; -- 2.39.5