From: vincent@cubedesigners.com Date: Tue, 29 Sep 2020 13:35:37 +0000 (+0000) Subject: wip #3909 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dcf73c2678818d04c6e023ba189d30edb5c9ceb4;p=cubeextranet.git wip #3909 @1 --- diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 4b594a7ab..a0739a372 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -543,6 +543,7 @@ class wsBookParametres extends wsParametres 'Remarkable' => 'Remarkable', 'Mopec' => 'Mopec', 'Zoom + lien produit (déprécié, utiliser la fonctionnalité "Zoom produits")' => 'ZoomProductLink', + 'Wishlist Jouéclub' => 'JoueclubWishlist', ), 'grade' => 5); $this->fields['basketReferences'] = array('type' => 'freefile', 'default' => '', 'editable' => true, 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 80ae0e281..888b92be5 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -116,6 +116,8 @@ class wsHTML5Link return new zoomProductLink($id, $init, $compiler); } switch ($compiler->book->parametres->basketManager) { + case 'JoueclubWishlist': + return new JoueclubWishlistLink($id, $init, $compiler); case 'Remarkable': return new remarkableCartLink($id, $init, $compiler); case 'ZoomProductLink': @@ -1734,6 +1736,26 @@ class audioLink extends wsHTML5Link } +class JoueclubWishlistLink extends normalLink +{ + protected $role = 'link'; + + public function getURL() + { + return 'https://joueclub.dev.amazing.cat/scan?deviceId=$uuid&ean=' . $this->to; + } + + public function getTarget() + { + return '_blank'; + } + + public function getDefaultTooltip() + { + return 'Ajouter à la wishlist'; + } +} + class wescoLink extends normalLink { protected $role = 'link'; @@ -2299,19 +2321,20 @@ class slideshowLink extends normalLink } // Main slider - $res = '
' . $this->_slides($slides) . '
'; + $res = '
' . $this->_slides($slides) . '
'; // Thumbnails slider if ($thumbnails) { $res .= '
' . $this->_slides($slides, false, $this->thumbnail_height) . '
'; } - $res = '
'. $res .'
'; + $res = '
' . $res . '
'; return $res; } - protected function _getSlidesFromDirectory($path) { + protected function _getSlidesFromDirectory($path) + { // Previously this was getting all files recursively but it caused problems // when there was a __MACOSX sub directory inside the zip file containing // resource forks for the JPGs. There's no need to support nested directories @@ -2335,9 +2358,10 @@ class slideshowLink extends normalLink return $slides; } - protected function _slides($slides, $show_captions = true, $max_height = null) { + protected function _slides($slides, $show_captions = true, $max_height = null) + { - $res = '
'; + $res = '
'; $res .= '
    '; foreach ($slides as $slide) { @@ -2350,12 +2374,12 @@ class slideshowLink extends normalLink // We set dimensions here to avoid extra work on the client side if ($max_height && $image_info) { $thumb_width = round($max_height / $image_info[1] * $image_info[0]); // max_height / image_height * image_width - $image_dimensions = 'style="width:'. $thumb_width .'px; height:'. $max_height .'px"'; + $image_dimensions = 'style="width:' . $thumb_width . 'px; height:' . $max_height . 'px"'; } $res .= '
  • '; //$res .= '
    '; - $res .= ''; + $res .= ''; //$res .= '
    '; // .splide__slide__container if ($show_captions && null !== $slide['caption']) {