]> _ Git - cubeextranet.git/commitdiff
wip #4008 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 30 Oct 2020 13:38:48 +0000 (13:38 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 30 Oct 2020 13:38:48 +0000 (13:38 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 39cd801697687e41cecc569e3256e171ec5ab724..f4800b52da4b96efd682f5dc771401f293a61d69 100644 (file)
@@ -1440,6 +1440,11 @@ class wsHTML5Compiler
                     $init['animation'] = 'reflet-anim.html';
                     $links[$k] = $init;
                 }
+                if ($init['type'] == 7) {
+                    $init['image'] = '';
+                    $init['display_area'] = false;
+                    $links[$k] = $init;
+                }
             }
 
         }
index 03730256a8fa6f05c21b5479a869abca1a831e2a..c021f0baaab727b798ae64c08446671f7c7f638e 100644 (file)
@@ -81,7 +81,7 @@ class wsHTML5Link
                 return new videoPopupLink($id, $init, $compiler);
             case 7:
                 if ($compiler->book->parametres->basketManager === 'Puma') {
-                    return new cartLink($id, $init, $compiler);
+                    return new pumaCartLink($id, $init, $compiler);
                 }
                 switch ($compiler->book->parametres->customLinkClass) {
                     case 'WescoLink':
@@ -570,6 +570,11 @@ class normalLink extends wsHTML5Link
 {
     protected $role = 'link';
 
+    public function getInnerContent()
+    {
+        return '';
+    }
+
     public function getHTMLContent()
     {
         $class = $this->getClasses();
@@ -584,7 +589,7 @@ class normalLink extends wsHTML5Link
         if (isset($this->extra->blinkdelay)) {
             $attrs .= ' data-blinkdelay="' . intval($this->extra->blinkdelay) . '"';
         }
-        return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent() . $this->getTrack() . '></a>';
+        return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent() . $this->getTrack() . '>' . $this->getInnerContent() . '</a>';
     }
 
 
@@ -1282,6 +1287,18 @@ class actionLink extends internalLink
 
 }
 
+class pumaCartLink extends cartLink
+{
+    public function getInnerContent()
+    {
+        return '<svg enable-background="new 0 0 28 28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg"><g class="on">
+<circle cx="14" cy="14" fill="#b09474" r="14"/><path d="m14 21.152c-.188 0-.368-.075-.5-.208l-5.507-5.536c-1.209-1.164-1.51-2.955-.737-4.446.978-1.883 3.357-2.652 5.305-1.714.383.185.729.426 1.03.716l.409.394.41-.395c1.54-1.484 4.047-1.484 5.587 0 .303.292.554.627.747.998.773 1.491.473 3.282-.747 4.457l-5.497 5.526c-.132.133-.312.208-.5.208z" fill="#fff"/>
+</g><g class="off">
+<circle cx="14" cy="14" fill="#b09474" opacity=".5" r="14"/><path d="m14 21.152c-.188 0-.368-.075-.5-.208l-5.507-5.536c-1.209-1.164-1.51-2.955-.737-4.446.978-1.883 3.357-2.652 5.305-1.714.383.185.729.426 1.03.716l.409.394.41-.395c1.54-1.484 4.047-1.484 5.587 0 .303.292.554.627.747.998.773 1.491.473 3.282-.747 4.457l-5.497 5.526c-.132.133-.312.208-.5.208zm-3.202-10.896c-.94 0-1.844.497-2.29 1.355-.483.931-.292 2.053.475 2.792l5.017 5.044 5.007-5.033c.777-.749.968-1.871.485-2.802-.122-.234-.281-.447-.473-.632-1.001-.965-2.629-.965-3.63 0l-.899.866c-.273.263-.705.263-.979 0l-.899-.866c-.193-.187-.416-.341-.663-.46-.371-.18-.764-.264-1.151-.264z" fill="#fff"/>
+</g></svg>';
+    }
+}
+
 class cartLink extends normalLink
 {
 
@@ -1638,7 +1655,7 @@ class htmlMultimediaLink extends wsHTML5Link
     {
         $hash = hash('sha256', $c);
         $start = mb_strpos($c, 'var animationData = {') + 20;
-        $end = mb_strpos($c, '};', $start)+1;
+        $end = mb_strpos($c, '};', $start) + 1;
         $ad = mb_substr($c, $start, $end - $start);
         $animationData = json_decode($ad);
         preg_match('/var params = (\{.*\});/sU', $c, $matches);