From c6be805d4508418ba88eac7198fc6d913abe8a42 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 15 Nov 2019 11:50:52 +0000 Subject: [PATCH] wip #3153 @1 --- inc/ws/Metier/class.ws.book.parametres.php | 4 +-- .../html5/master/class.ws.html5.links.php | 25 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index fb5ecc6d1..8cc4722eb 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -453,8 +453,8 @@ class wsBookParametres extends wsParametres 'Zoom + lien produit' => 'ZoomProductLink', ), 'grade' => 5); - $this->fields['product_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); - $this->fields['product_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"', 'hint' => __('Laisser vide pour utiliser la valeur par défaut')); + $this->fields['product_email_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __("Titre de l'email") . ' "' . __('Envoyer à un ami') . '"'); + $this->fields['product_email_body'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __("Corps de l'email") . ' "' . __('Envoyer à un ami') . '"'); $this->fields['product_tweet'] = array('type' => 'textarea', 'default' => '%short%', 'editable' => true, 'label' => __("Contenu Partage court"), 'hint' => __('Contenu du partagé sur les partages courts')); $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 5a0122973..351d56d19 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1742,6 +1742,19 @@ class customLink extends wescoLink class zoomLink extends normalLink { protected $maxzoom_default = 2; + protected $_groups = null; + + public function getGroups() + { + if (null === $this->_groups) { + $this->_groups = []; + $groups = explode(',', $this->group); + foreach ($groups as $group) { + $this->_groups[] = CubeIT_Text::str2URL(trim($group)); + } + } + return $this->_groups; + } public function init() { @@ -1753,7 +1766,7 @@ class zoomLink extends normalLink { $class = ' zoomarea'; - $groups = explode(',', $this->group); + $groups = $this->getGroups(); // If there's more than one group assigned, this link shouldn't be clickable (disabled via CSS) // This needs to be set here (parent element) instead of on the actual link so we don't end up with a dead zone @@ -1792,8 +1805,8 @@ class zoomLink extends normalLink { return [ 'maxzoom' => empty($this->to) ? $this->maxzoom_default : $this->to, - 'group' => $this->group, - 'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)), + 'group' => implode(',', $this->getGroups()), + 'group-count' => empty($this->group) ? 0 : count($this->getGroups()), 'width' => round($this->width), 'height' => round($this->height), 'x' => round($this->left), @@ -1867,13 +1880,13 @@ class zoomLink extends normalLink public function getClasses() { // Assign CSS classes for all groups so we can match and group them via JS - $groups = explode(',', $this->group); + $groups = $this->getGroups(); $group_classes = []; foreach ($groups as $group) { if (empty($group)) continue; - $group_classes[] = 'zoom-group-' . trim($group); + $group_classes[] = 'zoom-group-' . trim(CubeIT_Text::str2URL($group)); } return array_merge($group_classes, ['zoomPopup'], parent::getClasses()); @@ -1884,8 +1897,6 @@ class zoomProductLink extends zoomLink { public function __construct($id, $init, &$compiler) { - - $init['to'] = trim($init['to']); $init['group'] = $init['to']; parent::__construct($id, $init, $compiler); } -- 2.39.5