From: vincent@cubedesigners.com Date: Fri, 27 Jun 2014 10:32:27 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1624751d553eb193b68acd649e5d4ebf782d54b6;p=cubeextranet.git --- diff --git a/inc/ws/Util/class.ws.exporter.php b/inc/ws/Util/class.ws.exporter.php index 12b61454e..b3a2e2b04 100644 --- a/inc/ws/Util/class.ws.exporter.php +++ b/inc/ws/Util/class.ws.exporter.php @@ -89,7 +89,7 @@ class wsExporter { $allpub = $compiler->books; if (isset($collection->settings['offline']) && $collection->settings['offline']) { - $p = $compiler->getPublishedVersionPath($os); + $p = $compiler->getPublishedVersionPath($os, $collection->settings['version']); $phonegap->addAdditionalSource('publications', $p); diff --git a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php index 5082c6eb9..b2b09aa86 100644 --- a/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php +++ b/inc/ws/Util/html5/app/class.ws.html5.app.compiler.php @@ -243,10 +243,17 @@ class wsHTML5AppCompiler { file_put_contents($this->vdir . '/data/app.css', implode("\n", $c)); } - public function getPublishedVersionPath($os) { + public function getPublishedVersionPath($os, $version) { global $core; - $r = $core->con->select('SELECT compile_date FROM book_collection_compile WHERE collection_id=\'' . $this->collectionId . '\' AND online_' . $os . '=1'); + $r = $core->con->select('SELECT compile_date FROM book_collection_compile WHERE collection_id=\'' . $this->collectionId . '\''); while ($r->fetch()) { + $v = $r->{"online_" . $os}; + if (!$v) { + continue; + } + if (version_compare($v, $version, '>')) { + continue; + } return WS_COLLECTIONS . '/versions/' . $this->collectionId . '/' . $r->compile_date . '/' . $os . '/'; } }