case 4:
if ($init['inline']) {
return new videoLink($id, $init, $compiler);
- } else {
- return new videoPopupLink($id, $init, $compiler);
}
+ return new videoPopupLink($id, $init, $compiler);
case 7:
switch ($compiler->book->parametres->customLinkClass) {
case 'WescoLink':
default :
return customLink::getCustomInstance($id, $init, $compiler);
}
- break;
case 8:
case 9:
return null;
case 10:
if ($init['inline']) {
return new webVideoLink($id, $init, $compiler);
- } else {
- return new webVideoPopupLink($id, $init, $compiler);
}
+ return new webVideoPopupLink($id, $init, $compiler);
case 11:
return new actionLink($id, $init, $compiler);
case 12:
case 14:
return new colorLink($id, $init, $compiler);
case 15:
-
if (stristr($init['to'], '.zip')) {
return new inlineSlideshowLink($id, $init, $compiler);
- } else {
- return new imageLink($id, $init, $compiler);
}
+ return new imageLink($id, $init, $compiler);
case 16:
return new fileLink($id, $init, $compiler);
case 17:
if ($init['inline']) {
return new audioLink($id, $init, $compiler);
- } else {
- return new audioPopupLink($id, $init, $compiler);
}
+ return new audioPopupLink($id, $init, $compiler);
case 18:
if ($init['inline']) {
return new tooltipLink($id, $init, $compiler);
- } else {
- return new textPopupLink($id, $init, $compiler);
}
+ return new textPopupLink($id, $init, $compiler);
case 19:
break;
case 20:
break;
case 27:
return new eventOverlayLink($id, $init, $compiler);
- break;
+
case 29:
return new facebookLikeLink($id, $init, $compiler);
- break;
case 30:
return new slideshowLink($id, $init, $compiler);
- break;
case 31:
if ($init['inline']) {
return new iframeLink($id, $init, $compiler);
- } else {
- return new iframePopupLink($id, $init, $compiler);
}
+ return new iframePopupLink($id, $init, $compiler);
case 32:
return new showLinkLink($id, $init, $compiler);
case 33:
break;
case 35:
return new textLink($id, $init, $compiler);
- break;
case 36:
return new articleLink($id, $init, $compiler);
- break;
case 37:
return new downloadPortionLink($id, $init, $compiler);
case 38:
break;
case 39:
return new layerLink($id, $init, $compiler);
+ case 40:
+ return new anchorLink($id, $init, $compiler);
default:
return null;
}
}
+class anchorLink extends wsHTML5Link
+{
+ protected $role = '';
+
+ public function getHTMLContainer()
+ {
+ 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>';
+ }
+
+ public function getHTMLContent()
+ {
+ return '';
+ }
+}
+
class showLinkLink extends normalLink
{
public function getURL()
public function getPage()
{
- if ($this->numerotation == 'physical') {
- return $this->to;
+ $e = explode('#', $this->to, 2);
+
+ $p = $e[0];
+ $anchor = false;
+ if (count($e) > 1) {
+ $anchor = trim($e[1], '# ');
+ }
+
+ if ($this->numerotation === 'physical') {
+ $res = $p;
} else {
- return $this->compiler->virtualToPhysical($this->to);
+ $res = $this->compiler->virtualToPhysical($p);
}
+ if ($anchor) {
+ $res .= '/' . $anchor;
+ }
+
+ return $res;
}
public function getAdditionnalContent()