]> _ Git - cubeextranet.git/commitdiff
wip #3153 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 15 Nov 2019 11:50:52 +0000 (11:50 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 15 Nov 2019 11:50:52 +0000 (11:50 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index fb5ecc6d13c3f67f0cc57330917dc368afb51764..8cc4722eb2ebb4f62de26cdedc5ecbe9a0027379 100644 (file)
@@ -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,
index 5a01229734d752a9cad95e8c9684b030d852a890..351d56d197d24409dd10d9a131d61f2b14f35746 100644 (file)
@@ -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);
     }