]> _ Git - cubeextranet.git/commitdiff
wip #4424 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Apr 2021 07:46:31 +0000 (07:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 27 Apr 2021 07:46:31 +0000 (07:46 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index e54d0859ebc74aa7ccb4bf88cd1d8ffb5a763b3b..fe98025ea2236eeba9a72f16b545dc34980ddfe2 100644 (file)
@@ -770,7 +770,7 @@ class wsHTML5Compiler
             return $virtual;
         }
         if (!in_array($virtual, $this->numerotation)) {
-            return 1;
+            return $virtual;
         }
         $p = array_search($virtual, $this->numerotation);
         return $p + 1;
index 348f088ac99456e5436d808d7c074b7d1c095452..7637b0964b49599e77ef6f181a758c1145dc23ff 100644 (file)
@@ -188,8 +188,8 @@ class wsHTML5Link
                 $compiler->addAudiodescription($init);
                 break;
             case 26:
-                $compiler->addPageLabel($init['page'], $init['to']);
-                break;
+            case 40:
+                return new anchorLink($id, $init, $compiler);
             case 27:
                 return new eventOverlayLink($id, $init, $compiler);
             case 29:
@@ -224,8 +224,6 @@ class wsHTML5Link
                 break;
             case 39:
                 return new layerLink($id, $init, $compiler);
-            case 40:
-                return new anchorLink($id, $init, $compiler);
             default:
                 return null;
         }
@@ -680,6 +678,7 @@ class anchorLink extends wsHTML5Link
 
     public function getHTMLContainer()
     {
+        $this->compiler->addPageLabel($this->page, $this->to);
         return '<div aria-hidden="false" data-anchor="' . trim($this->to, '# ') . '" class="anchor ' . $this->getHTMLContainerClass() . '" data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
     }
 
@@ -1045,15 +1044,14 @@ class internalLink extends normalLink
         if (count($e) > 1) {
             $anchor = trim($e[1], '# ');
         }
-
-        if ($this->numerotation === 'physical') {
+        if ($anchor) {
+            $res = $anchor;
+        } else if ($this->numerotation === 'physical') {
             $res = $p;
         } else {
             $res = $this->compiler->virtualToPhysical($p);
         }
-        if ($anchor) {
-            $res .= '/' . $anchor;
-        }
+
 
         return $res;
     }