]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 27 Jun 2014 10:32:27 +0000 (10:32 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 27 Jun 2014 10:32:27 +0000 (10:32 +0000)
inc/ws/Util/class.ws.exporter.php
inc/ws/Util/html5/app/class.ws.html5.app.compiler.php

index 12b61454ef4c41d5871f138bcc42f24e96a419e3..b3a2e2b0458da7723ddb93832ea6c3c454a55d2c 100644 (file)
@@ -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);
 
index 5082c6eb985f08fd13ba0a146bb5a8ed54658f2f..b2b09aa8666f2fba74089a4cbf964a22bcda40fe 100644 (file)
@@ -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 . '/';
                }
        }