]> _ Git - cubeextranet.git/commitdiff
#2286
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 10 Oct 2018 18:02:14 +0000 (18:02 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 10 Oct 2018 18:02:14 +0000 (18:02 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 5261e0920fbc1ebb4fb1fd7e82abae43fa347d91..80670630ba996bbfded438f5e8576c8a9ed3bd7d 100644 (file)
@@ -162,6 +162,7 @@ class wsHTML5Compiler
        public $beginBody = array();
        public $seoArticles = [];
        public $securityPolicyWhitelist = ['*.google-analytics.com', '*.youtube.com', '*.ytimg.com'];
+       public $writeLinksData = false;
        protected $_indexVars = null;
 
        public $_signature;
@@ -887,7 +888,7 @@ class wsHTML5Compiler
                $lang = $daoLang->selectById($this->book->lang);
                $langs = $daoLang->selectAll();
 
-               $t=CubeIT_Util_Object::toArray($this->book->traductions);
+               $t = CubeIT_Util_Object::toArray($this->book->traductions);
 
                $traductions = (!is_countable($t) || !count($t)) ? $lang->traductions : $t;
 
@@ -1047,6 +1048,7 @@ class wsHTML5Compiler
                $cpages = array();
                $css = array();
                $linkPages = [];
+               $allLinksData = [];
 
                usort($links, array($this, '_sortLinks'));
 
@@ -1054,6 +1056,8 @@ class wsHTML5Compiler
                        if (in_array($linkData['type'], $ignore)) {
                                continue;
                        }
+
+
                        $linkData['hidden'] = in_array($linkData['uid'], $hiddenLinks);
                        if ($linkData['type'] == 28) {
                                $this->addSEOArticle($linkData['page'], $linkData['to'], $linkData['extra'], $linkData['image']);
@@ -1087,6 +1091,8 @@ class wsHTML5Compiler
                                $pages[$link->page] .= $c;
                        }
 
+                       $allLinksData[$linkData['uid']] = $linkData;
+
                        if ($link->keep()) {
                                $this->hiddenContents[] = $c;
                        }
@@ -1116,6 +1122,11 @@ class wsHTML5Compiler
                        $this->config->links[$i] = $c;
                        $this->config->clinks[$i] = $cc;
                }
+
+               if ($this->writeLinksData) {
+                       $this->config->linksData = $allLinksData;
+               }
+
                return $css;
        }
 
index 53dc96f50a0bb164d4f50760508d7074e32eb7de..8528b96fca942c19b1810e161bb9c0ab459508a9 100644 (file)
@@ -225,14 +225,18 @@ class wsHTML5Link
                if (!$this->video_height) {
                        $this->video_height = $this->height;
                }
-
-
                if ($this->target == '') {
                        $this->target = '_blank';
                }
                $this->wdir = WS_BOOKS . '/working/' . $compiler->book_id . '/';
                $this->id = $id;
                $this->compiler = $compiler;
+               $this->init();
+       }
+
+       public function init()
+       {
+
        }
 
        public function getDefaultTooltip()
@@ -510,10 +514,16 @@ class htmlMultimediaPopupLink extends htmlMultimediaPopupImage
 
 class zoomhdLink extends normalLink
 {
+       public function init()
+       {
+               $this->compiler->addJs('js/libs/fluidbook/links/fluidbook.links.zoomhd.js');
+               $this->compiler->writeLinksData=true;
+       }
+
        public function getURL()
        {
                $this->copyExternalFile($this->to);
-               return '#/zoomhd/' . md5($this->to);
+               return '#/zoomhd/' . $this->uid;
        }
 
        public function getAdditionnalContent()