]> _ Git - cubeextranet.git/commitdiff
wait #4866 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Nov 2021 11:51:30 +0000 (11:51 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 15 Nov 2021 11:51:30 +0000 (11:51 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 0736704fccb373593d8dc8be92679f245f2d1084..63e2b31bfc58cdf281a6cc28ae4c6f3fa801f271 100644 (file)
@@ -704,9 +704,9 @@ class wsHTML5Compiler
 
     public function writeCartConfig()
     {
-       if($this->book->parametres->cartLinkAppearance=='overlay'){
-           $this->svgfiles[]=$this->assets . '/images/symbols/cart-overlay.svg';
-       }
+        if ($this->book->parametres->cartLinkAppearance == 'overlay') {
+            $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg';
+        }
 
         if ($this->config->basket) {
             $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js');
@@ -1843,6 +1843,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
         foreach ($linksCopy as $k => $linkData) {
             if ($linkData['type'] == 26 || $linkData == 40) {
+                $linkData['to']=anchorLink::normalizeAnchor($linkData['to']);
                 $anchorExists[$linkData['to']] = $linkData;
             }
             if ($linkData['type'] == 35 || $linkData['type'] == 15 || $linkData['type'] == 39) {
@@ -1920,32 +1921,34 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         if ($this->book->parametres->anchorsAliases && file_exists($this->book->parametres->anchorsAliases)) {
             $aliases = [];
             $anchors = [];
-            $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents($this->book->parametres->anchorsAliases));
-            foreach ($lines as $line) {
-                $e = explode("\t", $line);
-                $from = trim($e[0]);
-                $to = trim($e[1]);
-                $aliases[$from] = $to;
-                if (is_numeric($to) && !isset($anchorExists[$from])) {
-                    $anchor = [
-                        'page' => $to,
-                        'top' => 0,
-                        'left' => 0,
-                        'width' => 100,
-                        'height' => 100,
-                        'type' => 26,
-                        'to' => $from,
-                        'uid' => wsHTML5Link::generateUID()
-                    ];
-                    $anchorExists[$from] = $anchor;
-                    $links[] = $anchor;
-                } else {
-                    if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) {
-                        $anchor = $anchorExists[$to];
-                        $anchor['to'] = $from;
-                        $anchor['uid'] = wsHTML5Link::generateUID();
+            for ($i = 0; $i <= 2; $i++) {
+                $lines = CubeIT_Util_Text::explodeNewLines(file_get_contents($this->book->parametres->anchorsAliases));
+                foreach ($lines as $line) {
+                    $e = explode("\t", $line);
+                    $from = anchorLink::normalizeAnchor($e[0]);
+                    $to = anchorLink::normalizeAnchor($e[1]);
+                    $aliases[$from] = $to;
+                    if (is_numeric($to) && !isset($anchorExists[$from])) {
+                        $anchor = [
+                            'page' => $to,
+                            'top' => 0,
+                            'left' => 0,
+                            'width' => 100,
+                            'height' => 100,
+                            'type' => 26,
+                            'to' => $from,
+                            'uid' => wsHTML5Link::generateUID()
+                        ];
                         $anchorExists[$from] = $anchor;
                         $links[] = $anchor;
+                    } else {
+                        if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) {
+                            $anchor = $anchorExists[$to];
+                            $anchor['to'] = $from;
+                            $anchor['uid'] = wsHTML5Link::generateUID();
+                            $anchorExists[$from] = $anchor;
+                            $links[] = $anchor;
+                        }
                     }
                 }
             }
index 68dc938f59b559c6bafe1b453ad4e45586d65026..f3c4db9f18456e3f9074cb5b78771effc9a54342 100644 (file)
@@ -799,7 +799,7 @@ class anchorLink extends wsHTML5Link
 
     public static function normalizeAnchor($anchor)
     {
-        return mb_strtolower(CubeIT_Text::str2URL($anchor));
+        return str_replace('-', '', mb_strtolower(CubeIT_Text::str2URL(trim($anchor))));
     }
 }