From: vincent@cubedesigners.com Date: Wed, 15 Feb 2017 16:53:30 +0000 (+0000) Subject: wip #1111 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=aec4439dd676bd945c74701a3e4f1d19c41d1ff8;p=cubeextranet.git wip #1111 --- diff --git a/fluidbook/tools/fwstk/.idea/workspace.xml b/fluidbook/tools/fwstk/.idea/workspace.xml index a0e74f38e..66c3b0f19 100644 --- a/fluidbook/tools/fwstk/.idea/workspace.xml +++ b/fluidbook/tools/fwstk/.idea/workspace.xml @@ -7,10 +7,7 @@ - - - @@ -51,8 +48,8 @@ - - + + @@ -1042,12 +1039,20 @@ - + + + 1487172253077 + + - @@ -1071,7 +1076,7 @@ - + @@ -1099,6 +1104,10 @@ + + + @@ -1324,8 +1333,8 @@ - - + + diff --git a/inc/ws/Util/html5/class.ws.html5.compiler.php b/inc/ws/Util/html5/class.ws.html5.compiler.php index eb3d7e139..de3b7af4b 100644 --- a/inc/ws/Util/html5/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/class.ws.html5.compiler.php @@ -159,6 +159,7 @@ class wsHTML5Compiler { protected $home; protected $widget = true; protected $multiApp = false; + protected $pageLabels = array('two' => 2); function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false) { global $core; @@ -244,6 +245,10 @@ class wsHTML5Compiler { $this->config = cubeObject::merge($this->book->parametres->toStandardObject(), $this->theme->parametres->toStandardObject()); } + public function addPageLabel($page, $label) { + $this->pageLabels[$label] = $page; + } + public function getResolutions() { $res = self::$resolutions; if ($this->widget) { @@ -280,6 +285,9 @@ class wsHTML5Compiler { } public function virtualToPhysical($virtual) { + if (isset($this->pageLabels[$virtual])) { + return $virtual; + } if (!in_array($virtual, $this->numerotation)) { return 1; } @@ -741,6 +749,8 @@ class wsHTML5Compiler { $cpages = array(); $css = array(); + usort($links, array($this, '_sortLinks')); + foreach ($links as $linkData) { if (in_array($linkData['type'], $ignore)) { continue; @@ -791,6 +801,14 @@ class wsHTML5Compiler { return $css; } + public function _sortLinks($a, $b) { + $priorities = array(26 => 1); + + $pa = isset($priorities[$a['type']]) ? $priorities[$a['type']] : 0; + $pb = isset($priorities[$b['type']]) ? $priorities[$b['type']] : 0; + return $pb - $pa; + } + public function addBookmarkGroup($link) { if ($link['left'] > $this->book->parametres->width) { //$link['page']++; @@ -912,6 +930,7 @@ class wsHTML5Compiler { $this->config->htmlmultimedia = $this->htmlmultimedia; $this->config->phonegap = $this->phonegap; $this->config->retinaResolution = $this->maxRes; + $this->config->pageLabels = $this->pageLabels; if ($this->home) { $this->config->home = 'http://home'; } diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index 3cb824a0d..952fed1e3 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -121,6 +121,9 @@ class wsHTML5Link { case 25: $compiler->addAudiodescription($init); break; + case 26: + $compiler->addPageLabel($init['page'], $init['to']); + break; default: return null; }