From f5e2eab0b6714860690c1f6d621e8223de1d4458 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 20 Nov 2019 17:31:11 +0000 Subject: [PATCH] wait #3202 @0.5 --- inc/ws/Metier/class.ws.book.parametres.php | 3 +- .../html5/master/class.ws.html5.compiler.php | 53 +++++++++++++------ 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 0fa7e6204..0f6ec1aca 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -395,8 +395,9 @@ class wsBookParametres extends wsParametres ] ]; $this->fields['tabsMargin'] = ['type' => 'float', 'label' => __('Marge des onglets'), 'editable' => true, 'default' => '-10', 'grade' => 5, 'hint' => __('Une marge négative = les onglets passent sous la publication')]; + $this->fields['tabsLinkWidth'] = ['type' => 'float', 'label' => __('Largeur des onglets'), 'editable' => true, 'default' => '100', 'grade' => 5]; $this->forms['tabs'] = ['label' => __('Onglets'), - 'fieldsnames' => ['tabsHTML5', 'tabsPages', 'tabsSections', 'tabsPagesNumbers', '|', 'tabsSide', 'tabsMargin', 'tabsHideOnCover', 'tabsHideOnLastPage', 'tabsHideEdges', '|', 'tabsPriority', 'tabsHideWhenOverlapingArrows', 'tabsHideOnPortrait', 'tabsHideOnZoom']]; + 'fieldsnames' => ['tabsHTML5', 'tabsPages', 'tabsSections', 'tabsPagesNumbers', '|', 'tabsSide', 'tabsMargin', 'tabsLinkWidth', '|', 'tabsHideOnCover', 'tabsHideOnLastPage', 'tabsHideEdges', '|', 'tabsPriority', 'tabsHideWhenOverlapingArrows', 'tabsHideOnPortrait', 'tabsHideOnZoom']]; $this->fields['customLinkClass'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Classe pour les liens personnalisés'), 'grade' => 5); $this->fields['permanentLinks'] = array('type' => 'boolean', 'default' => false, 'editable' => true, 'label' => __('Liens visibles en permanence'), 'grade' => 3); diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index bc2b6292d..73faaf710 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -91,6 +91,7 @@ class wsHTML5Compiler 'js/libs/fluidbook/fluidbook.slideshow.js', 'js/libs/fluidbook/fluidbook.print.js', 'js/libs/fluidbook/fluidbook.secure.js', + 'js/libs/fluidbook/fluidbook.tabs.js', 'js/libs/fluidbook/fluidbook.js', 'js/main.js'], 'mobilefirst' => [ @@ -1217,21 +1218,43 @@ class wsHTML5Compiler } if ($this->book->parametres->tabsHTML5 != '' && file_exists($this->wdir . '/' . $this->book->parametres->tabsHTML5)) { - $links[] = [ - 'page' => 'background', - 'top' => 0, - 'left' => 0, - 'width' => 100, - 'height' => 100, - 'type' => 6, - 'to' => $this->book->parametres->tabsHTML5, - 'alternative' => $this->book->parametres->tabsHTML5, - 'image' => '', - 'inline' => 1, - 'interactive' => 1, - 'class' => 'tabslink', - 'uid' => 'tabs', - ]; + $ext = CubeIT_Files::getExtension($this->book->parametres->tabsHTML5); + if ($ext === 'zip') { + $links[] = [ + 'page' => 'background', + 'top' => 0, + 'left' => 0, + 'width' => 100, + 'height' => 100, + 'type' => 6, + 'to' => $this->book->parametres->tabsHTML5, + 'alternative' => $this->book->parametres->tabsHTML5, + 'image' => '', + 'inline' => 1, + 'interactive' => 1, + 'class' => 'tabslink', + 'uid' => 'tabs', + ]; + } else if ($ext === 'svg') { + $this->vdir->copy($this->wdir . '/' . $this->book->parametres->tabsHTML5, 'data/tabs.svg'); + $this->config->svgTabs = true; + $pagesLists = ['tabsPages', 'tabsSections']; + foreach ($pagesLists as $pagesList) { + $e = explode(',', $this->book->parametres->$pagesList); + $list = []; + foreach ($e as $k => $v) { + $v = trim($v); + if ($v === '') { + continue; + } + if ($this->book->parametres->tabsPagesNumbers === 'virtual') { + $v = $this->virtualToPhysical($v); + } + $list[] = $v; + } + $this->config->$pagesList = $list; + } + } } $pagesOfCustomLinks = []; -- 2.39.5